1.5.2 SIM卡类API

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

查询SIM卡基本信息

接口描述

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

URL

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

HTTP Method

GET

请求参数

返回参数

参数名称是否必选类型描述
merchantIdstring号码所属厂商
phoneNumberstring号码
imsistringimsi
iccidstringiccid
importTimelong导入时间
activeTimelong激活时间.如果激活,返回激活时间

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称是否必选类型描述
stageint当前所在生命周期
stageDescstring当前所在生命周期描述
stageTimeInfoobject生命周期信息
testStageStartTimelong测试期开始时间
testStageEndTimelong测试期截止时间
silenceStageStartTimelong沉默期开始时间
silenceStageEndTimelong沉默期截止时间

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

POST

请求参数

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

返回参数

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

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称是否必选类型描述
stageLogInfoobject生命周期变更信息
fromStageint变更前的生命周期
fromStageDescstring变更前的生命周期描述
toStageint变更后的生命周期
toStageDescstring变更后的生命周期描述
stageChangeTimelong生命周期变更时间
stageChangeDescstring生命周期变更描述
sourceIdstring来源id
sourceIdDescstring来源id描述
operatorstring操作人
totallong号码状态变更记录数

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
stageAlertInfoobject生命周期告警信息
alertIdstring告警id
alertTimelong告警时间
alertMsgstring告警内容
totallong告警记录数

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}
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber
alertIdstring生命周期告警ID

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
stageAlertInfoobject生命周期告警信息
alertIdstring告警id
alertTimelong告警时间
alertMsgstring告警内容
testStageStartTimelong测试期开始时间
testStageEndTimelong测试期截止时间
silenceStageStartTimelong告警内容
silenceStageEndTimelong告警内容
sourceIdstring来源id
sourceIdDescstring来源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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
statusint号码状态
statusDescstring号码状态描述

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

POST

请求参数

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

返回参数

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

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
statusChangeLogobject号码状态变更信息
actionTypestring操作类型
actionTypeDescstring操作类型描述
actionResultstring操作结果
actionResultDescstring操作结果描述
statusChangeTimelong状态变更时间
statusChangeDescstring状态变更描述
sourceIdstring来源id
sourceIdDescstring来源id描述
operatorstring操作人
totallong号码状态变更记录数

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
statusAlertInfoobject号码状态告警信息
alertIdstring号码状态告警id
alertTimelong号码状态告警时间
alertMsgstring号码状态告警内容
totallong号码状态告警记录数

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}
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber
alertIdstring号码状态告警id

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
statusAlertInfoobject号码状态告警信息
alertIdstring号码状态告警id
alertTimelong号码状态告警时间
alertMsgstring号码状态告警内容
changeTimelong状态变更时间
operatorstring操作人
sourceIdstring来源id
sourceIdDescstring来源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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
identityInfoobject号码实名信息
submitTimelong实名信息提交时间
namestring姓名
idNumberstring身份证号码
sourceIdstring来源Id
sourceIdDescstring来源Id描述
identityStatusstring当前实名状态
identityStatusDescstring当前实名状态描述
changeTimelong实名状态变更时间
photoInfoobject号码实名提交照片信息
bucketstring实现照片存储信息
photoIdstring实现照片id
photoTypestring号码实名类型
photoTypeDescstring号码实名类型描述

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

POST

请求参数

参数名称是否必选类型描述
namestring姓名
idNumberstring身份证号码
photoInfoobject证件对应照片信息
bucketstring实现照片存储信息
photoIdstring实现照片id
photoTypestring号码实名类型

返回参数

参数名称是否必选类型描述
resultCodeint提交实现结果
resultDescstring提交实现结果描述

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
identityStatusInfoobject号码实名状态信息
identityStatusstring号码实名状态

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

POST

请求参数

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

返回参数

参数名称是否必选类型描述
resultCodeint提交修改结果
resultDescstring提交修改结果描述

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
identityAlertInfoobject号码实名告警信息
fromStatusstring原实名状态
fromStatusDescstring原实名状态描述
toStatusstring新实名状态
toStatusDescstring新实名状态描述
alertIdstring告警id
alertTimestring告警时间
alertMsgstring告警内容
totallong告警记录数量

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}
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber
alertIdstring告警id

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
identityAlertInfoobject号码实名告警信息
alertIdstring号码实名告警id
alertTimelong号码实名告警时间
alertMsgstring号码实名告警内容
submitTimelong号码实名提交时间
sourceIdstring来源id
sourceIdDescstring来源id描述
fromStatusstring原号码实名状态
fromStatusDescstring原号码实名状态描述
toStatusstring新号码实名状态
toStatusDescstring新号码实名状态描述

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必选类型描述
propertyInfoobject号码自定义属性信息
propertyIdstring属性ID
propertyIdDescstring属性ID描述
propertyValueIdstring属性值ID
propertyValueIdDescstring属性值ID描述
totalint号码自定义属性数量

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
参数名称是否必选类型描述
simIdstringsimId是sim卡的唯一标识,可以是iccid或者phoneNumber

