1.5.3 厂商代理商集团客户类API

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

查询所有商户列表

接口描述

获取所有商户列表

URL

/merchant

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
merchantIdtrueString厂商id
merchantNametrueString厂商名称
merchantNicknametrueString厂商昵称
groupCodetrueString集团编号
groupNametrueString集团名称
miidtrueString注册人miid
emailtrueString注册人邮箱
teltrueString注册人电话

HTTP请求示例

GET /merchant 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":[
        {
            "merchantId": "100000",
            "merchantName": "小米测试账户", 
            "merchantNickname": "小米测试", 
            "groupCode": "XIAOMI",     
            "groupName": "小米", 
            "miid": "10000000", 
            "email": "123456@xiaomi.com", 
            "tel": "13600000000"
        },
        ......
    ]
}   

查询商户基本信息

接口描述

根据merchantId查询商户基本信息

URL

/merchant/{merchantId}/info
merchantId是厂商的唯一标识
参数是否必须类型描述
merchantIdtrueString厂商id

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
merchantIdtrueString厂商id
merchantNametrueString厂商名称
merchantNicknametrueString厂商昵称
groupCodetrueString集团编号(所属集团唯一标识,默认小米)
groupNametrueString集团名称
miidtrueString注册人miid
emailtrueString注册人邮箱
teltrueString注册人电话

HTTP请求示例

GET /merchant/{merchantId}/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":{
            "merchantId": "100000",
            "merchantName": "小米测试账户", 
            "merchantNickname": "小米测试", 
            "groupCode": "XIAOMI",     
            "groupName": "小米", 
            "miid": "10000000", 
            "email": "123456@xiaomi.com", 
            "tel": "13600000000"
    }
}   

查询厂商的配置信息

接口描述

查询厂商的配置信息

URL

/merchant/{merchantId}/provisions
参数名称是否必选类型描述
merchantIdstring厂商id

HTTP Method

GET

请求参数

返回参数

参数名称是否必选类型描述
merchantProvisionInfoobject厂商的配置信息
configKeystring厂商的配置key
configValuestring厂商的配置值
configValueDescstring厂商的配置值描述

HTTP请求示例

查询号码的所有自定义属性信息示例
GET /merchant/100012/provisions HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2014 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
H-XM-V: 2.0    //接口版本号
Authorization: 参见 Authorization加签规则
Content-Type: application/json;charset=UTF-8

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成
{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "merchantProvisionInfo":[
            {
                "configKey":"merchant_admin",
                "configValue":"000001",
                "configValueDesc":"厂商管理员"
            },
            {
                "configKey":"merchant_general_admin",
                "configValue":"000002",
                "configValueDesc":"厂商小权限管理员"
            }
        ]
    }
}

修改该厂商下某个配置项

接口描述

修改该厂商下某个配置项

URL

/merchant/{merchantId}/provisions
参数名称是否必选类型描述
merchantIdstring厂商id

HTTP Method

POST

请求参数

参数名称是否必选类型描述
configKeystring厂商的配置key
configValuestring厂商的配置值

返回参数

参数名称是否必选类型描述
resultCodeint操作结果
resultDescstring操作结果描述

HTTP请求示例

查询号码的所有自定义属性信息示例
POST /merchant/100012/provisions HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2014 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
H-XM-V: 2.0    //接口版本号
Authorization: 参见 Authorization加签规则
Content-Type: application/json;charset=UTF-8
{
    "configKey":"merchant_admin",
    "configValue":"000002"
}

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成
{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "resultCode":0,
        "resultDesc":"修改成功"
    }
}

查询号码申请订单列表

接口描述

查询号码申请订单列表

URL

/merchant/{merchantId}/orders
参数名称是否必选类型描述
merchantIdstring厂商id

HTTP Method

GET

请求参数

参数名称是否必选类型描述
pageint当前页码,从1开始
limitint每页数量

返回参数

参数名称是否必选类型描述
cardOrderInfoobject厂商号码申请订单信息
orderIdstring订单id
orderTimelong订购时间
orderAmountlong订购数量
orderStatusstring订单状态
orderStatusDescstring订单状态描述
totallong订单数量
pageint当前页码
limitint每页数量

HTTP请求示例

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

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
    "cardOrderInfo":[
        {
            "orderId":"100016-20180308-001",    //订单ID
            "orderTime":1520490912958,    //订购时间
            "orderAmount":1000,    //订购数量
            "orderStatus":"0",    //订单状态
            "orderStatusDesc":"已申请",    //订单状态
        },
        {
            "orderId":"100016-20180308-002",
            "orderTime":1520490912959,
            "orderAmount":2000,
            "orderStatus":"1",
            "orderStatusDesc":"已撤销申请"
        }
    ],
    "total":2,
    "page":1,
    "limit":30
    }
}

提交号码申请订单

接口描述

提交号码申请订单

URL

/merchant/{merchantId}/orders
参数名称是否必选类型描述
merchantIdstring厂商id

HTTP Method

POST

请求参数

返回参数

参数名称是否必选类型描述
cardOrderInfoobject号码申请订单信息
orderIdstring号码申请订单id

HTTP请求示例

