目录

Querying the Device Marking Status

Function Description

Your app server can call this API to query the device marking status.

Description

After obtaining a device token, you can call this API to query the device marking status. If a device has not been marked, Notfound will be returned.

Constraints

None

Prototype

Request Parameters

Request Header

Parameter Mandatory Type Description
Content-Type No String Content type. The value is application/json;charset=utf-8.
Authorization Yes String Access token generated from a service account.
bundleName Yes String Your app package name.

The value of Authorization is Bearer followed by a space character and then the obtained authentication information. For details about how to generate a token, see Sample Code

Request Body

Parameter Mandatory Type Description
mode Yes Int

Granularity of the device marking status. The options are as follows:

1: app-level

2: developer-level

Note: Device marking statuses at different granularities are independent of each other.

The developer-level device marking status is shared among all apps of the same developer. For example, after app A of a given developer updates the device marking status, the device marking status queried by app B of this developer will also change accordingly.

deviceToken Yes String Temporary device token obtained by the client via getDeviceToken.
transactionId No String Unique transaction ID of an app service, which is used to associate the service context.
timestamp Yes Long UTC time on the app server, in milliseconds.

When constructing a message body, you need to wrap a data structure around the message body. For details, see the following API call example.

Request Example

POST /api/rms/v1/deviceVerify/getDeviceStatus HTTP/1.1
Host: xxx
Authorization: Bearer eyJr*****OiIx---****.eyJh*****iJodHR--***.QRod*****4Gp---****
bundleName: com.huawei.xxx
Content-Type: application/json;charset=utf-8

{"data":{ "mode":1, "deviceToken":"xxx", "transactionId":"ddc740b9-45bb-424a-bc50-64e8a813acad", "timestamp":1711072205525}}

Response Parameters

Response Body

Parameter Mandatory Type Description
bundleName No String Package name obtained from a device token for your verification.
bit0 No Boolean First bit of the device marking status.
bit1 No Boolean Second bit of the device marking status.
lastUpdateTime No Long UTC time when the data was last updated, in milliseconds. The time precision is rounded to midnight on the first day of each month. For example, the UTC timestamp 1722441600000 corresponds to standard time 2024-08-01 00:00:00.
errorCodes Yes String Error code.

Response Example

HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8

{"bundleName":"xxx","bit0":true,"bit1":false,"lastUpdateTime":1711072206323,"errorCodes":"OK"}

Error Codes

For details about the error codes, see REST API Error Codes.

Error Code Description
OK The request is successfully processed.
NotFound No marking record about the device is found. (The device is authenticated successfully but not marked.)
InvalidDeviceToken The device token is missing or invalid.
InvalidMode The mode is missing or invalid.
DeviceTokenExpired The device token has expired.
InvalidTimeStamp The timestamp is missing or invalid.
InternalServerError Internal server error.
InvalidBundleName The package name is missing or invalid.