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 API for creating a data export task, the Analytics Kit server will asynchronously export the data. When the data export is complete, the Analytics Kit server needs to send a notification carrying the task execution status and the data download path to your app server. Therefore, your app server needs to provide an API to receive the notification so that the data can be downloaded in time.
Protocol | HTTPS POST |
|---|---|
Direction | Analytics Kit server -> your callback API server |
URL | URL you provided and configured in AppGallery Connect. |
Data Format | Request: Content-Type: application/json Response: Content-Type: application/json |
Request header
Parameter | Mandatory | Type | Description |
|---|---|---|---|
x-product-id | Yes | String | Product ID registered in AppGallery Connect. |
x-app-id | Yes | String | App ID registered in AppGallery Connect. |
Authorization | Yes | String | For details, please refer to OAuth 2.0-based Authentication. NOTE: A space character must be added between Bearer and the value of access_token. |
Request body
Parameter | Mandatory | Type | Description |
|---|---|---|---|
request_id | Yes | String | Request ID, which is returned by the API for creating a data export task. |
app_id | Yes | String | App ID registered in AppGallery Connect. |
status | Yes | String | Task status. |
file_path | No | String | Path for downloading the exported data file. This parameter is valid only when the task status is EXPORTED. |
status_time | No | DateTime | Time when the task status was last updated. |
POST /data/export/notification 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/" }
Assume that the status code is 200.
Response header
Parameter | Mandatory | Type | Description |
|---|---|---|---|
Content-Type | Yes | application/json | Response data format. |
Response body
Parameter | Mandatory | Type | Description |
|---|---|---|---|
result_code | Yes | String | Result code returned by the app server. |
result_msg | Yes | String | Result description returned by the app server. |