POST /merchant/100016/orders HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2014 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
H-XM-V: 2.0    //接口版本号
Authorization: 参见 Authorization加签规则
Content-Type: application/json;charset=UTF-8
{
    "operator":"",    //申请人
    "orderAmount":1000,    //申请的号码数量
    "simCardType":"1",    //sim卡类型
    "netWorkType":"1",    //网络制式
    "packageInfo":{
       "packageCode":"P1000",    //套餐档位
       "packageMonth":3,    //套餐时长
    }
    "stageInfo":{
        "testStageMonth":0,    //测试期时长
        "silenceStageMonth":0,    //沉默期时长
    }
    "smsEnable":"0",    //是否开通短信
    "sesimEnable":"0",
    "recipientsInfo":{
        "recipientsName":"小米",//收件人
        "recipientsPhoneNumber":"1068888800000",//收件人联系方式
        "recipientsAddress":"xxxxxx",//收件人地址
    }
}

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "cardOrderInfo":{
            "orderId":"e239e84d-ec2f-4a01-ace7-415bb23a3acb"
        }
    }
}

查询某号码申请订单的详情

接口描述

查询某号码申请订单的详情

URL

/merchant/{merchantId}/orders/{orderId}
参数名称是否必选类型描述
merchantIdstring厂商id
orderIdstring订单id

HTTP Method

GET

请求参数

返回参数

参数名称是否必选类型描述
cardOrderInfoobject号码申请订单信息
cardImportInfoobject订单号码导入信息

HTTP请求示例

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

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
    "orderInfo":{
        "orderId":"e239e84d-ec2f-4a01-ace7-415bb23a3acb",
        "orderAmount":1000,    //申请的号码数量
        "simCardType":"1",    //sim卡类型
        "simCardTypeDesc":"普通卡-二切",    //sim卡类型描述
        "netWorkType":"1",    //网络制式
        "netWorkTypeDesc":"1",    //网络制式描述
        "packageInfo":{
            "packageCode":"P1000",    //套餐档位
            "packageMonth":3,    //套餐时长
        },
        "stageInfo":{
            "testStageMonth":0,    //测试期时长
            "silenceStageMonth":0,    //沉默期时长
        },
        "smsEnable":"0",    //是否开通短信
        "seSimInfo":{
            "seSimType":1,
            "seSimTypeDesc":"高级卡",
            "startMid":"xxx",    //起始MID
            "endMid":"xxx",        //截止MID
        },
        "recipientsInfo":{
            "recipientsName":"小米",//收件人
            "recipientsPhoneNumber":"1068888800000",//收件人联系方式
            "recipientsAddress":"xxxxxx",//收件人地址
        },
        "orderStatus":"0",    //订单状态
        "orderStatusDesc":"已申请",    //订单状态
        },
    "cardImportInfo":[
        {
            "importId":"100016-20180308-111_1520491270613",    //号码导入ID
            "importTime":1488988800000    ,//导入时间
            "totalAmount":500,//总导入号码个数
            "testStageAmount":100,//导入号码测试期个数
            "silenceStageAmount":300,//导入号码沉默期个数
            "chargeStageAmount":100,//导入号码计费期个数
        },
        {
            "importId":"100016-20180308-111_1520491239418",    //号码导入ID
            "importTime":1489075200000    ,//导入时间
            "totalAmount":500,//总导入号码个数
            "testStageAmount":100,//导入号码测试期个数
            "silenceStageAmount":300,//导入号码沉默期个数
            "chargeStageAmount":100,//导入号码计费期个数
        }
        ]
    }
}

修改某号码申请订单的信息

接口描述

修改某号码申请订单的信息

URL

/merchant/{merchantId}/orders/{orderId}
参数名称是否必选类型描述
merchantIdstring厂商id
orderIdstring订单id

HTTP Method

POST

请求参数

参数名称是否必选类型描述
orderStatusstring订单状态

返回参数

参数名称是否必选类型描述
resultCodeint操作结果
resultDescstring操作结果描述

HTTP请求示例

POST /merchant/100016/orders/100016-20180308-003 HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2014 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
H-XM-V: 2.0    //接口版本号
Authorization: 参见 Authorization加签规则
Content-Type: application/json;charset=UTF-8
{
    "orderStatus":"1"    //订单状态
}

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "resultCode":0,
        "resultDesc":"提交成功"
    }
}

查询某个号码申请订单里的号码

接口描述

查询某个号码申请订单里的号码

URL

/merchant/{merchantId}/orders/{orderId}/sim
参数名称是否必选类型描述
merchantIdstring厂商id
orderIdstring订单id

HTTP Method

GET

请求参数

参数名称是否必选类型描述
pageint当前页码,从1开始
limitint每页号码数量

返回参数

参数名称是否必选类型描述
orderStatusstring订单状态
orderStatusDescstring订单状态描述
phoneNumberInfoobje号码信息
phoneNumberstring号码
imsistringimsi
iccidstringiccid
totallong号码总数量
pageint当前页
limitint每页号码数量

HTTP请求示例

GET /merchant/100016/orders/100016-20180308-003/sim?page=1&limit=30 HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2014 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
H-XM-V: 2.0    //接口版本号
Authorization: 参见 Authorization加签规则
Content-Type: application/json;charset=UTF-8

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "orderStatus":"6",    //订单状态
        "orderStatusDesc":"完成",    //订单状态
        "phoneNumberInfo":[
            {
                "phoneNumber":"1068888800000",
                "imsi":"460088888000000",
                "iccid":"898602B6666600000666"
            },
            {
                "phoneNumber":"1068888800001",
                "imsi":"460088888000001",
                "iccid":"898602B6666600000667"
            },
            ... ...
        ],
        "total":1000,
        "page":1,
        "limit":30
    }
}

导入某个号码申请订单的号码信息

接口描述

导入某个号码申请订单的号码信息

URL

/merchant/{merchantId}/orders/{orderId}/sim
参数名称是否必选类型描述
merchantIdstring厂商id
orderIdstring订单id

HTTP Method

POST

请求参数

返回参数

