目录 (Table of Contents)

SIM卡类相关接口

查询SIM卡基本信息

接口描述

通过iccid或者phoneNumber查询号码的基本信息

URL

/sim/{simId}/info
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称 是否必选 类型 描述
merchantId string 号码所属厂商
phoneNumber string 号码
imsi string imsi
iccid string iccid
importTime long 导入时间
activeTime long 激活时间.如果激活,返回激活时间

HTTP请求示例

GET /sim/1068888800000/info 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":{
        "merchantId":"100016",
        "phoneNumber":"1068888800000",
        "imsi":"460088888000000",
        "iccid":"898602B6666600000666",
        "importTime":1495781089724,
        "activeTime":1495781089724
    }
}

查询号码生命周期

接口描述

查询号码生命周期

URL

/sim/{simId}/stage
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称 是否必选 类型 描述
stage int 当前所在生命周期
stageDesc string 当前所在生命周期描述
stageTimeInfo object 生命周期信息
testStageStartTime long 测试期开始时间
testStageEndTime long 测试期截止时间
silenceStageStartTime long 沉默期开始时间
silenceStageEndTime long 沉默期截止时间

HTTP请求示例

GET /sim/1068888800000/stage 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":{
        "stage":2,
        "stageDesc":"计费期",
        "stageTimeInfo":{
            "testStageStartTime":1508083200000,
            "testStageEndTime":1508083200000,
            "silenceStageStartTime":1509465600000,
            "silenceStageEndTime":1525104000000
        }
    }
}

变更号码生命周期

接口描述

变更号码生命周期

URL

/sim/{simId}/stage
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

POST

请求参数

参数名称 是否必选 类型 描述
stage int 要变更的生命周期,取值0/1/2.0:测试期/1:沉默期/2:计费期

返回参数

参数名称 是否必选 类型 描述
resultCode int 变更结果
resultDesc string 变更结果描述

HTTP请求示例

POST /sim/1068888800000/stage 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
{
    "stage":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

/sim/{simId}/stage/logs
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称 是否必选 类型 描述
stageLogInfo object 生命周期变更信息
fromStage int 变更前的生命周期
fromStageDesc string 变更前的生命周期描述
toStage int 变更后的生命周期
toStageDesc string 变更后的生命周期描述
stageChangeTime long 生命周期变更时间
stageChangeDesc string 生命周期变更描述
sourceId string 来源id
sourceIdDesc string 来源id描述
operator string 操作人
total long 号码状态变更记录数

HTTP请求示例

GET /sim/1068888800000/stage/logs 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":{
        "stageLogInfo":[
            {
                "fromStage":0,
                "fromStageDesc":"测试期",
                "toStage":1,
                "toStageDesc":"沉默期",
                "stageChangeTime":1487001600000,
                "stageChangeDesc":"测试期到沉默期",
                "sourceId":"openAPI",
                "sourceIdDesc":"开放API",
                "operator":"小米"
            },
            {
                "fromStage":1,
                "fromStageDesc":"沉默期",
                "toStage":2,
                "toStageDesc":"计费期",
                "stageChangeTime":1487001600000,
                "stageChangeDesc":"主动激活,进入计费期",
                "sourceId":"openAPI",
                "sourceIdDesc":"开放API",
                "operator":"小米"
            }
        ],
        "total":2
    }
}

查询生命周期告警记录列表

接口描述

查询号码生命周期告警记录列表

URL

/sim/{simId}/stage/alerts
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述

返回参数

参数名称 是否必选 类型 描述
stageAlertInfo object 生命周期告警信息
alertId string 告警id
alertTime long 告警时间
alertMsg string 告警内容
total long 告警记录数

HTTP请求示例

GET /sim/1068888800000/stage/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":{
        "stageAlertInfo":[
            {"alertId":"100012-20170201-001","alertTime":1495781089724,"alertMsg":"测试期转沉默期"},
            {"alertId":"100012-20170301-002","alertTime":1495782022668,"alertMsg":"沉默期转计费期"}
        ],
        "total":2
    }
}

查询生命周期告警详情

接口描述

查询号码生命周期告警详情

URL

/sim/{simId}/stage/alerts/{alertId}
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber
alertId string 生命周期告警ID

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述

返回参数

参数名称 是否必选 类型 描述
stageAlertInfo object 生命周期告警信息
alertId string 告警id
alertTime long 告警时间
alertMsg string 告警内容
testStageStartTime long 测试期开始时间
testStageEndTime long 测试期截止时间
silenceStageStartTime long 告警内容
silenceStageEndTime long 告警内容
sourceId string 来源id
sourceIdDesc string 来源id描述

HTTP请求示例