HTTP Method

POST

请求参数

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

返回参数

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

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
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
packageIdtruelong订单id
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 /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(加油包)
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber
packageTypetrueString套餐类型,base(基础包)/optional(加油包)

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
packageIdtruelong订单id
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 /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
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
packageIdtruelong订单id
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 /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
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

POST

请求参数

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

返回参数

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

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
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

DELETE

请求参数

请求参数是否必须类型描述
packageIdtruelong订单id

返回参数

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

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
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

POST

请求参数

返回参数

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

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
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber
diagnosticsIdtruelong号码诊断id

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
diagnosticsIdtruelong号码诊断id
operatortrueString号码诊断操作人(id)
resultCodetrueint号码诊断结果
resultDesctrueString号码诊断结果描述
createTimetrueString号码诊断时间

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
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

返回参数是否必须类型描述
diagnosticsIdtruelong号码诊断id
operatortrueString号码诊断操作人(id)
resultCodetrueint号码诊断结果
resultDesctrueString号码诊断结果描述
createTimetrueString号码诊断时间

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
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

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

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
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

POST

请求参数

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

返回参数

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

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
参数是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

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

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称是否必须类型描述
balancetruelong单位 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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必须类型描述
changeListtruejsonArray存储变更记录list
balancetruelong单位 1000*分
changeTimetruelong变更时间 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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必须类型描述
totaltruelong此次查询所包含的全部的记录数
pagetrueint此次的页签索引,从1开始
limittrueint每页显示的数量
rechargeListtruejsonArray存储充值记录list
datetruelong父级:rechargeList,充值时间 13位unix时间戳
amounttruelong父级:rechargeList,充值金额,单位 1000*分
balancetruelong父级:rechargeList,充值前余额,单位 1000*分
channeltrueint父级:rechargeList,充值渠道
channelDesctruestring父级:rechargeList,充值渠道说明
deputytrueint父级: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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必须类型描述
consumptionTotaltruelong账单总金额 单位1000*分
consumptionCallstruelong当月通话费用 单位1000*分
consumptionTraffictruelong当月流量费用 单位1000*分
consumptionSmstruelong当月短信费用 单位1000*分
consumptionOthertruelong其他 单位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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称是否必须类型描述
statusDesctruestring状态说明
statustrueint流量功能状态

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

POST

请求参数

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

返回参数

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

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称是否必须类型描述
totalValuetruelong当月流量消耗值,单位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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

参数名称是否必须类型描述
beginDatetrueString开始某天 格式:yyyyMMdd
endDatetrueString结束某天 格式:yyyyMMdd

返回参数

参数名称是否必须类型描述
detailListtruejsonArray详单数据list
dataTimetruestring流量消耗的日期
dateValuetruestring当日流量消耗值,单位Byte
totalValuetruelong当月流量消耗值,单位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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称是否必须类型描述
statusDesctruestring状态说明
statustrueint语音功能状态

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

POST

请求参数

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

返回参数

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

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

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

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必须类型描述
detailListtruejsonArray详单数据list
dataTimetruestring流量消耗的日期
callingValuetruelong当月主叫语音消耗值,单位秒
calledValuetruelong当月被叫语音消耗值,单位秒

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

参数名称是否必须类型描述
statusDesctruestring状态说明
statustrueint短信功能状态

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

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

返回参数

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

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

返回参数

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

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

请求参数

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

返回参数

参数名称是否必须类型描述
detailListtruejsonArray详单数据list
dataTimetruestring流量消耗的日期
sendValuetruelong当月发送短信消耗值,单位条
receiveValuetruelong当月接收消耗值,单位条

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

POST

请求参数

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

返回参数

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

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
参数名称是否必须类型描述
simIdtrueStringiccid 或者 phoneNumber

HTTP Method

GET

请求参数

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

返回参数

参数名称是否必须类型描述
statusDesctruestring短信状态码说明
statustrueint短信状态

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
    }
}