1.5.4 供应商类API

优质
小牛编辑
130浏览
2023-12-01

查询供应商列表

接口描述

获取所有供应商列表

URL

/provider

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
providerIdtrueString供应商编号
providerNametrueString供应商名称

HTTP请求示例

GET /provider HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2018 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
Authorization: 参见 Authorization加签规则
H-XM-V: 2.0    //接口版本号
Content-Type: application/json;charset=UTF-8  

成功响应示例

HTTP/1.1 200 OK   
Date: Thu, 15 May 2018 11:18:32 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 556
Connection: keep-alive
Server: resin4.0.13
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 1
X-RateLimit-Reset: 60
{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":[
        {
            "providerId": "CMCC_BJ",
            "providerName": "北京移动"  
        },
        {
            "providerId": "CMCC_TJ",
            "providerName": "天津移动" 
        },
        ......
    ]
} 

查询供应商信息

接口描述

根据providerId查询供应商信息

URL

/provider/{providerId}/info
providerId是供应商编码,如"CMCC_BJ"(北京移动)
参数是否必须类型描述
providerIdtrueString供应商id

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
providerIdtrueString供应商编号
providerNametrueString供应商名称

HTTP请求示例

GET /provider/{providerId}/info HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2018 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
Authorization: 参见 Authorization加签规则
H-XM-V: 2.0    //接口版本号
Content-Type: application/json;charset=UTF-8  

成功响应示例

HTTP/1.1 200 OK   
Date: Thu, 15 May 2018 11:18:32 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 556
Connection: keep-alive
Server: resin4.0.13
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 1
X-RateLimit-Reset: 60
{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "providerId": "CMCC_BJ",
        "providerName": "北京移动"  
    }
}   

新增供应商

接口描述

新增供应商

URL

/provider

HTTP Method

POST

请求参数

请求参数是否必须类型描述
providerIdtrueString供应商编号
providerNametrueString供应商名称

返回参数

返回参数是否必须类型描述
resultCodetrueint操作结果,0表示成功
resultDescfalseString操作结果描述

HTTP请求示例

POST /provider HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2018 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
Authorization: 参见 Authorization加签规则
H-XM-V: 2.0    //接口版本号
Content-Type: application/json;charset=UTF-8
{
    "providerId": "CMCC_BJ", 
    "providerName": "北京移动"
}

成功响应示例

HTTP/1.1 200 OK   
Date: Thu, 15 May 2018 11:18:32 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 556
Connection: keep-alive
Server: resin4.0.13
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 1
X-RateLimit-Reset: 60
{
    "rtnCode": 0,      
    "rtnMsg": "success",    
    "data": {
            "resultCode": 0,
            "resultDesc": "提交成功"
    }
}

变更某个供应商

接口描述

变更某个供应商

URL

/provider/{providerId}/info
providerId是供应商编码,如"CMCC_BJ"(北京移动)
参数是否必须类型描述
providerIdtrueString供应商编号

HTTP Method

POST

请求参数

请求参数是否必须类型描述
providerNametrueString供应商名称

返回参数

返回参数是否必须类型描述
resultCodetrueint操作结果,0表示成功
resultDescfalseString操作结果描述

HTTP请求示例

POST /provider/{providerId}/info HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2018 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
Authorization: 参见 Authorization加签规则
H-XM-V: 2.0    //接口版本号
Content-Type: application/json;charset=UTF-8
{
    "providerId": "CMCC_BJ", 
    "providerName": "北京移动"
}

成功响应示例

HTTP/1.1 200 OK   
Date: Thu, 15 May 2018 11:18:32 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 556
Connection: keep-alive
Server: resin4.0.13
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 1
X-RateLimit-Reset: 60
{
    "rtnCode": 0,      
    "rtnMsg": "success",    
    "data": {
            "resultCode": 0,
            "resultDesc": "提交成功"
    }
}