GET /sim/1068888800000/stage/alert/100012-20170201-001 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":{
        "stageAlertInfo":{
            "alertId":"100012-20170201-001",//string.告警ID
            "alertTime":1485888400000,    //long.告警时间
            "alertMsg":"测试期转沉默期",    //string.告警消息
            "testStageStartTime":1485878400000,    //long.测试期开始时间
            "testStageEndTime":1488297600000,    //long.测试期截止时间
            "silenceStageStartTime":1488297600000,    //long.沉默期开始时间
            "silenceStageStartTime":1490976000000,    //long.沉默期截止时间
            "sourceId":"openApi",
            "sourceIdDesc":"开放API"
        }
    }
}

查询号码状态

接口描述

查询号码状态

URL

/sim/{simId}/status
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述

返回参数

参数名称 是否必选 类型 描述
status int 号码状态
statusDesc string 号码状态描述

HTTP请求示例

GET /sim/1068888800000/status 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":{
        "status":10,//int.当前号码状态
        "statusDesc":"已开机",//string.当前号码状态描述
   }
}

变更号码状态

接口描述

变更号码状态

URL

/sim/{simId}/status
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

POST

请求参数

参数名称 是否必选 类型 描述
status int 变更时,要变更的号码状态
operator string 操作号码状态变更人员

返回参数

参数名称 是否必选 类型 描述
resultCode int 操作结果
resultDesc string 操作结果描述

HTTP请求示例

POST /sim/1068888800000/status 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
{
    "status":10,
    "operator":"小米"
}

成功响应示例

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

/sim/{simId}/status/logs
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述
startTime long 起始时间.不指定查询时间,默认返回包含当天的7天内记录
endTime long 截止时间.不指定查询时间,默认返回包含当天的7天内记录

返回参数

参数名称 是否必选 类型 描述
statusChangeLog object 号码状态变更信息
actionType string 操作类型
actionTypeDesc string 操作类型描述
actionResult string 操作结果
actionResultDesc string 操作结果描述
statusChangeTime long 状态变更时间
statusChangeDesc string 状态变更描述
sourceId string 来源id
sourceIdDesc string 来源id描述
operator string 操作人
total long 号码状态变更记录数

HTTP请求示例

GET /sim/1068888800000/status/logs 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":{
        "statusChangeLog":[
        {
            "actionType":"off",
            "actionTypeDesc":"停机",
            "actionResult":"1",
            "actionResultDesc":"处理中",
            "statusChangeTime":1487001600000,
            "statusChangeDesc":"超套餐流量自动停机",
            "sourceId":"openAPI",
            "sourceIdDesc":"开放API",
            "operator":"小米"
        },
        {
            "actionType":"on",
            "actionTypeDesc":"开机",
            "actionResult":"3",
            "actionResultDesc":"成功",
            "statusChangeTime":1487001600000,
            "statusChangeDesc":"充值后开机",
            "sourceId":"openAPI",
            "sourceIdDesc":"开放API",
            "operator":"小米"
            }
        ],
        "total":2
   }
}

查询号码状态告警列表

接口描述

查询号码状态告警列表

URL

/sim/{simId}/status/alerts
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述
startTime long 起始时间.不指定查询时间,默认返回包含当天的7天内告警
endTime long 截止时间.不指定查询时间,默认返回包含当天的7天内告警

返回参数

参数名称 是否必选 类型 描述
statusAlertInfo object 号码状态告警信息
alertId string 号码状态告警id
alertTime long 号码状态告警时间
alertMsg string 号码状态告警内容
total long 号码状态告警记录数

HTTP请求示例

GET /sim/1068888800000/status/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":{
        "statusAlertInfo":[
            {
                "alertId":"100012-20170214-001", //告警ID
                "alertTime":1487001600000,    //告警时间
                "alertMsg":"开机状态,操作停机成功"    //告警消息
            },
            {
                "alertId":"100012-20170215-002",
                "alertTime":1487002600000,
                "alertMsg":"停机状态,操作开机成功"
            }
        ],
       "total":2
    }
}

查询号码状态告警详情

接口描述

查询号码状态告警详情

URL

 /sim/{simId}/status/alerts/{alertId}
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber
alertId string 号码状态告警id

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述

返回参数

参数名称 是否必选 类型 描述
statusAlertInfo object 号码状态告警信息
alertId string 号码状态告警id
alertTime long 号码状态告警时间
alertMsg string 号码状态告警内容
changeTime long 状态变更时间
operator string 操作人
sourceId string 来源id
sourceIdDesc string 来源id描述

HTTP请求示例