参数名称是否必选类型描述
参数名称是否必选类型描述
--------------------------------
resultCodeint操作结果
resultDescstring操作结果描述

HTTP请求示例

POST /merchant/100016/orders/100016-20180308-003/sim HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2014 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
H-XM-V: 2.0    //接口版本号
Authorization: 参见 Authorization加签规则
Content-Type: multipart/form-data;charset=UTF-8
-----------------------------5884816722133531018315377747
Content-Disposition: form-data; name="file"; filename="号码信息.txt"
Content-Type: text/plain

1068888800000:460088888000000:898602B6666600000666;
1068888800001:460088888000001:898602B6666600000667;
1068888800002:460088888000002:898602B6666600000668;

-----------------------------5884816722133531018315377747--

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "resultCode":0,
        "resultDesc":"提交成功,导入中"
    }
}

查询号码申请订单的配置

接口描述

查询号码申请订单的配置

URL

/merchant/{merchantId}/orders/{orderId}/provisions
参数名称是否必选类型描述
merchantIdstring厂商id
orderIdstring订单id

HTTP Method

GET

请求参数

返回参数

参数名称是否必选类型描述
recipientsInfoobject订单里的联系人信息
trackingNumberstring订单对应号码发货的快递号

HTTP请求示例

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

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "recipientsInfo":{
            "recipientsName":"小米",//收件人
            "recipientsPhoneNumber":"1068888800000",//收件人联系方式
            "recipientsAddress":"xxxxxx",//收件人地址
        },
        "trackingNumber":"xxx"    //string.订单对应号码发货的快递号
    }
}

变更号码申请订单的配置

接口描述

变更号码申请订单的配置

URL

/merchant/{merchantId}/orders/{orderId}/provisions
参数名称是否必选类型描述
merchantIdstring厂商id
orderIdstring订单id

HTTP Method

POST

请求参数

返回参数

参数名称是否必选类型描述
resultCodeint操作结果
resultDescstring操作结果描述

HTTP请求示例

POST /merchant/100016/orders/100016-20180308-003/provisions HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2014 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
H-XM-V: 2.0    //接口版本号
Authorization: 参见 Authorization加签规则
Content-Type: application/json;charset=UTF-8
{
    "recipientsInfo":{
        "recipientsName":"小米",//收件人
        "recipientsPhoneNumber":"1068888800000",//收件人联系方式
        "recipientsAddress":"xxxxxx",//收件人地址
    }
}

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "resultCode":0,
        "resultDesc":"提交成功"
    }
}

查询某个号码申请订单的告警

接口描述

查询某个号码申请订单的告警

URL

/merchant/{merchantId}/orders/{orderId}/alerts
参数名称是否必选类型描述
merchantIdstring厂商id
orderIdstring订单id

HTTP Method

GET

请求参数

返回参数

参数名称是否必选类型描述
alertInfoobject订单告警信息
alertIdstring订单告警id
alertMsgstring订单告警内容
alertTypestring订单告警类型
alertTypeDescstring订单告警类型描述
alertTimelong订单告警时间

HTTP请求示例

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

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "alertInfo":[
            {
                "alertId":"0-100016-001",
                "alertMsg":"xxx",
                "alertType":"0",
                "alertTypeDesc":"订单状态告警",
                "alertTime":1520490912958
            },
            {
                "alertId":"1-100016-002",
                "alertMsg":"xxx",
                "alertType":"1",
                "alertTypeDesc":"订单状态告警",
                "alertTime":1520490912958
            }
        ],
        "total":2
    }
}

查询某个号码申请订单告警详情

接口描述

查询某个号码申请订单告警详情

URL

/merchant/{merchantId}/orders/{orderId}/alerts/{alertId}
参数名称是否必选类型描述
merchantIdstring厂商id
orderIdstring订单id
alertIdstring告警id

HTTP Method

GET

请求参数

返回参数

参数名称是否必选类型描述
alertInfoobject订单告警信息
alertIdstring订单告警id
alertTypestring订单告警类型
alertTypeDescstring订单告警类型描述
alertTimelong订单告警时间
alertValuestring告警值
alertMsgstring订单告警内容

HTTP请求示例

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

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "alertInfo":{
            "alertId":"1-100016-002",
            "alertType":"1",
            "alertTypeDesc":"订单流量告警",
            "alertTime":1520491270966,
            "alertValue":"1000000",
            "alertMsg":"xxx"
        }
    }
}

查询某厂商下的基础包/加油包

接口描述

查询某厂商下的基础包/加油包

URL

/merchant/{merchantId}/products
参数名称是否必选类型描述
merchantIdstring厂商id

HTTP Method

GET

请求参数

返回参数

参数名称是否必选类型描述
baseProductInfoobject基础包信息
optionalProductInfoobject加油包信息
productCodestring产品编码
productTypestring产品类型
productDescstring产品描述
includeTrafficSizelong产品包含流量大小
includeCalllong产品包含语音大小
includeSMSlong产品包含短信大小
productPricelong产品定价
createTimelong创建时间

HTTP请求示例

