目录

Function

This API is used to by the developer's server to send a delivery success notification to Huawei server after delivery is complete.

Prototype

Protocol

HTTPS PUT

Direction

Developer's server -> Huawei server

URL

https://connect-api.cloud.huawei.com/api/dps/v1/usage/delivery/callback

Data Format

Request: Content-Type: application/json

Response: Content-Type: application/json

Restrictions

This API can be called only after the API client is authenticated by Huawei server. For details, please refer to Obtaining a Token.

Input Parameters

Parameters in the header:

Parameter

Mandatory (M)/Optional (O)

Type

Description

developerId

M

String

CP ID of a developer account, which uniquely identifies the current developer.

appId

M

String

App ID. For details about how to obtain an app ID, please refer to Querying App Information.

client_id

M

String

Client ID generated in Creating an API Client.

authorization

M

String

Authentication information in the format of Authorization: Bearer ${access_token}. The access token is obtained in Obtaining a Token. The validity period of the access token is determined by expires_in returned for Obtaining a Token.

productId

M

String

ID of the product to which the app belongs. For details about how to query a product ID, please refer to Querying the Product ID.

Parameters in the body:

Parameter

Mandatory (M)/Optional (O)

Type

Description

orderId

M

String

Order ID.

productNo

M

String

ID of a delivered product.

openId

M

String

Unique ID of a user. The value of openId is passed.

status

M

int

Delivery status. Currently, only 0 is supported, indicating that the delivery is successful.

ts

M

long

Timestamp of the notification sending time.

Output Parameters

Parameter

Mandatory (M)/Optional (O)

Type

Description

error

O

String

JSON character string containing the operation result when the processing fails. The format is {"errorCode": xxx, "errorMsg": xxxx}.

  • errorCode: result code. For details, please refer to Result Codes.

  • errorMsg: description of the result code.

data

O

String

JSON character string containing the operation result when the processing is successful. The format is {"result": 0}. 0: success

Result Codes

Result Code

Description

1

Authentication failed.

2

Timeout.

3

The service information is incorrect. For example, the order does not exist.

11

The product does not exist.

12

The user does not exist.

94

System error.

95

I/O error.

96

Incorrect request URL.

97

Incorrect response.

98

Incorrect parameter.

99

Other error.

Example

Type

Example

Request

PUT {Third-party app server URL} HTTP/1.1

Content Type : application/json ; charset=UTF-8

{

"orderId": "string",

"productNo": "string",

"openId": "string",

"status": 0

"ts": 12312313123131123

}

Response

HTTP/1.1 200 OK

Content Type : application/json ; charset=UTF-8

{

"error": {

"errorCode": 0,

"errorMsg": "string"

}

}

or

{

"data": {

"result": 0

}

}