查询指定产品的详细信息
接口说明
应用服务器可调用此接口查询指定产品信息,用于查询一类型设备的基本信息。
URI
| 请求方法 | GET |
|---|---|
| URI | /api/v3.0/products/{productId} |
| 传输协议 | HTTPS |
请求参数
| 名称 | 必选/可选 | 类型 | 位置 | 说明 |
|---|---|---|---|---|
| app_key | 必选 | String | Header | 已鉴权应用的appId。 |
| Authorization | 必选 | String | Header | 请求的认证信息,值为“Bearer ******”,其中******为Auth鉴权接口返回的accessToken。 |
| productId | 必选 | String | Path | 产品ID。 |
| ownerAppId | 可选 | String | Query | 资源所属应用的appId,访问其他应用所持有的资源时需要填写。 |
响应参数
| 名称 | 类型 | 说明 |
|---|---|---|
| productId | String | 产品ID。 |
| deviceType | String | 设备类型。 |
| manufacturerId | String | 厂商ID。 |
| manufacturerName | String | 厂商名。 |
| model | String | 设备型号。 |
| protocolType | String | 协议类型。 |
| description | String | 产品描述。 |
请求示例
GET https://{host}:{port}/api/v3.0/products/{productId}?ownerAppId={ownerAppId}
Content-Type: application/json
app_key: ********
Authorization: ********
响应示例
Status Code: 200 OK
Content-Type: application/json
{
"productId" : "string",
"deviceType" : "string",
"manufacturerId" : "string",
"manufacturerName" : "string",
"model" : "string",
"protocolType" : "string",
"description" : "string"
} 错误码
| HTTP状态码 | HTTP状态码说明 | 错误码 | 错误码描述 |
|---|---|---|---|
| 200 | OK | - | - |
| 400 | Bad Request | 700002 | Product id is null or emtpy. 处理建议:检查请求是否携带了正确的产品ID。 |
| 401 | Unauthorized | 100025 | App for auth not exist. 处理建议:确认App是否已经创建并获取权限。 |
| 403 | Forbidden | 100203 | The application is not existed. 处理建议:确认App是否已经创建。 |
| 100217 | The application hasn't been authorized. 处理建议:确认App是否获取权限。 |
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.