目录

Deleting Personal Data

Overview

When an end user initiates a personal data deletion request on the app, the app server calls this API to delete data from Analytics Kit.

Scenario

As required by the GDPR, you may need to allow end users to delete their personal data by providing a button in your app. When a user taps this button, your app server calls this API to delete all personal data that has been collected and reported to the Analytics Kit server.

Restrictions

API Prototype

Protocol

HTTP POST

Direction

Your callback API server -> Analytics Kit server

URL

{rootUrl}/analytics/gdpr/user_deletion_requests/v2

NOTE:

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

Data Format

Request: Content-Type: application/json

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

No

String

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

Request Example

POST /analytics/gdpr/user_deletion_requests/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.

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"
}

Result Codes

Status Code

Result Code

Description

Solution

200

0

Request successful.

-

400

10020

Invalid parameter.

Check and correct the parameter value.

400

10032

The data cannot be deleted because it is being exported.

Display a message indicating that the data is being exported and asking the user to try again after the data export is complete.

400

10033

The data has been deleted.

Display a message indicating that the data has been deleted.

400

10008

Requests are too frequent.

Display a message prompting the user to reduce the frequency of requesting data deletion and asking the user to try again later.

Debugging Using Postman

You can use Postman to debug this API online.