Help Center/ Huawei Cloud Astro Zero/ API Reference/ APIs/ Import and Export/ Importing Data by Using a Template
Updated on 2025-05-13 GMT+08:00

Importing Data by Using a Template

Function

This API is used to import data by using a template. Before importing data, you need to create a data import template and define data mapping rules in the template. When this API is called, the template name must be specified and the operation script must be defined in the template. The import process may take a long time. The import result will not be returned immediately. After the import is complete, you can view the execution status of the scheduled task based on the obtained task ID.

URI

POST Huawei Cloud Astro Zero domain name/u-route/baas/bulk/v1.0/template/xlsx?template={template}&filename={filename}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

template

Yes

String

Explanation

Name of the data import template.

Constraints

None

Value

None

Default value

None

filename

Yes

String

Explanation

Name of the file to upload.

Constraints

The file can be in XLS or XLSX format.

Value

None

Default value

None

Request Parameters

None

Response Parameters

This API has no response parameter. If the HTTP status code is 200, the file is successfully uploaded. The data import task is executed in the backend.

Example Request

To import local file myData.xlsx by using the template named myTemplate, send the following request:
POST https://Huawei Cloud Astro Zero domain name/ u-route/baas/bulk/v1.0/template/xlsx?template=myTemplate&filename=myData.xlsx

Example Response

None

Status Code

See Status Codes.

Error Code

See Error Codes.