GET /merchant/{merchantId}/products //查询厂商下所有的基础包/加油包
GET /merchant/{merchantId}/products?productType=base //查询厂商下所有的基础包
GET /merchant/{merchantId}/products?productType=optional //查询厂商下所有的加油包
//以查询厂商下所有的基础包/加油包为示例
GET /merchant/{merchantId}/products HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2014 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
H-XM-V: 2.0    //接口版本号
Authorization: 参见 Authorization加签规则
Content-Type: application/json;charset=UTF-8

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "baseProductInfo":[    //基础套餐包信息
            {
                "productCode":"PIB500",
                "productType":"base",
                "productDesc":"500M/月套餐包",
                "includeTrafficSize":524288000,    //long,流量大小
                "includeCall":0,    //long,语音大小
                "includeSMS":0,    //long,短信大小
                "productPrice":1000000,    //单位:千分之一分.10元
                "createTime":1520490912958//创建时间
            },
            {
                "productCode":"PIB100",
                "productType":"base",
                "productDesc":"100M/月套餐包",
                "includeTrafficSize":104857600,    //流量大小
                "includeCall":0,    //语音大小
                "includeSMS":0,    //短信大小
                "productPrice":200000,    //单位:千分之一分.2元
                "createTime":1520490912958//创建时间
            }
        ]
        "optionalProductInfo":[
            {
                "productCode":"PIO500",
                "productType":"optional",
                "productDesc":"500M加油包",
                "includeTrafficSize":524288000,    //流量大小
                "includeCall":0,    //语音大小
                "includeSMS":0,    //短信大小
                "productPrice":1000000,    //单位:千分之一分.10元
                "createTime":1520490912958//创建时间
            },
            {
                "productCode":"PIO100",
                "productType":"optional",
                "productDesc":"100M加油包",
                "includeTrafficSize":104857600,    //流量大小
                "includeCall":0,    //语音大小
                "includeSMS":"0",    //短信大小
                "productPrice":200000,    //单位:千分之一分.2元
                "createTime":1520490912958//创建时间
            }
        ]
    }
}

为厂商新增基础包/加油包

接口描述

为厂商新增基础包/加油包

URL

/merchant/{merchantId}/products
参数名称是否必选类型描述
merchantIdstring厂商id

HTTP Method

POST

请求参数

返回参数

参数名称是否必选类型描述
resultCodeint变更结果
resultDescstring变更结果描述

HTTP请求示例

POST /merchant/{merchantId}/products HTTP/1.1
Host: api.miot.10046.mi.com
Date: Thu, 15 May 2014 11:18:32 GMT
H-XM-AppId: 开放平台分配给接入方的appId
H-XM-V: 2.0    //接口版本号
Authorization: 参见 Authorization加签规则
Content-Type: application/json;charset=UTF-8
{
    "productType":"optional",
    "productDesc":"100M加油包",
    "includeTrafficSize":104857600,    //long,流量大小
    "includeCall":0,    //long,语音大小
    "includeSMS":0,    //long,短信大小
    "productPrice":200000",    //单位:千分之一分.2元
}

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "resultCode":0,
        "resultDesc":"提交成功"
    }
}

查询某个基础包/加油包详情

接口描述

查询某个基础包/加油包详情

URL

/merchant/{merchantId}/products/{productCode}
参数名称是否必选类型描述
merchantIdstring厂商id
productCodestring产品编码

HTTP Method

GET

请求参数

返回参数

参数名称是否必选类型描述
productInfoobject商户下的基础包/加油包信息
productCodestring产品编码
productTypestring产品类型
productDescstring产品描述
includeTrafficSizelong产品包含流量大小
includeCalllong产品包含语音大小
includeSMSlong产品包含短信大小
productPricelong产品定价
salePricelong产品售价
productPromotionInfoobject产品当前促销活动信息
promotionIdstring产品当前促销活动id
promotionDescstring产品当前促销活动描述
startTimelong产品当前活动开始时间
endTimelong产品当前活动截止时间

HTTP请求示例

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

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "productInfo":{
            "productCode":"PIO100"
            "productType":"optional",
            "productDesc":"100M加油包",
            "includeTrafficSize":104857600,    //long,流量大小
            "includeCall":0,    //long,语音大小
            "includeSMS":0,    //long,短信大小
            "productPrice":200000,    //产品原价,单位:千分之一分.2元
            "salePrice":100000        //产品销售价价,单位:千分之一分.1元
        },
        "productPromotionInfo":[//产品当前活动信息
            {
                "promotionId":"PIO100_1",
                "promotionDesc":"十一期间半价",
                "startTime":1506787200000,    //活动起始时间
                "endTime":1507478399999        //活动截止时间
            }
        ]
    }
}

查询厂商套餐包/加油包促销活动列表

接口描述

查询厂商套餐包/加油包促销活动列表

URL

/merchant/{merchantId}/products/promotions
参数名称是否必选类型描述
merchantIdstring厂商id

HTTP Method

GET

请求参数

参数名称是否必选类型描述
productTypestring产品类型.base:套餐包;optional:加油包

返回参数

参数名称是否必选类型描述
productPromotionInfoobject产品当前促销活动信息
promotionIdstring产品当前促销活动id
promotionDescstring产品当前促销活动描述
startTimelong产品当前活动开始时间
endTimelong产品当前活动截止时间
totalint活动总数

HTTP请求示例

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

成功响应示例

HTTP/1.1 200 OK
Date: Thu, 15 May 2014 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: 60000 // 单位毫秒
XM-Request-Id: 97ad742e-7a17-42fa-ad05-b5e559699335 // 接口本次请求的唯一标识.UUID version 4.由服务端生成

{
    "rtnCode": 0,
    "rtnMsg": "success",
    "data":{
        "productPromotionInfo":[
            {
                "promotionId":"PIO100_1",
                "promotionDesc":"十一期间半价",
                "startTime":1506787200000,    //活动起始时间
                "endTime":1507478399999        //活动截止时间
            },
            {
                "promotionId":"PIO100_2",
                "promotionDesc":"满100减10",
                "startTime":1506787200000,    //活动起始时间
                "endTime":1507478399999        //活动截止时间
            }
        ],
        "total":2
    }
}

查询该商户下可见的供应商

接口描述

