You need to implement this API to receive the execution status of a data export task. After a data export task is complete, this API can be used to return the data export result and download path.
After the app server calls the interface that creates a data export task, the Analytics Kit server will asynchronously export the data. When the data export is completed, the Analytics Kit server needs to send a notification carrying the task execution task and the data download path to your app server. Therefore, your app server needs to provide an interface to receive the notification so that the user can download the data in time.
You need to implement a server API based on the interface definitions to receive notifications.
After receiving the notification message, the app server of the developer needs to download the exported data file within 2 hours.
| Protocol | HTTPS POST |
|---|---|
| Direction | HUAWEI Analytics Kit server -> Developer callback API server |
| URL | {rootUrl}/sub/applications/{apiVersion}/purchases/get |
| Data Format | Request: Content-Type: application/json Response: Content-Type: application/json |
| Parameter | Mandatory/Optional | Type | Description |
|---|---|---|---|
request_id | Mandatory | string | Request ID, which is returned by the API for creating a data export task. |
app_id | Mandatory | string | App ID registered in AppGallery Connect. |
status | Mandatory | string | Task status
|
file_path | Optional | string | Path for downloading the exported file. This field has a value only when status is EXPORTED. |
status_time | Optional | DateTime | Last status update time. |
| Parameter | Type | Description |
|---|---|---|
result_code | String | Result code returned by the app server. |
result_msg | String | Result description returned by the app server. |
- HTTP/1.1 200 OK
- Content-Type: application/json; charset=UTF-8
- Connection: Close
- Content-Length: xxxx
- {
- "result_code":"0",
- "result_msg":"success",
- }
- POST /data/export/notifcation HTTP/1.1
- User -Agent: Jakarta Commons - HttpClient / 3.1
- Host: 10.137.165.233:8566
- Content-Type: application/json; charset=UTF-8
- Content-Length: xxxx
- Accept: application/json
- {
- "request_id": "sample-req-id",
- "app_id": "sample-appid",
- "status": "EXPORTED",
- "file_path": "https://sample.com/sample_path/"
- }