目录

设备解绑

功能介绍

南向GPRS设备接入,在生态应用中删除设备,解除绑定关系。

场景描述

南向GPRS设备接入,解除设备与运动健康App的绑定关系。南向GPRS设备接入生态应用场景请参见GPRS设备章节。

使用约束

接口原型

承载协议

HTTPS POST

接口方向

开发者应用->Health Service Kit云

接口URL

https://health-api.cloud.huawei.com/healthkit/v2/devices:unBind

数据格式

请求消息:Content-Type: application/json

响应消息:Content-Type: application/json

请求参数

Request Header

参数

参数类型

是否必选

描述

Content-type

String

是

取值为:application/json; charset=UTF-8

Authorization

String

是

请参见认证鉴权。

说明:

Bearer后面拼接空格,再拼接获取的access_token。

x-client-id

String

否

开放联盟分配的应用标识。服务端可以基于其进行灰度路由,建议携带。

x-version

String

否

接口调用方的软件版本号。即当前客户端版本号,服务端可以基于其进行灰度,建议携带。

x-caller-trace-id

String

否

请求跟踪ID。用于串联服务调用方与服务端整体请求链条,建议携带。

Request Body

参数

参数类型

是否必选

描述

deviceCode

Long

是

设备绑定时生成的绑定码。

请求示例

POST
https://health-api.cloud.huawei.com/healthkit/v2/devices:unBind
Content-Type: application/json
Authorization: Bearer ***
x-client-id: ***
x-version: ***
x-caller-trace-id: ***
{
    "deviceCode": 300000000150614960
}

响应参数

状态码为200时:

Response Header

参数

参数类型

是否必选

描述

Content-Type

String

是

取值为:application/json; charset=UTF-8

Response Body

参数

参数类型

是否必选

描述

deviceCode

Long

否

设备绑定时生成的绑定码。

dataCollectors

List<DataCollector>

否

数据采集器列表。

响应示例

HTTP/1.1 200 OK
Content-type: application/json;charset=utf-8
{
    "deviceCode": 300000000150614960,
    "dataCollectors": [
        {
            "collectorId": "cmF3Omluc3RhbnRhbmVvdXMuYmxvb2RfZ2x1Y29zZQEwMTI3ODUwMTpqEF7rB3uBcGykpv6T2TisfTMhfZAvz1BP2Kcz70d1Sg",
            "collectorType": "raw",
            "collectorDataType": {
                "name": "com.huawei.instantaneous.blood_glucose",
                "field": [
                    {
                        "name": "level",
                        "format": "float",
                        "optional": false
                    },
                    {
                        "name": "measure_time",
                        "format": "integer",
                        "optional": false
                    },
                    {
                        "name": "sample_source",
                        "format": "integer",
                        "optional": true
                    }
                ]
            },
            "deviceInfo": {
                "uniqueId": "yy1240",
                "devType": "Phone",
                "version": "1.0",
                "modelNum": "mp",
                "manufacturer": "Huawei",
                "prodId": "180S",
                "devId": "bcbfcaaf-9f7a-4fc6-89cc-2997d1fe2e35",
                "deviceCode": 300000000150614960,
                "bindStatus": 1
            },
            "appInfo": {
                "appName": "com.huawei.health.device",
                "appVersion": "v1.0",
                "desc": "com.huawei.health.device",
                "clientId": "300013102"
            },
            "name": "300000000150614960",
            "lastUpdateTime": 0
        }
    ]
}

错误码

请参见错误码。