电信物联网开放平台api参考_第1页
电信物联网开放平台api参考_第2页
电信物联网开放平台api参考_第3页
电信物联网开放平台api参考_第4页
电信物联网开放平台api参考_第5页
已阅读5页,还剩116页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1tformAPI参考(北向 前 注 Application订阅 规 直连设备发现非直连设备设备信息变化设备数据变化删除非直连设备 mandResp结构体说 CommandDTOV4结构体说 GetDeviceRspDTO结构体说

ApplicationAuthrequestheader中携带参{为调用Auth接口获取到的accessToken。权接口,获取鉴权token。请参考本文档2.1.1鉴权章节进行开发。 (Auth为参数中的appId,Authorization中{accessToken}的值即为调用Auth接口获取到的如果多次获取令牌,则之前的令牌失效,最后一次获取的令牌才有效。并发获取令Oauth2.0 StatusStatusCode:200{}AppIdorsecretisnotRefreshToken( Oauth2.0 {}StatusStatusCode:200{}TheinputisRefreshaccesstokenAppIdorsecretisnot 2.0StatusCode:204No {}StatusCode:204NoContentStatusCode:204NoContentTheinputisApp向IoTtform申请新的设备,IoTtform分配对应的设备,待设备携带验证码请求接入平台后,分配其deviceId和secret,允许其使用。平台提供了增,删, 口获取到的accessToken。客户端给出verifyCode则返回的就是这个nodeId一致。环境,该值通常为设备的IMEI号。 https:https:{}StatusStatusCode:200{}InvalidaccessTheinputisAppIdforauthnotTheapplicationisnotTheapplicationhasn'tbeenauthorized.BadrequestTheamountofdevicehasreachedthelimit.InvalidverifyThedevicehasalreadybeenbinded.InternalserverThelicenseisnotThelicensesalesisnot httphttp携 见附录1.3.9命令状态:sent已发送、deliveredexecuted需要requestId关联对应命令执行结果 {{"to":null,"toType":null,"requestId":"*****************************************","callbackURL":" "from":"************","sdp":"**********"}StatusCode:202AcceptedStatusCode:202Accepted{}InvalidaccessTheinputisTheapplicationisnotTheapplicationhasn'tbeenThedataindataBaseisTheserviceTypeisnotThedeviceisnot StatusStatusCode:200{}InvalidaccessTheapplicationisnotTheapplicationhasn'tbeenThedeviceisnot StatusCode:204No StatusCode:204No InvalidaccessTheapplicationisnotTheapplicationhasn'tbeenThedeviceisnotThedataindataBaseisTheserviceTypeisnotThedeviceisnot

httphttp携 sent已发送delivered已送达executed’如: {{"to":null,"toType":null,"callbackURL":"mode":"ON"}"StatusCode:202AcceptedStatusCode:202Accepted{}InvalidaccessTheinputisTheapplicationisnotTheapplicationhasn'tbeenThedataindataBaseisTheserviceTypeisnotThedeviceisnot endUser必须为null。设备类型:z-wave:ProductType+16XXXX-XXXX0对齐DStatusStatusCode:204No{}StatusStatusCode:204No :null平台生成,null网关的唯一ID,平台用于判重 {"timeout":300}StatusStatusCode:200{}InvalidaccessTheinputisAppIdforauthnotTheapplicationisnotTheapplicationhasn'tbeenBadrequestThedeviceisnotDeviceisnotDeviceisThenodeIdisInvalidverify serviceTypecarEncrypt时,data结构serviceTypecarInfo、vehicleProperty服务类型找不到:StatusCode400Not {}}StatusStatusCode:200InvalidaccessTheinputisTheapplicationisnotThedeviceisnotTheencrtptivisnotTheencrtptkeyisnotTheencrtptflagisnotAddnewcarinfo,simNumberorcarModelcannotbenull.新的carInfo,simNumber或者ThesimNumberisalreadyTheteNumberisalreadyThevinisalreadyTheresourceisnot1.2.3 备是直连设备时,gatewayId为设备本身的指定节点的类:ENDPOINT传感器.GATEWAY:网关.pageNo=null时查询内容不分设备状态,取值:ONLINE;OFFLINE不在线;ABNORMAL异常状态查询设备信息时间在startTime之后的记 的时间升序排列;DESC按设备的时间降>1.3.8GetDeviceRspDTO StatusStatusCode:200{{ }]}InvalidaccessTheapplicationinputiscan'tbebothnull.能同时为nullTheapplicationisnotTheapplicationhasn'tbeen 64个字节返回结果:1.3.8GetDeviceRspDTO结构体说明结构 StatusStatusCode:200{ }InvalidaccessTheapplicationisnotThedeviceisnotThedeviceDataisnotTheapplicationhasn'tbeenApplication 2、deviceInfoChanged(设备信息变化)端口。(说明:HTTP信道只可用于调测)StatusCode:201 {}"StatusCode:201 InvalidaccessTherequestcallbackurlisTheapplicationisnotGetnewCallbackUrlfromossfailed.oss获取新的回调Getiotwsaddress 连设备时,gatewayIddeviceId。当设备是非直连设备时,gatewayId为设备所关联的直连设备(即网关)deviceId。查询参数,根据时间段查询的起始时间时间格式:yyyyMMdd’T’HHmmss’Z’如:查询参数,根据时间段查询的结束时间时间格式:yyyyMMdd’T’HHmmss’Z’如:网关的设备唯一标识,1-64个字节。当设备是直连设备时,gatewayIddeviceId。当设备是非直连设备时,gatewayId为设备所关联的直连设备(即网关)deviceId。 gatewayId={gatewayId}&serviceId={serviceId}&pageNo={pageNo}&pageSizeStatusStatusCode:200{}{{"pageSize":10,{"appId":"c8855f40-d7a3-4d51-8b46-9f "serviceId":"Battery","data": {"appId":"c8855f40-d7a3-4d51-8b46-9f "serviceId":"Temperature","data": }]}{{{"commands":null,"properties":[{"dataType":"int","min":0,"max":"step":1,"method":"RE","unit":null,"enumList":null]}}]}{{{"commands":null,"properties":[{"dataType":"decimal","required":true,"min":"step":null,"method":"R","unit":"C",}]}]}InvalidaccessTheapplicationisnotcan'tbebothnull.Theapplicationhasn'tbeen 与deviceId保持一致。当设备是非直连设备时,gatewayId为设备所关联的直连设备(即网关)的 > StatusStatusCode:200Body:{"serviceId":"serviceType":"option":"","properties":"desc":"dataType":"","enumList":["",""],"min":0,"max":"step":"maxLength":"unit":null,"method":"","events":}]}InvalidaccessTheinputisTheapplicationisnotTheapplicationhasn'tbeen 用ID要与当境expireTime秒内有效,超过这个时间则默认为48小时CommandDTOV4投递成功:StatusCode201返回参数参见附录1.3.6 mandResp结构体说明结构体说明 {"command":{"method":"********","paras":{"paraName2":"paraValue2"} }StatusCode:201CreatedStatusCode:201Created{"appId":"********","deviceId":"********","command":{"method":"********","paras":{"paraName2":}"callbackUrl":""expireTime":null,"result":null,"creationTime":""executeTime": tformIssuedTime":null,"deliveredTime":null,"issuedTimes":}TheinputisGetAppKeyfromheaderInternalserverTheapplicationisnotThedeviceDataisnotTheserviceTypeisnot 0如 如 查询成功:StatusCode200mandQueryRespmandRespPagination查询成功:StatusCode200 StatusStatusCode:200{{"appId":"********","deviceId":"********","command":{"method":"********","paras":{"paraName2":"paraValue2"}"callbackUrl":""expireTime":null,"callbackUrl":""expireTime":null,"result":null,"creationTime":""executeTime": tformIssuedTime":null,"deliveredTime":null,"issuedTimes":{"appId":"********","deviceId":"********","command":{"method":"********","paras":{"paraName2":}"callbackUrl":""expireTime":null,"result":null,"creationTime":""executeTime": tformIssuedTime":"deliveredTime":null,"issuedTimes":null}]}InvalidaccessTheinputisGetAppKeyfromheaderTheapplicationisnotThedeviceDataisnotThedeviceisnotThedevicecommandisnot mandId}?appId={app 命令ID用ID要与当StatusCode:200 mandResp结构体说明结构体说明 {}StatusCode:StatusCode:200{"appId":"********","deviceId":"********","command":{"method":"********","paras":{"paraName2":"paraValue2"}"callbackUrl":""expireTime":null,"result":null,"creationTime":" "executeTime":null, tformIssuedTime":"deliveredTime":null,"issuedTimes":null}TheinputisGetAppKeyfromheaderTheapplicationhasn'tbeenTheapplicationisnotThedeviceDataisnotThedevicecommandisnotThedevicecommandalreadyCannotcancel. 用ID要与当StatusCode:201 ID命令的设备IDWAITTING表示等待执行中,RUNNING表示撤销任务正在执行,SUCCESS表FAILED表示撤销任务执行失败,PART_SUCCESS表 mandResp结构体说明结构体说明 {}StatusStatusCode:201{"taskId":"********","appId":"********","status":"WAITTING","totalCount":1, mands":{"appId":"********","deviceId":"********","command":{"method":"********","paras":{"paraName2":"paraValue2"}"callbackUrl":""expireTime":null,"result":null,"creationTime":""executeTime": tformIssuedTime":null,"deliveredTime":null,"issuedTimes":}]}InvalidaccessTheinputisGetAppKeyfromheaderTheapplicationhasn'tbeenTheapplicationisnotThedeviceDataisnot 0,默认0指定任务ID指定设备IDstartTime之后Hmmss'Z'endTime之前Hmmss'Z'用ID要与当查询成功:StatusCode200 Pagination的任务ID所属的应用IDIDRUNNING表示撤SUCCESS表示撤FAILED表示撤销 1.3.6sp结构体说明结 StatusStatusCode:200{{"taskId":"********","appId":"********","status":"WAITTING","totalCount":1, mands":{"appId":"********","deviceId":"********","command":{"method":"********","paras":{"paraName2":"paraValue2"}"callbackUrl":""expireTime":null,"result":null,"creationTime":""executeTime": tformIssuedTime":null,"deliveredTime":null,"issuedTimes":}]{"taskId":"********","appId":"********","status":"WAITTING","totalCount":1, mands":{{"appId":"********","deviceId":"********","command":{"method":"********","paras":{"paraName2":}"callbackUrl":""expireTime":null,"result":null,"creationTime":""executeTime": tformIssuedTime":"deliveredTime":null,"issuedTimes":null}]}]}InvalidaccessTheinputisGetAppKeyfromheaderTheapplicationhasn'tbeenTheapplicationisnotThedeviceDataisnotApplication给设备发送命令消息,实现对传感器的实时控制。平台分别提供了下发至Application发送命令给网关(或者网关下的设备)指定的服务下发命令/。 每个健都是profile中命令的参数seqNum:APPseqNumPOST请求BODY中携带,序列号规则采用:UUID_XXXX,UUID会根据JAVA自带算法生UUID值,XXXX的取值范围:0001-9999,达到9999后重新从0001开始,如此循环 urlHTTPS信道回调地(说明:HTTP信道只可用于调测)命令已成功投递StatusCode200命令状态:sent已发送deliveriedtoType为CLOUDfailedtoTypeCLOUDHHmmss’Z’如 toType为GATEWAY,如果请求有requestId则同请求的requestId一致,如果请求无requestId则平台分配一个序 toType为CLOUD,则为null; {{"method":"INVITE-""from":"************","sdp":"**********"}StatusStatusCode:200{"status":"sent","timestamp":"**********"}InvalidaccessTheinputisTheapplicationisnotTheapplicationhasn'tbeenThedeviceDataisThedataindataBaseisTheserviceTypeisnotThedeviceisnot 数,详见下表param参数结构说明,param批量命令类型:DeviceList/DeviceTypeDeviceAreaGroupListStatusCode:200{"appId":"******","timeout":1000,"param":{"fileId":}}StatusStatusCode:200{}InvalidaccessThebatchTaskcounthasreachedthelimit.10个时,返回ThebatchTasknamehasBadrequestTheuserhasno "appStatusCode:200任务状态 tttttt,param批量命令类型:DeviceList/DeviceTypeDeviceAreaGroupListStatusStatusCode:200{"taskId":"********","taskName":"********","appId":"********","operator":"********","taskFrom":"********","status":"********","timeout":1000,"progress":"param":{"fileName":}}"t":"t":"t":"t":"t":"t":TheinputisTheapplicationisnotTheapplicationhasn'tbeen {taskId}&appId={ap{taskId}&appId={ap 分页查询参数,pageNo=null时StatusCode:200 StatusStatusCode:200{"pageSize":1,{"output":null,"param":{}}]}TheinputisTheapplicationisnotTheapplicationhasn'tbeen

RuleDTO1.2id。List<Json表)groupExpress二选一必填自定义结构体(Condition-List<Json规则的动作。Action为自定义结构Action-SMS、Action-、ListDEVICE类型和TIMER类型结构体GroupElement表示一个condition,自定义结构设备数据的,自定义结 2030,应用场景:温度在20到30之间触发规钟,默认为0不延时Strategy则触发默认为pulses,表示收到的传组设备数据的,自定义结构,根据读between操作符联用时,右2030之间触发规分钟,默认为0不延时结构体Strategy"DoorWindow/status",属性支持多个,比如OBD需要两个属性,经度和纬度”,多个属性中间以between操作符联用时,右2030之间触发规分钟,默认为0不延时结构体Strategy比如OBD需要两个属性,经度和纬度”,多个属性中间以逗号分隔CMD当规则Demo-通知内容通知内容(content为空时,Action-结构说明action的编号,在一条规则范围内唯InvalidaccessappIdTheapplicationisnotTheruleisnotTheapplicationhasn'tbeenTherulenamealreadyThedataindataBaseisTherulecountofeachapphasreachedtheupperlimit,thecurrentuplimitis30entries.Theapplicationinputiswhencreaterule.TheruleinputisTheactionofruleisActionidduplicatedinsameRuleapiparameterisConvertjsontoclasscurl-X--header"Authorization:Bearer{accessToken}" -d"name":"rule1","description":"thisisatestrule2015.12.23","status":"active",{"type":"path":"DoorWindow/status"}}{"type":"cmd":{"messageType":"MUTE","messageBody":{ ":}}}]curlcurl-X--header"Authorization:Bearer{accessToken}" -d"name":"rule1","description":"thisisatestrule2015.12.23","status":"active",{"type":"path":"DoorWindow/status""strategy":{}}{"type":"cmd":{{ }}]curlcurl-X--header"Authorization:Bearer{accessToken}" -d"name":"rule1","description":"thisisatestrule2015.12.23","status":"active",{"type":"path":"Temperature/temperature""value":"20,30",}}{"type":"cmd":{"messageType":"MUTE","messageBody": ":}}]curl-X --header"Authorization:Bearer{accessToken}" -d"name":"rule1","description":"thisisatestrule2015.12.23","status":"active",{"type":"path":"Location/longitude,latitude""operator":"value": }}{"type":"deviceId":"0285f8e6-f0f1-441a-bc27-30f "cmd":{"messageType":"MUTE","messageBody":{ ":}}]{{}更 id。InvalidaccessRuleIdcannotbenulloremptywhenupdaterule.appIdTheapplicationisnotTheruleisnotTheapplicationhasn'tbeenTherulenamealreadyThedataindataBaseisTherulecountofeachapphasreachedtheupperlimit,thecurrentuplimitis30entries.TheapplicationinputisInternalservererrorhappenedwhencreaterule.TheruleinputisTheactionofruleisActionidduplicatedinsameRuleapiparameterisConvertjsontoclasscurl-X--header"Authorization:Bearer{accessToken}" -d"name":"rule1","description":"thisisatestrule2015.12.23","status":"active",{"type":"path":"DoorWindow/status"}}{"type":"cmd":{"messageType":"MUTE","messageBody":{ ":}}}]curlcurl-X--header"Authorization:Bearer{accessToken}" -d"name":"rule1","description":"thisisatestrule2015.12.23","status":"active",{"type":"path":"DoorWindow/status"}{"type":"cmd":{"messageType":"MUTE","messageBody":{ ":}}]]{{} 时返回的idInvalidaccessappIdTheapplicationisnotTheruleisnotTheapplicationhasn'tbeenTheruleinputiscurl-X-d" 时返回的idInvalidaccessappIdTheapplicationisnotTheruleisnotTheapplicationhasn'tbeencurl-X--header"Authorization:Bearer 时返回的idInvalidaccessTheapplicationhasn'tbeencurl-X"" --header"Authorization:Bearer{{"name":"description":"thisisatestrule2015.12.23","type":"noType",{"id":0,"path":"DoorWindow/status"}{"id":0,"appId":"pnS6yhwLszJ8kZF7HhuH7cOeoGQa","deviceId":"0285f8e6-f0f1-441a-bc27-30f"cmd":{"messageType":"MUTE","messageBody":{ ":}}}]} 时返回的id为“PartialOK”否则为“OperationpartialInvalidaccessappIdTheapplicationisnotTheruleisnotTheapplicationhasn'tbeenTheruleinputiscurl-X--header"Authorization:Bearer{accessToken}"-d}]"{{{"result_code":"PartialOK",{"response":{"error_desc":"*********"}"response":{"error_desc":"*********"}}]}Application向平台订阅设备变更通知(Application订阅当设备发生,Application通知给Application。回调通知地址,请参考Application订阅。{ }}口功能将该信息通知给Application。回调通知地址,请参考Application订阅。非直连设备时,gatewayId为设备所关联的直连设备(即网关)deviceId。ENDPOINT传感器.GATEWAY:网关.1.3.1DeviceInfo结{ }}国电信物联网开放平台使用该接口功能将该信息通知给Application。此处的接口路径是应用向平台订阅数据时的对应notifyType为非直连设备时,gatewayId为设备所关联的直连设备(即网关)deviceId。1.3.1DeviceInfo结{"notifyType":"deviceInfoChanged",}}中国电信物联网开放平台使用该接口功能将该信息通知给Application。此处的接口路径是应用向平台订阅数据时的对应notifyType为gatewayIddeviceId。当设备的直连设备(即网关)deviceId。HHmmss’Z’如 {"notifyType":"deviceDhanged","requestId":"{requestId}","serviceId":"data":{"battery_low":1},}}口功能将该信息通知给Application。回

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论