GET /sim/1068888800000/status/alerts/100012-20170215-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":{
        "statusAlertInfo":{
            "alertId":"100012-20170215-002",
            "alertTime":1487002600000,
            "alertMsg":"停机状态,操作开机成功",
            "changeTime":1487002600000,//状态变更时间
            "operator":"小米",    //号码状态变更操作人
            "sourceId":"openAPI",
            "sourceIdDesc":"开放API"
        }
    }
}

查询号码实名信息

接口描述

查询号码实名信息

URL

 /sim/{simId}/identity
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述

返回参数

参数名称 是否必选 类型 描述
identityInfo object 号码实名信息
submitTime long 实名信息提交时间
name string 姓名
idNumber string 身份证号码
sourceId string 来源Id
sourceIdDesc string 来源Id描述
identityStatus string 当前实名状态
identityStatusDesc string 当前实名状态描述
changeTime long 实名状态变更时间
photoInfo object 号码实名提交照片信息
bucket string 实现照片存储信息
photoId string 实现照片id
photoType string 号码实名类型
photoTypeDesc string 号码实名类型描述

HTTP请求示例

GET /sim/1068888800000/identity 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":{
        "identityInfo":{
            "submitTime":1487002600000,    //实名信息提交时间
            "name":"小米",
            "idNumber":"..."    //身份证号码
            "sourceId":"openAPI",
            "sourceIdDesc":"开放API",
            "identityStatus":"0",
            "identityStatusDesc":"待审核",
            "changeTime":1487002600000,//实名状态变更时间
            "photoInfo":[
                {
                    "bucket":"identity",
                    "photoId":"a873c134-02fa-4507-b16a-6136dd0bad13",
                    "photoType":"10",
                    "photoTypeDesc":"身份证正面照"
                },
                {
                    "bucket":"identity",
                    "photoId":"a873c134-02fa-4507-b16a-6136dd0bad14",
                    "photoType":"11",
                    "photoTypeDesc":"手持身份证正面照"
                },
                {
                    "bucket":"identity",
                    "photoId":"a873c134-02fa-4507-b16a-6136dd0bad15",
                    "photoType":"12",
                    "photoTypeDesc":"手持身份证反面照"
                }
            ]
        }
    }
}

提交号码实名信息

接口描述

提交号码实名信息

URL

 /sim/{simId}/identity
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

POST

请求参数

参数名称 是否必选 类型 描述
name string 姓名
idNumber string 身份证号码
photoInfo object 证件对应照片信息
bucket string 实现照片存储信息
photoId string 实现照片id
photoType string 号码实名类型

返回参数

参数名称 是否必选 类型 描述
resultCode int 提交实现结果
resultDesc string 提交实现结果描述

HTTP请求示例

POST /sim/1068888800000/identity 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
{
    "name":"小米",
    "idNumber":"xxx",
    "photoInfo":[
        {
            "bucket":"identity",
            "photoId":"a873c134-02fa-4507-b16a-6136dd0bad13",
            "photoType":"10"
        },
        {
            "bucket":"identity",
            "photoId":"a873c134-02fa-4507-b16a-6136dd0bad14",
            "photoType":"11"
        },
        {
            "bucket":"identity",
            "photoId":"a873c134-02fa-4507-b16a-6136dd0bad15",
            "photoType":"12"
        }
    ]
}

成功响应示例

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

 /sim/{simId}/identity/status
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述

返回参数

参数名称 是否必选 类型 描述
identityStatusInfo object 号码实名状态信息
identityStatus string 号码实名状态

HTTP请求示例

GET /sim/1068888800000/identity/status 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":{
        "identityStatusInfo":{
            "identityStatus":"0",
            "identityStatusDesc":"待审核"
        }
    }
}

修改号码实名状态

接口描述

修改号码实名状态

URL

 /sim/{simId}/identity/status
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

POST

请求参数

参数名称 是否必选 类型 描述
identityStatus string 实名状态

返回参数

参数名称 是否必选 类型 描述
resultCode int 提交修改结果
resultDesc string 提交修改结果描述

HTTP请求示例

POST /sim/1068888800000/identity/status 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
{
    "identityStatus":"3"
}

成功响应示例

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

 /sim/{simId}/identity/alerts
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述

返回参数

参数名称 是否必选 类型 描述
identityAlertInfo object 号码实名告警信息
fromStatus string 原实名状态
fromStatusDesc string 原实名状态描述
toStatus string 新实名状态
toStatusDesc string 新实名状态描述
alertId string 告警id
alertTime string 告警时间
alertMsg string 告警内容
total long 告警记录数量

HTTP请求示例