根据merchantId查询该商户下可见的供应商

URL

/merchant/{merchantId}/provider
merchantId是厂商的唯一标识
参数是否必须类型描述
merchantIdtrueString厂商id

HTTP Method

GET

请求参数

返回参数

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

HTTP请求示例

GET /merchant/{merchantId}/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":[
           {
               "merchantId": "100000",
            "merchantName": "小米测试账户", 
            "providerId": "CMCC_BJ",
            "providerName": "北京移动"  
           },
           {
            "merchantId": "100000",
            "merchantName": "小米测试账户", 
            "providerId": "CMCC_TJ",
            "providerName": "天津移动"   
        }
           ......    
       ]
}   

查询商户下某个供应商

接口描述

根据merchantId和providerId查询该商户下可见的供应商

URL

/merchant/{merchantId}/provider/{providerId}
merchantId是厂商的唯一标识
providerId是供应商编码,如"CMCC_BJ"(北京移动)
参数是否必须类型描述
merchantIdtrueString厂商id
providerIdtrueString供应商id

HTTP Method

GET

请求参数

返回参数

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

HTTP请求示例

GET /merchant/{merchantId}/provider/{providerId} 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":{
           "merchantId": "100000",
        "merchantName": "小米测试账户", 
        "providerId": "CMCC_BJ",
        "providerName": "北京移动"  
       }
}   

变更某个供应商

接口描述

根据merchantId和providerId新增/变更该商户下可见的供应商

URL

/merchant/{merchantId}/provider/{providerId}
merchantId是厂商的唯一标识
providerId是供应商编码,如"CMCC_BJ"(北京移动)
参数是否必须类型描述
merchantIdtrueString厂商id
providerIdtrueString供应商编号

HTTP Method

POST

请求参数

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

返回参数

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

HTTP请求示例

POST /merchant/{merchantId}/provider/{providerId} 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
{
    "merchantId": "100000",
    "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": "提交成功"
    }
}

获取号码诊断列表

接口描述

通过merchantId和orderId获取码诊断列表

URL

/merchant/{merchantId}/order/{orderId}/diagnostics
merchantId是厂商的唯一标识
orderId订单编号
参数是否必须类型描述
merchantIdtrueString厂商id
orderIdtrueString订单编号

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
diagnosticsIdtruelong号码诊断id
merchantIdtrueString厂商id
orderIdtrueString订单id
failFileNametrueString失败文件名称
succCounttrueint成功号码数量
failCounttrueint失败号码数量
checkStartTimetrueint检查开始时间
checkEndTimetruelong检查结束时间
createTimetruelong记录创建时间

HTTP请求示例

GET /merchant/{merchantId}/order/{orderId}/diagnostics 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":[
           {
               "diagnosticsId": 123,
            "merchantId": "100000",
            "orderId": "100000-20180101-1",
            "failFileName": "100000-20180101-1_20180301060000_error",
            "succCount": 98,
            "failCount" : 2,  
            "checkStartTime": 1519833500000,
            "checkEndTime": 1519833600000,
            "createTime": 1519833600000,  
           },
           {
            "diagnosticsId": 123,
            "merchantId": "100000",
            "orderId": "100000-20180101-1",
            "failFileName": "100000-20180101-1_20180301060000_error",
            "succCount": 98,
            "failCount" : 2,  
            "checkStartTime": 1519833500000,
            "checkEndTime": 1519833600000,
            "createTime": 1519833600000,  
        }
           ......    
       ]
}   

查询某个诊断结果

接口描述

通过merchantId、orderId和diagnosticsId获取码诊断列表

URL

/merchant/{merchantId}/order/{orderId}/diagnostics/{diagnosticsId} 
merchantId是厂商的唯一标识
orderId订单编号
diagnosticsId号码检查id
参数是否必须类型描述
merchantIdtrueString厂商id
orderIdtrueString订单编号
diagnosticsIdtruelong号码诊断id

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
diagnosticsIdtruelong号码诊断id
merchantIdtrueString厂商id
orderIdtrueString订单编号
failFileNametrueString失败文件名称
succCounttrueint成功号码数量
failCounttrueint失败号码数量
checkStartTimetrueint检查开始时间
checkEndTimetruelong检查结束时间
createTimetruelong记录创建时间

HTTP请求示例

GET /merchant/{merchantId}/order/{orderId}/diagnostics/{diagnosticsId} 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":{
           "diagnosticsId": 123,
        "merchantId": "100000",
        "orderId": "100000-20180101-1",
        "failFileName": "100000-20180101-1_20180301060000_error",
        "succCount": 98,
        "failCount" : 2,  
        "checkStartTime": 1519833500000,
        "checkEndTime": 1519833600000,
        "createTime": 1519833600000,  
    }
}   

提交新的号码诊断(批量号码诊断)

接口描述

提交当前商户的可选套餐

URL

/merchant/{merchantId}/order/{orderId}/diagnostics
merchantId是厂商的唯一标识
orderId订单编号
参数是否必须类型描述
merchantIdtrueString厂商id
orderIdtrueString订单号码

HTTP Method

POST

请求参数

返回参数

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

HTTP请求示例

POST /merchant/{merchantId}/order/{orderId}/diagnostics 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
{
    "merchantId": "100000",
    "orderId": "100000-20180101-1"
}

成功响应示例

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

/merchant/{merchantId}/info
merchantId是厂商的唯一标识
参数是否必须类型描述
merchantIdtrueString厂商id

HTTP Method

POST

请求参数

请求参数是否必须类型描述
merchantNametrueString厂商名称
merchantNicknametrueString厂商昵称
groupCodetrueString集团编号
miidtrueString注册人miid
emailtrueString注册人邮箱
teltrueString注册人电话

