目录

Querying the Export Task Status

Overview

The app server calls this API to query the execution progress of the export task in Analytics Kit. If the task processing is complete, the app server needs to download data within a specified period (currently 6 hours) and provide the data for end users.

Scenario

After the app server calls the API for exporting personal data, the Analytics Kit server will asynchronously export the data. The app server needs to periodically query the export task status so that it can download the exported data for the end user in a timely manner.

Restrictions

API Prototype

Protocol

HTTP POST

Direction

Your callback API server -> Analytics Kit server

URL

{rootUrl}/analytics/gdpr/user_data_export_tasks/v2

NOTE:

For details about {rootUrl}, please refer to API Access Address.

Data Format

Response: Content-Type: application/json

Request Parameters

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

Authentication information. 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

aaid

Yes

String

AAID, which can be obtained using the API on the device side.

Request Example

POST /analytics/gdpr/user_data_export_tasks/v2 HTTP/1.1
Content-Type: application/json; charset=UTF-8
Content-Length: xxxx
Accept: application/json
Authorization: Bearer *** 
x-product-id: sample-productid
x-app-id: sample-appid
 
{
"aaid":"sample-aaid"
}

Response Parameters

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. For details, please refer to Result Codes.

result_msg

Yes

String

Response description.

task_list

Yes

List<UserDataExportInfo>

Task list.

UserDataExportInfo parameters

Parameter

Mandatory

Type

Description

request_id

Yes

String

Request ID.

request_time

Yes

DateTime

Request time.

status

Yes

String

Task status.

  • EXPORTING: Data is being exported.

  • PENDING: Data is waiting for export.

  • EXPORTED: Exported successfully.

  • NO_DATA: No user data is available.

  • QUERY_FAILED: Query failed.

  • DATAPUSH_FAILED: Export failed.

file_path

No

String

Path for downloading the electronic copy of data. This parameter is valid only when the task status is EXPORTED.

status_time

No

DateTime

Time when the task status was last updated.

Response Example

Assume that the status code is 200.

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Connection:  Close
Content-Length: xxxx                       
 
{
  "result_code":"0",
  "result_msg":"success",
  "task_list":[{
    "request_id":"12345678",
    "request_time":"datetime",
    "status":"EXPORTED",
    "status_time":"datetime",
    "file_path":"https://xxx/xxx.xx"
  }]
}

Result Codes

Status Code

Result Code

Description

Solution

200

0

Request successful.

-

400

10020

Invalid parameter.

Check and correct the parameter value.

400

10008

Requests are too frequent.

Reduce the frequency of querying the export task status.

Debugging Using Postman

You can use Postman to debug this API online.