GET /sim/1068888800000/identity/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":{
        "identityAlertInfo":[
            {
                "fromStatus":"0",
                "fromStatusDesc":"待审核",
                "toStatus":"0",
                "toStatusDesc":"待审核",
                "alertId":"100012-20170214-001",//string.实名告警ID,
                "alertTime":1487001600000,//long.告警时间
                "alertMsg":"实名信息提交成功"//string.告警消息
            },
            {
                "fromStatus":"0",
                "fromStatusDesc":"待审核",
                "toStatus":"1",
                "toStatusDesc":"审核通过",
                "alertId":"100012-20170214-002",//string.实名告警ID,
                "alertTime":1487001600000,//long.告警时间
                "alertMsg":"实名认证成功"//string.告警消息
            }
        ],
        "total":2
    }
}

查询号码实名告警详情

接口描述

查询号码实名告警详情

URL

/sim/{simId}/identity/alerts/{alertId}
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber
alertId string 告警id

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述

返回参数

参数名称 是否必选 类型 描述
identityAlertInfo object 号码实名告警信息
alertId string 号码实名告警id
alertTime long 号码实名告警时间
alertMsg string 号码实名告警内容
submitTime long 号码实名提交时间
sourceId string 来源id
sourceIdDesc string 来源id描述
fromStatus string 原号码实名状态
fromStatusDesc string 原号码实名状态描述
toStatus string 新号码实名状态
toStatusDesc string 新号码实名状态描述

HTTP请求示例

GET /sim/1068888800000/identity/alerts/100012-20170214-001 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":{
        "identityAlertInfo":{
            "alertId":"100012-20170214-001",//string.实名告警ID,
            "alertTime":1487001600000,//long.告警时间
            "alertMsg":"实名信息提交成功",//string.告警消息
            "submitTime":1487001600000,//long.实名信息提交时间
            "sourceId":"openAPI",
            "sourceIdDesc":"开放API",
            "fromStatus":"0",
            "fromStatusDesc":"待审核",
            "toStatus":"0",
            "toStatusDesc":"待审核",
        }
    }
}

查询某个号码的自定义属性

接口描述

查询某个号码的所有自定义属性/自定义的某属性信息/自定义的某属性值信息

URL

/sim/{simId}/propertys
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必选 类型 描述
propertyId string 属性ID
propertyValueId string 属性值ID

返回参数

参数名称 是否必选 类型 描述
propertyInfo object 号码自定义属性信息
propertyId string 属性ID
propertyIdDesc string 属性ID描述
propertyValueId string 属性值ID
propertyValueIdDesc string 属性值ID描述
total int 号码自定义属性数量

HTTP请求示例

查询号码的所有自定义属性信息示例
GET /sim/1068888800000/property 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":{
        "propertyInfo":[
            {
                "propertyId":"100016-property-1",    //属性ID
                "propertyDesc":"性别",    //属性描述
                "propertyValueId":"100016-property-1-value-1",    //属性值ID
                "propertyValueDesc":"男"    //属性值描述
            },
            {
                "propertyId":"100016-property-2",
                "propertyDesc":"城市",
                "propertyValueId":"100016-property-2-value-1",
                "propertyValueDesc":"北京"
            },
            {
                "propertyId":"100016-property-3",
                "propertyDesc":"年龄",
                "propertyValueId":"100016-property-3-value-1",
                "propertyValueDesc":"18"
            }
        ],
        "total":3
    }
}

提交某个号码新增的自定义属性

接口描述

提交某个号码新增的自定义属性

URL

/sim/{simId}/propertys
参数名称 是否必选 类型 描述
simId string simId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

POST

请求参数

参数名称 是否必选 类型 描述
propertyValueId string 属性值ID

返回参数

参数名称 是否必选 类型 描述
propertyInfo object 号码自定义属性信息

HTTP请求示例

查询号码的所有自定义属性信息示例
POST /sim/1068888800000/propertys 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
{
    "propertyValueId":"100016-property-2-value-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":"添加成功"
    }
}

查询订购的套餐

接口描述

通过simId查询当前号码订购的套餐

URL

/sim/{simId}/package
simId是sim卡的唯一标识,可以是iccid/phoneNumber
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

返回参数 是否必须 类型 描述
packageId true long 订单id
packageCode true String 套餐编码
packageType true String 套餐类型 base(基础包)/optional(加油包)
packageTypeDesc true String 套餐包类型描述
packagePrice true long 套餐价格,分*1000
salePrice true long 产品售价,分*1000
packageCallTime true int 通话时长,主叫(分钟)
packageCalledTime true int 通话时长,被叫(分钟)
packageTraffic true long 套餐流量,Byte
packageSMS true int 产品包含短信大小
packageCallerIdPrice true long 来显价格,分*1000
extraCall true long 套餐外通话费用,分*1000
extraAnswer true long 套餐外接听电话费用,分*1000
extraTraffic true long 套餐外流量费用,每M/分*1000
status true int 套餐当前状态
statusDesc true String 套餐状态描述,0有效,1失效
beginTime true long 套餐开始时间
endTime true long 套餐结束时间
createTime true long 套餐订购时间