返回参数

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

HTTP请求示例

POST /merchant/{merchantId}/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
{   
     "merchantId": "100000",
     "merchantName": "小米测试账户", 
     "merchantNickname": "小米测试", 
     "groupCode": "XIAOMI",     
     "miid": "10000000", 
     "email": "123456@xiaomi.com", 
     "tel": "13600000000"
}

成功响应示例

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": "提交成功"
    }
}

获取当前商户下的某个套餐

接口描述

通过merchantId和packageCode获取商户下的某个套餐

URL

/merchant/{merchantId}/package/{packageCode} 
merchantId是厂商的唯一标识
packageCode表示套餐编号
参数是否必须类型描述
merchantIdtrueString厂商id
packageCodetrueString套餐编码

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
packageCodetrueString套餐编码
packageTypetrueString套餐类型 base(基础包)/optional(加油包)
packageTypeDesctrueString套餐包类型描述
packagePricetruelong套餐价格,分*1000
salePricetruelong产品售价,分*1000
packageCallTimetrueint通话时长,主叫(分钟)
packageCalledTimetrueint通话时长,被叫(分钟)
packageTraffictruelong套餐流量,Byte
packageSMStrueint产品包含短信大小
packageCallerIdPricetruelong来显价格,分*1000
extraCalltruelong套餐外通话费用,分*1000
extraAnswertruelong套餐外接听电话费用,分*1000
extraTraffictruelong套餐外流量费用,每M/分*1000
statustrueint套餐当前状态
statusDesctrueString套餐状态描述,0有效,1失效
beginTimetruelong套餐开始时间
endTimetruelong套餐结束时间
createTimetruelong套餐订购时间

HTTP请求示例

GET /merchant/{merchantId}/package/{packageCode} 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": {
        "packageCode": "X1",
        "packageType": "base",
        "packageTypeDesc": "基础包",
        "packagePrice": 10,
        "salePrice": 6,
        "packageCallTime": 60,
        "packageCalledTime": 60,
        "packageTraffic": 31457280,
        "packageSMS": 10,
        "packageCallerIdPrice": 200000,
        "extraCall": 19000,
        "extraAnswer": 19000,
        "extraTraffic": 1000,
        "status": 0,
        "statusDesc": "有效",
        "beginTime": 1519833600000,  
        "endTime": 1519833600000,  
        "createTime": 1519833600000
    }
}   

获取当前商户下的可选套餐

接口描述

通过merchantId获取当前商户下的可选套餐

URL

/merchant/{merchantId}/package
merchantId是厂商的唯一标识
参数是否必须类型描述
merchantIdtrueString厂商id

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
packageCodetrueString套餐编码
packageTypetrueString套餐类型 base(基础包)/optional(加油包)
packageTypeDesctrueString套餐包类型描述
packagePricetruelong套餐价格,分*1000
salePricetruelong产品售价,分*1000
packageCallTimetrueint通话时长,主叫(分钟)
packageCalledTimetrueint通话时长,被叫(分钟)
packageTraffictruelong套餐流量,Byte
packageSMStrueint产品包含短信大小
packageCallerIdPricetruelong来显价格,分*1000
extraCalltruelong套餐外通话费用,分*1000
extraAnswertruelong套餐外接听电话费用,分*1000
extraTraffictruelong套餐外流量费用,每M/分*1000
statustrueint套餐当前状态
statusDesctrueString套餐状态描述,0有效,1失效
beginTimetruelong套餐开始时间
endTimetruelong套餐结束时间
createTimetruelong套餐订购时间

HTTP请求示例

GET /merchant/{merchantId}/package 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": [
        {
            "packageCode": "X1",
            "packageType": "base",
            "packageTypeDesc": "基础包",
            "packagePrice": 10,
            "salePrice": 6,
            "packageCallTime": 60,
            "packageCalledTime": 60,
            "packageTraffic": 31457280,
            "packageSMS": 10,
            "packageCallerIdPrice": 200000,
            "extraCall": 19000,
            "extraAnswer": 19000,
            "extraTraffic": 1000,
            "status": 0,
            "statusDesc": "有效",
            "beginTime": 1519833600000,  
            "endTime": 1519833600000,  
            "createTime": 1519833600000
        },    
        {
            "packageCode": "X3",
            "packageType": "optional",
            "packageTypeDesc": "流量加油包",
            "packagePrice": 10,
            "salePrice": 6,
            "packageCallTime": 0,
            "packageCalledTime": 0,
            "packageTraffic": 31457280,
            "packageSMS": 10,
            "packageCallerIdPrice": 0,
            "extraCall": 0,
            "extraAnswer": 0,
            "extraTraffic": 1000,
            "status": 0,
            "statusDesc": "有效",
            "beginTime": 1519833600000,  
            "endTime": 1519833600000,  
            "createTime": 1519833600000    
        }
        ......
    ]
}   

增加当前商户的可选套餐

接口描述

提交当前商户的可选套餐

URL

/merchant/{merchantId}/package
merchantId是厂商的唯一标识
请求参数是否必须类型描述
merchantIdtrueString厂商的唯一标识

HTTP Method

POST

请求参数