HTTP请求示例

GET /sim/{simId}/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":
         [
            {
                "packageId": 123,
                "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
            },
            {
                "packageId": 125,
                "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
            }
            ......
        ]
}

获取当前号码可订购的套餐列表

接口描述

通过simId获取当前号码可订购的套餐列表

URL

/sim/{simId}/packageList/{packageType}
simId是sim卡的唯一标识,可以是iccid/phoneNumber
packageType表示套餐类型,base(基础包)/optional(加油包)
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber
packageType true String 套餐类型,base(基础包)/optional(加油包)

HTTP Method

GET

请求参数

返回参数

返回参数 是否必须 类型 描述
packageId true long 订单id
packageCode true String 套餐编码
packageType true String 套餐类型 base(基础包)/optional(加油包)
packageTypeDesc true String 套餐包类型描述
packagePrice true long 套餐价格,分*1000
salePrice true long 产品售价,分*1000
packageCallTime true int 通话时长,主叫(分钟)
packageCalledTime true int 通话时长,被叫(分钟)
packageTraffic true long 套餐流量,Byte
packageSMS true int 产品包含短信大小
packageCallerIdPrice true long 来显价格,分*1000
extraCall true long 套餐外通话费用,分*1000
extraAnswer true long 套餐外接听电话费用,分*1000
extraTraffic true long 套餐外流量费用,每M/分*1000
status true int 套餐当前状态
statusDesc true String 套餐状态描述,0有效,1失效/下架
beginTime true long 套餐开始时间
endTime true long 套餐结束时间
createTime true long 套餐订购时间

HTTP请求示例

GET /sim/{simId}/packageList/{packageType} 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":
         [
            {
                "packageId": 123,
                "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
            },
            {
                "packageId": 125,
                "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": 1,
                "statusDesc": "失效",
                "beginTime": 1519833600000,
                "endTime": 1519833600000,
                "createTime": 1519833600000
            }
            ......
        ]
}

查询订购记录

接口描述

通过simId查询当前号码的订购记录

URL

/sim/{simId}/packageRecord
simId是sim卡的唯一标识,可以是iccid/phoneNumber
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

返回参数 是否必须 类型 描述
packageId true long 订单id
packageCode true String 套餐编码
packageType true String 套餐类型 base(基础包)/optional(加油包)
packageTypeDesc true String 套餐包类型描述
packagePrice true long 套餐价格,分*1000
salePrice true long 产品售价,分*1000
packageCallTime true int 通话时长,主叫(分钟)
packageCalledTime true int 通话时长,被叫(分钟)
packageTraffic true long 套餐流量,Byte
packageSMS true int 产品包含短信大小
packageCallerIdPrice true long 来显价格,分*1000
extraCall true long 套餐外通话费用,分*1000
extraAnswer true long 套餐外接听电话费用,分*1000
extraTraffic true long 套餐外流量费用,每M/分*1000
status true int 套餐当前状态
statusDesc true String 套餐状态描述,0有效,1失效
beginTime true long 套餐开始时间
endTime true long 套餐结束时间
createTime true long 套餐订购时间

HTTP请求示例

GET /sim/{simId}/packageRecord 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":
        [
            {
                "packageId": 123,
                "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
            },
            {
                "packageId": 125,
                "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

/sim/{simId}/package
simId是sim卡的唯一标识,可以是iccid/phoneNumber
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

POST

请求参数

请求参数 是否必须 类型 描述
packageCode true String 套餐编码

返回参数

返回参数 是否必须 类型 描述
resultCode true int 操作结果,0表示成功
resultDesc false String 操作结果描述

HTTP请求示例

POST /sim/{simId}/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
{
    "packageCode": "X1"
}

成功响应示例

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": "订购成功"
    }
}

退订套餐

接口描述

根据simId和packageCode退订当前号码的套餐

URL

/sim/{simId}/package
simId是sim卡的唯一标识,可以是iccid/phoneNumber
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

DELETE

请求参数

请求参数 是否必须 类型 描述
packageId true long 订单id

返回参数

返回参数 是否必须 类型 描述
resultCode true int 操作结果,0表示成功
resultDesc false String 操作结果描述

HTTP请求示例

DELETE /sim/{simId}/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
{
    "packageId": 123
}

成功响应示例

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": "退订成功"
    }
}