请求参数是否必须类型描述
packageCodetrueString套餐编码
packageTypetrueString套餐类型 base(基础包)/optional(加油包)
packagePricetruelong套餐价格,分*1000
salePricetruelong产品售价,分*1000
packageCallTimetrueint通话时长,主叫(分钟)
packageCalledTimetrueint通话时长,被叫(分钟)
packageTraffictruelong套餐流量,Byte
packageSMStrueint产品包含短信大小
packageCallerIdPricetruelong来显价格,分*1000
extraCalltruelong套餐外通话费用,分*1000
extraAnswertruelong套餐外接听电话费用,分*1000
extraTraffictruelong套餐外流量费用,每M/分*1000
statustrueint套餐当前状态
beginTimetruelong套餐开始时间
endTimetruelong套餐结束时间
createTimetruelong套餐订购时间

返回参数

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

HTTP请求示例

POST /merchant/{merchantId}/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
{
    "packageCode": "X1",
    "packageType": "base",
    "packagePrice": 10,
    "salePrice": 6,
    "packageCallTime": 60,
    "packageCalledTime": 60,
    "packageTraffic": 31457280,
    "packageSMS": 10,
    "packageCallerIdPrice": 200000,
    "extraCall": 19000,
    "extraAnswer": 19000,
    "extraTraffic": 1000,
    "status": 0,
    "beginTime": 1519833600000,  
    "endTime": 1519833600000,  
    "createTime": 1519833600000
}

成功响应示例

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": "提交成功"
    }
}

查询商户的账单信息

接口描述

根据merchantId查询商户的账单信息

URL

/merchant/{merchantId}/billing
merchantId是厂商的唯一标识
请求参数是否必须类型描述
merchantIdtrueString厂商id

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
merchantIdtrueString厂商id
orderNumbertrueString订单号码
mnoCodetrueString运营商编码
yearMonthtrueString账单年月
currentChargeAmounttrueint本月新增计费数
chargeAmounttrueint当月计费总数
createTimetruelong账单创建时间

HTTP请求示例

GET /merchant/{merchantId}/billing 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":[
           {
               "merchantId": "100000",
               "orderNumber": "100000-20180101-1", 
               "mnoCode": "CMCC_BJ", 
               "yearMonth": "201801",     
               "currentChargeAmount": 50000, 
               "chargeAmount": 150000, 
               "createTime": 1519833600000
           },
           ......    
       ]
}   

查询该商户下的所有流量池

接口描述

查询该商户下的所有流量池

URL

/merchant/{merchantId}/pool
参数名称是否必须类型描述
merchantIdtrueString厂商商户id

HTTP Method

GET

请求参数

返回参数

参数名称是否必须类型描述
poolListtruejsonArray流量池list
poolIdtruestring流量池id
poolNametruestring流量池名称
poolPackagetruestring流量池套餐

HTTP请求示例

GET /merchant/{merchantId}/pool   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":{
        "poolList":[
            {"poolId":"pool_01",poolName":"xxx流量池","poolPackage":"100M套餐"},
            {"poolId":"pool_02",poolName":"xxx流量池","poolPackage":"500M套餐"},
                ...
        ]
    }
}

查询该商户下的告警所有规则

接口描述

查询该商户下的告警列表

URL

GET /merchant/{merchantId}/alert
参数名称是否必须类型描述
merchantIdtrueString厂商商户id

HTTP Method

GET

请求参数

返回参数

参数名称是否必须类型描述
alarmListtruejsonArray告警规则list
alarmRuleTypeDesctruestring告警类型说明
triggerModeDesctruestring阈值触发条件说明
alarmRuleActionDesctruestring告警方式说明
alarmRuleIdtruestring告警规则id
alarmRuleNametruestring告警规则名称
alarmRuleTypetrueint告警类型
alarmRuleActiontrueint告警方式
alarmRuleValuetruestring告警通知人员
triggerValuetruelong阈值大小 单位:M
triggerModetrueint阈值触发条件

HTTP请求示例

GET /merchant/{merchantId}/alert  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":{
        "poolList":[
            {"alarmRuleId":"123123123","alarmRuleName":"单卡单日流量超过1M", "alarmRuleType":10,"alarmRuleTypeDesc":"sim卡昨日流量","alarmRuleAction":3,"alarmRuleActionDesc":"邮件通知","alarmRuleValue":"xxx@xiaomi.com","triggerValue":1,"triggerMode":0,"triggerModeDesc":"大于"},
            {"alarmRuleId":"123123124","alarmRuleName":"单卡单月流量超过10M","alarmRuleType":11,"alarmRuleTypeDesc":"sim卡本月流量","alarmRuleAction":3,"alarmRuleActionDesc":"邮件通知","alarmRuleValue":"xxx@xiaomi.com","triggerValue":10,"triggerMode":0,"triggerModeDesc":"大于"},
                ...
        ]
    }
}

添加一个告警规则

接口描述

添加一个告警规则

URL

 /merchant/{merchantId}/alert
参数名称是否必须类型描述
merchantIdtrueString厂商商户id

HTTP Method

POST

请求参数

参数名称是否必须类型描述
alarmRuleNametruestring告警规则名称
alarmRuleTypetrueint告警类型
alarmRuleActiontrueint告警方式
alarmRuleValuetruestring告警通知人员
triggerValuetruelong阈值大小 单位:M
triggerModetrueint阈值触发条件

返回参数

参数名称是否必须类型描述
alarmRuleIdtruestring告警规则id

HTTP请求示例

POST /merchant/{merchantId}/alert  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":{
        "alarmRuleId":"20180101_01"//告警规则唯一id
    }
}

查询该商户下的某一个告警规则信息

接口描述

查询该商户下的某一个告警规则

URL

/merchant/{merchantId}/alert/{alertId}
参数名称是否必须类型描述
merchantIdtrueString厂商商户id
alertIdtrueString规则列表

HTTP Method

GET

请求参数

返回参数