提交新的号码诊断

接口描述

根据simId提交新的号码诊断

URL

/sim/{simId}/diagnostics
simId是sim卡的唯一标识,可以是iccid/phoneNumber
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

POST

请求参数

返回参数

返回参数 是否必须 类型 描述
resultCode true int 操作结果,0表示成功
resultDesc false String 操作结果描述

HTTP请求示例

POST /sim/{simId}/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
{
    "simId": "1068888800000"
}

成功响应示例

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

查询某个诊断结果

接口描述

根据simId和diagnosticsId查询某个诊断结果

URL

/sim/{simId}/diagnostics/{diagnosticsId}
simId是sim卡的唯一标识,可以是iccid/phoneNumber
diagnosticsId表示要获取的诊断结果id
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber
diagnosticsId true long 号码诊断id

HTTP Method

GET

请求参数

返回参数

返回参数 是否必须 类型 描述
diagnosticsId true long 号码诊断id
operator true String 号码诊断操作人(id)
resultCode true int 号码诊断结果
resultDesc true String 号码诊断结果描述
createTime true String 号码诊断时间

HTTP请求示例

GET /sim/{simId}/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,
                "operator": "12345",
                "resultCode": 0,
                "resultDesc": "状态正常",
                "createTime": 1519833600000
    }
}

号码诊断列表

接口描述

根据simId获取号码诊断列表

URL

/sim/{simId}/diagnostics
simId是sim卡的唯一标识,可以是iccid/phoneNumber
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

返回参数 是否必须 类型 描述
diagnosticsId true long 号码诊断id
operator true String 号码诊断操作人(id)
resultCode true int 号码诊断结果
resultDesc true String 号码诊断结果描述
createTime true String 号码诊断时间

HTTP请求示例

GET /sim/{simId}/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,
                "operator": "12345",
                "resultCode": 0,
                "resultDesc": "状态正常",
                "createTime": 1519833600000
          },
          {
                "diagnosticsId": 124,
                "operator": "12345",
                "resultCode": 0,
                "resultDesc": "状态正常",
                "createTime": 1519833600000
          },
          ......
        ]
}

查询该号码所属订单

接口描述

根据simId查询该号码所属订单

URL

/sim/{simId}/order
simId是sim卡的唯一标识,可以是iccid/phoneNumber
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

返回参数 是否必须 类型 描述
orderNumber true String 订单号码

HTTP请求示例

GET /sim/{simId}/order 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": {
            "orderNumber": "100000-20120101-1"
    }
}

绑定新的设备

接口描述

通过simId和deviceSn绑定新的设备

URL

/sim/{simId}/device
simId是sim卡的唯一标识,可以是iccid/phoneNumber
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

POST

请求参数

请求参数 是否必须 类型 描述
deviceSn true String 设备编号

返回参数

返回参数 是否必须 类型 描述
resultCode true int 操作结果,0表示成功
resultDesc false String 操作结果描述

HTTP请求示例

POST /sim/{simId}/device 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
{
    "simId": "1068888800000",
    "merchantId": "100000",
    "deviceSn": "12203/00000000"
}

成功响应示例

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": "绑定成功"
    }
}

查询绑定的设备信息

接口描述

通过simId查询绑定的设备信息

URL

/sim/{simId}/device
simId是sim卡的唯一标识,可以是iccid/phoneNumber
参数 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

返回参数 是否必须 类型 描述
deviceSn true String 设备编号

HTTP请求示例

GET /sim/{simId}/device 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": {
            "deviceSn": "12203/00000000",
            "deviceSwitchStatus":"on"
    }
}

查询sim卡余额

接口描述

查询sim卡余额

URL

/sim/{simId}/balance
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称 是否必须 类型 描述
balance true long 单位 1000*分

HTTP请求示例

GET /sim/{simId}/balance 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":{
        "balance":990000,// 9.9元
    }
}

查询sim卡余额变更记录

接口描述

查询sim卡余额变更记录

URL

/sim/{simId}/balance/changeHistory
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必须 类型 描述
month true String 月份,格式yyyyMM

返回参数

参数名称 是否必须 类型 描述
changeList true jsonArray 存储变更记录list
balance true long 单位 1000*分
changeTime true long 变更时间 13位unix时间戳

HTTP请求示例

GET /sim/{simId}/balance/changeHistory 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":{
        "changeList":[
            {"balance":990000,"changeTime":1521023322000},
            {"balance":90000,"changeTime":1521023322000}
            ...
        ]
    }
}

查询充值记录

接口描述

查询充值记录

URL

/sim/{simId}/recharge
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必须 类型 描述
month true String 月份,格式yyyyMM
page true int 页码,从1开始
limit true int 每页的数量

返回参数

参数名称 是否必须 类型 描述
total true long 此次查询所包含的全部的记录数
page true int 此次的页签索引,从1开始
limit true int 每页显示的数量
rechargeList true jsonArray 存储充值记录list
date true long 父级:rechargeList,充值时间 13位unix时间戳
amount true long 父级:rechargeList,充值金额,单位 1000*分
balance true long 父级:rechargeList,充值前余额,单位 1000*分
channel true int 父级:rechargeList,充值渠道
channelDesc true string 父级:rechargeList,充值渠道说明
deputy true int 父级:rechargeList,充值账户,1代表副帐户充值, 0代表主账号充值

HTTP请求示例

GET /sim/{simId}/recharge 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,
        "rechargeList":[
            {"date":1521023322000,"amount":100000,"balance":90000,"channel":1,"channelDesc":"小米黄页","deputy":0},
            {"date":1521023322000,"amount":200000,"balance":50000,"channel":2,"channelDesc":"来自电商预付","deputy":1},
            ...
        ]
    }
}

查询sim卡月账单

接口描述

查询sim卡月账单

URL

/sim/{simId}/billing
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必须 类型 描述
month true String 月份,格式yyyyMM

返回参数

参数名称 是否必须 类型 描述
consumptionTotal true long 账单总金额 单位1000*分
consumptionCalls true long 当月通话费用 单位1000*分
consumptionTraffic true long 当月流量费用 单位1000*分
consumptionSms true long 当月短信费用 单位1000*分
consumptionOther true long 其他 单位1000*分

HTTP请求示例

GET /sim/{simId}/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":{
        "consumptionTotal":100000,
        "consumptionCalls":100000,
        "consumptionTraffic":0,
        "consumptionSms":0,
        "consumptionOther":0
    }
}

查询sim卡流量功能开关状态

接口描述

查询sim卡流量功能开关状态

URL

/sim/{simId}/traffic/status
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称 是否必须 类型 描述
statusDesc true string 状态说明
status true int 流量功能状态

HTTP请求示例

GET /sim/{simId}/traffic/status 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":{
        "statusDesc":"功能关闭",
        "status":1
    }
}

变更sim卡流量功能开关状态

接口描述

变更sim卡流量功能开关状态

URL

 /sim/{simId}/traffic/status
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

POST

请求参数

参数名称 是否必须 类型 描述
status true int 变更状态 "0":"功能开启","1":"功能关闭"

返回参数

参数名称 是否必选 类型 描述
resultCode true int 变更结果
resultDesc true string 变更结果描述

HTTP请求示例

POST /sim/{simId}/traffic/status 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":"变更成功"
    }
}

查询sim卡当月流量消耗

接口描述

查询sim卡当月流量消耗

URL

GET /sim/{simId}/traffic/usage
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称 是否必须 类型 描述
totalValue true long 当月流量消耗值,单位Byte

HTTP请求示例

GET /sim/{simId}/traffic/usage 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":{
        "totalValue":1024000
    }
}

查询sim卡某个时间段的流量详单

接口描述

查询sim卡某个时间段的流量详单

URL

/sim/{simId}/traffic/detail
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必须 类型 描述
beginDate true String 开始某天 格式:yyyyMMdd
endDate true String 结束某天 格式:yyyyMMdd

返回参数

参数名称 是否必须 类型 描述
detailList true jsonArray 详单数据list
dataTime true string 流量消耗的日期
dateValue true string 当日流量消耗值,单位Byte
totalValue true long 当月流量消耗值,单位Byte

HTTP请求示例

GET /sim/{simId}/traffic/detail  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":{
        "detailList":[
            {"dataTime":"20180101","dateValue":0,"totalValue":1024000},
            {"dataTime":"20180102","dateValue":0,"totalValue":1024000},
                ...
        ]
    }
}

查询sim卡语音功能开关状态

接口描述

查询sim卡语音功能开关状态

URL

/sim/{simId}/voice/status
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称 是否必须 类型 描述
statusDesc true string 状态说明
status true int 语音功能状态

HTTP请求示例

GET /sim/{simId}/voice/status 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":{
        "statusDesc":"功能关闭",
        "status":1
    }
}

变更sim卡语音功能开关状态

接口描述

变更sim卡语音功能开关状态

URL

/sim/{simId}/voice/status
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

POST

请求参数

参数名称 是否必须 类型 描述
status true int 变更状态 "0":"功能开启","1":"功能关闭"

返回参数

参数名称 是否必选 类型 描述
resultCode true int 变更结果
resultDesc true string 变更结果描述

HTTP请求示例

POST /sim/{simId}/voice/status 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":"变更成功"
    }
}