参数名称是否必须类型描述
alarmRuleTypeDesctruestring告警类型说明
triggerModeDesctruestring阈值触发条件说明
alarmRuleActionDesctruestring告警方式说明
alarmRuleIdtruestring告警规则id
alarmRuleNametruestring告警规则名称
alarmRuleTypetrueint告警类型
alarmRuleActiontrueint告警方式
alarmRuleValuetruestring告警通知人员
triggerValuetruelong阈值大小 单位:M
triggerModetrueint阈值触发条件

HTTP请求示例

GET /merchant/{merchantId}/alert/{alertId}  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":{
        "alarmRuleTypeDesc":"sim卡昨日流量",
        "triggerModeDesc":"大于",
        "alarmRuleActionDesc":"邮件通知",
        "alarmRuleId":"123123123",
        "alarmRuleName":"单卡单日流量超过1M",
        "alarmRuleType":10,
        "alarmRuleAction":3,
        "alarmRuleValue":"xxx@xiaomi.com",
        "triggerValue":1,
        "triggerMode":0

    }
}

查询该商户下的号码数量

接口描述

获取该商户下的号码数量

URL

 /merchant/{merchantId}/sim
参数名称是否必须类型描述
merchantIdtrueString厂商商户id

HTTP Method

GET

请求参数

返回参数

参数名称是否必须类型描述
simCardTotaltruelong总号码个数
testSimCardTotaltruelong测试期号码个数
slienceSimCardTotaltruelong沉默期号码个数
billingSimCardTotaltruelong计费期号码个数
onlineSimCardTotaltruelong开机号码个数
stopSimCardTotaltruelong停机号码个数
withdrawSimCardTotaltruelong销户号码个数
说明:
simCardTotal = testSimCardTotal + slienceSimCardTotal + billingSimCardTotal
billingSimCardTotal = onlineSimCardTotal + stopSimCardTotal + withdrawSimCardTotal

HTTP请求示例

GET /merchant/{merchantId}/sim  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":{
        "simCardTotal":1000,
        "testSimCardTotal":100,
        "slienceSimCardTotal":200,
        "billingSimCardTotal":700,
        "onlineSimCardTotal":560,
        "stopSimCardTotal":40,
        "withdrawSimCardTotal":100
    }
}

查询该商户下的号码信息列表

接口描述

获取该商户下的号码信息列表

URL

 /merchant/{merchantId}/sim/list
参数名称是否必须类型描述
merchantIdtrueString厂商商户id

HTTP Method

GET

请求参数

参数名称是否必须类型描述
pagetrueint页码,从1开始
limittrueint每页的数量

返回参数

参数名称是否必须类型描述
totaltruelong此次查询所包含的全部的记录数
pagetrueint此次的页签索引,从1开始
limittrueint每页显示的数量
simCardListtruejsonArray号码信息list
iccidtruestringiccid
imsitruestringimsi
phoneNumbertruestring电话号码
packageNametruestring套餐信息
currentStagetrueint号码当前计费周期
currentStageDesctruestring号码计费周期说明
testBeginTImetruelong测试期开始时间 unix 13位时间戳
testEndTImetruelong测试期结束时间 unix 13位时间戳
slienceBeginTimetruelong沉默期开始时间 unix 13位时间戳
slienceEndTimetruelong沉默期结束时间 unix 13位时间戳
activateTimefalselong激活时间 unix 13位时间戳
说明:如果号码没有激活返回结果中没有activateTime字段

HTTP请求示例

GET /merchant/{merchantId}/sim/list  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":{
        "total":150,
        "page":2,
        "limit":50,
        "simCardList":[
            {"iccid":"89898989898","imsi":"2323232323","phoneNumber":"11111111111","packageName":"10M流量套餐","currentStage":2,"currentStageInfo":"计费期", "testBeginTIme":1521023322000,"testEndTIme":1521023322000,"slienceBeginTime":1521023322000,"slienceEndTime":1521023322000,"activateTime":1521023322000},
            {"iccid":"89898989899","imsi":"2323232324","phoneNumber":"11111111112","packageName":"100M流量套餐","currentStage":1,"currentStageInfo":"沉默期","testBeginTIme":1521023322000,"testEndTIme":1521023322000,"slienceBeginTime":1521023322000,"slienceEndTime":1521023322000},//号码没有激活没有activateTime字段

            ...
        ]
    }
}

查询该商户订阅的通知

接口描述

查询商户订阅的通知

URL

  /merchant/{merchantId/notify
参数名称是否必须类型描述
merchantIdtrueString厂商商户id

HTTP Method

GET

请求参数

返回参数

参数名称是否必须类型描述
notifyUrltruestring通知url
notifyListtruejsonArray通知list
notifyIdtrueint通知编码
notifyNametruestring通知名称

HTTP请求示例

GET  /merchant/{merchantId/notify   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":{
        "notifyUrl":"www.baidu.com/notify",
        "notifyList":[
            {"notifyId":12312,"notifyName":"号码生命周期通知"},
            {"notifyId":12310,"notifyName":"短信回执通知"}
            ...
        ]
    }
}

商户订阅某个通知

接口描述

查询商户订阅的通知

URL

POST  /merchant/{merchantId/notify/{notifyId}
参数名称是否必须类型描述
merchantIdtrueString厂商商户id
notifyIdtrueint通知编码

HTTP Method

POST

请求参数

参数名称是否必须类型描述
notifyUrltruestring通知url

返回参数

参数名称是否必选类型描述
resultCodetrueint变更结果
resultDesctruestring变更结果描述

HTTP请求示例

GET  /merchant/{merchantId/notify/{notifyId}   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":{
        "resultCode":0,
        "resultDesc":"提交成功"
    }
}