查询sim卡当月语音消耗

接口描述

查询sim卡当月语音消耗

URL

/sim/{simId}/voice/usage
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称 是否必须 类型 描述
callingValue true long 当月主叫语音消耗值,单位秒
calledValue true long 当月被叫语音消耗值,单位秒

HTTP请求示例

GET /sim/{simId}/voice/usage 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":{
        "callingValue":102,
        "calledValue":10,

    }
}

查询sim卡某个时间段的语音详单

接口描述

查询sim卡某个时间段的语音详单

URL

 /sim/{simId}/voice/detail
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必须 类型 描述
beginDate true String 开始某天 格式:yyyyMMdd
endDate true String 结束某天 格式:yyyyMMdd (不包含结束日期当天)

返回参数

参数名称 是否必须 类型 描述
detailList true jsonArray 详单数据list
dataTime true string 流量消耗的日期
callingValue true long 当月主叫语音消耗值,单位秒
calledValue true long 当月被叫语音消耗值,单位秒

HTTP请求示例

GET /sim/{simId}/voice/detail  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":{
        "detailList":[
            {"dataTime":"20180101",callingValue":45,calledValue":45},
            {"dataTime":"20180102",callingValue":45,calledValue":12},
                ...
        ]
    }
}

查询sim卡短信功能开关状态

接口描述

查询sim卡短信功能开关状态

URL

 /sim/{simId}/sms/status
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称 是否必须 类型 描述
statusDesc true string 状态说明
status true int 短信功能状态

HTTP请求示例

GET /sim/{simId}/sms/status 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":{
        "statusDesc":"功能关闭",
        "status":1
    }
}

变更sim卡短信功能开关状态

接口描述

变更sim卡短信功能开关状态

URL

POST /sim/{simId}/sms/status
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必须 类型 描述
status true int 变更状态 "0":"功能开启","1":"功能关闭"

返回参数

参数名称 是否必选 类型 描述
resultCode true int 变更结果
resultDesc true string 变更结果描述

HTTP请求示例

POST /sim/{simId}/sms/status 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":"变更成功"
    }
}

查询sim卡当月短信消耗

接口描述

查询sim卡当月短信消耗

URL

/sim/{simId}/sms/usage
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称 是否必须 类型 描述
sendValue true long 当月发送短信消耗值,单位条
receiveValue true long 当月接收消耗值,单位条

HTTP请求示例

GET /sim/{simId}/sms/usage 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":{
        "sendValue":144,
        "receiveValue":12
    }
}

查询sim卡某个时间段的短信详单

接口描述

查询sim卡某个时间段的短信详单

URL

GET /sim/{simId}/sms/detail
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

请求参数

参数名称 是否必须 类型 描述
beginDate true String 开始某天 格式:yyyyMMdd
endDate true String 结束某天 格式:yyyyMMdd (不包含结束日期当天)

返回参数

参数名称 是否必须 类型 描述
detailList true jsonArray 详单数据list
dataTime true string 流量消耗的日期
sendValue true long 当月发送短信消耗值,单位条
receiveValue true long 当月接收消耗值,单位条

HTTP请求示例

GET /sim/{simId}/sms/detail  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":{
        "detailList":[
            {"dataTime":"20180101",sendValue":1,receiveValue":1},
            {"dataTime":"20180102",sendValue":2,receiveValue":1},
                ...
        ]
    }
}

sim卡发送短信

接口描述

sim卡发送短信

URL

/sim/{simId}/sms
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

POST

请求参数

参数名称 是否必须 类型 描述
merchantId true String 号码所属厂商
smsType false int 该字段选填,不填表示文本短信 填 0---文本短信,填1---二进制短信(暂不支持其他格式)
smsMsg true String 发送的短信内容

返回参数

参数名称 是否必须 类型 描述
smsSendId true string 该条短信唯一标识码,用来查询这条短信的状态

HTTP请求示例

POST /sim/{simId}/sms  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":{
        "smsSendId":"819yutiqxc8391839819"
    }
}

查询某次发送短信请求的状态

接口描述

查询某次发送短信请求的状态

URL

 /sim/{simId}/sms
参数名称 是否必须 类型 描述
simId true String iccid 或者 phoneNumber

HTTP Method

GET

请求参数

参数名称 是否必须 类型 描述
smsSendId true String 短信唯一标识码(发送短信接口返回)

返回参数

参数名称 是否必须 类型 描述
statusDesc true string 短信状态码说明
status true int 短信状态

HTTP请求示例

GET /sim/{simId}/sms  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":{
        "statusDesc":"发送成功",
        "status":2
    }
}

results matching ""

    No results matching ""