電信物聯(lián)網(wǎng)開放平臺api參考_第1頁
電信物聯(lián)網(wǎng)開放平臺api參考_第2頁
電信物聯(lián)網(wǎng)開放平臺api參考_第3頁
電信物聯(lián)網(wǎng)開放平臺api參考_第4頁
電信物聯(lián)網(wǎng)開放平臺api參考_第5頁
已閱讀5頁,還剩116頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1tformAPI參考(北向 前 注 Application訂閱 規(guī) 直連設(shè)備發(fā)現(xiàn)非直連設(shè)備設(shè)備信息變化設(shè)備數(shù)據(jù)變化刪除非直連設(shè)備 mandResp結(jié)構(gòu)體說 CommandDTOV4結(jié)構(gòu)體說 GetDeviceRspDTO結(jié)構(gòu)體說

ApplicationAuthrequestheader中攜帶參{為調(diào)用Auth接口獲取到的accessToken。權(quán)接口,獲取鑒權(quán)token。請參考本文檔2.1.1鑒權(quán)章節(jié)進(jìn)行開發(fā)。 (Auth為參數(shù)中的appId,Authorization中{accessToken}的值即為調(diào)用Auth接口獲取到的如果多次獲取令牌,則之前的令牌失效,最后一次獲取的令牌才有效。并發(fā)獲取令Oauth2.0 StatusStatusCode:200{}AppIdorsecretisnotRefreshToken( Oauth2.0 {}StatusStatusCode:200{}TheinputisRefreshaccesstokenAppIdorsecretisnot 2.0StatusCode:204No {}StatusCode:204NoContentStatusCode:204NoContentTheinputisApp向IoTtform申請新的設(shè)備,IoTtform分配對應(yīng)的設(shè)備,待設(shè)備攜帶驗證碼請求接入平臺后,分配其deviceId和secret,允許其使用。平臺提供了增,刪, 口獲取到的accessToken??蛻舳私o出verifyCode則返回的就是這個nodeId一致。環(huán)境,該值通常為設(shè)備的IMEI號。 https:https:{}StatusStatusCode:200{}InvalidaccessTheinputisAppIdforauthnotTheapplicationisnotTheapplicationhasn'tbeenauthorized.BadrequestTheamountofdevicehasreachedthelimit.InvalidverifyThedevicehasalreadybeenbinded.InternalserverThelicenseisnotThelicensesalesisnot httphttp攜 見附錄1.3.9命令狀態(tài):sent已發(fā)送、deliveredexecuted需要requestId關(guān)聯(lián)對應(yīng)命令執(zhí)行結(jié)果 {{"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已發(fā)送delivered已送達(dá)executed’如: {{"to":null,"toType":null,"callbackURL":"mode":"ON"}"StatusCode:202AcceptedStatusCode:202Accepted{}InvalidaccessTheinputisTheapplicationisnotTheapplicationhasn'tbeenThedataindataBaseisTheserviceTypeisnotThedeviceisnot endUser必須為null。設(shè)備類型:z-wave:ProductType+16XXXX-XXXX0對齊DStatusStatusCode:204No{}StatusStatusCode:204No :null平臺生成,null網(wǎng)關(guān)的唯一ID,平臺用于判重 {"timeout":300}StatusStatusCode:200{}InvalidaccessTheinputisAppIdforauthnotTheapplicationisnotTheapplicationhasn'tbeenBadrequestThedeviceisnotDeviceisnotDeviceisThenodeIdisInvalidverify serviceTypecarEncrypt時,data結(jié)構(gòu)serviceTypecarInfo、vehicleProperty服務(wù)類型找不到:StatusCode400Not {}}StatusStatusCode:200InvalidaccessTheinputisTheapplicationisnotThedeviceisnotTheencrtptivisnotTheencrtptkeyisnotTheencrtptflagisnotAddnewcarinfo,simNumberorcarModelcannotbenull.新的carInfo,simNumber或者ThesimNumberisalreadyTheteNumberisalreadyThevinisalreadyTheresourceisnot1.2.3 備是直連設(shè)備時,gatewayId為設(shè)備本身的指定節(jié)點的類:ENDPOINT傳感器.GATEWAY:網(wǎng)關(guān).pageNo=null時查詢內(nèi)容不分設(shè)備狀態(tài),取值:ONLINE;OFFLINE不在線;ABNORMAL異常狀態(tài)查詢設(shè)備信息時間在startTime之后的記 的時間升序排列;DESC按設(shè)備的時間降>1.3.8GetDeviceRspDTO StatusStatusCode:200{{ }]}InvalidaccessTheapplicationinputiscan'tbebothnull.能同時為nullTheapplicationisnotTheapplicationhasn'tbeen 64個字節(jié)返回結(jié)果:1.3.8GetDeviceRspDTO結(jié)構(gòu)體說明結(jié)構(gòu) StatusStatusCode:200{ }InvalidaccessTheapplicationisnotThedeviceisnotThedeviceDataisnotTheapplicationhasn'tbeenApplication 2、deviceInfoChanged(設(shè)備信息變化)端口。(說明:HTTP信道只可用于調(diào)測)StatusCode:201 {}"StatusCode:201 InvalidaccessTherequestcallbackurlisTheapplicationisnotGetnewCallbackUrlfromossfailed.oss獲取新的回調(diào)Getiotwsaddress 連設(shè)備時,gatewayIddeviceId。當(dāng)設(shè)備是非直連設(shè)備時,gatewayId為設(shè)備所關(guān)聯(lián)的直連設(shè)備(即網(wǎng)關(guān))deviceId。查詢參數(shù),根據(jù)時間段查詢的起始時間時間格式:yyyyMMdd’T’HHmmss’Z’如:查詢參數(shù),根據(jù)時間段查詢的結(jié)束時間時間格式:yyyyMMdd’T’HHmmss’Z’如:網(wǎng)關(guān)的設(shè)備唯一標(biāo)識,1-64個字節(jié)。當(dāng)設(shè)備是直連設(shè)備時,gatewayIddeviceId。當(dāng)設(shè)備是非直連設(shè)備時,gatewayId為設(shè)備所關(guān)聯(lián)的直連設(shè)備(即網(wǎng)關(guān))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保持一致。當(dāng)設(shè)備是非直連設(shè)備時,gatewayId為設(shè)備所關(guān)聯(lián)的直連設(shè)備(即網(wǎng)關(guān))的 > StatusStatusCode:200Body:{"serviceId":"serviceType":"option":"","properties":"desc":"dataType":"","enumList":["",""],"min":0,"max":"step":"maxLength":"unit":null,"method":"","events":}]}InvalidaccessTheinputisTheapplicationisnotTheapplicationhasn'tbeen 用ID要與當(dāng)境expireTime秒內(nèi)有效,超過這個時間則默認(rèn)為48小時CommandDTOV4投遞成功:StatusCode201返回參數(shù)參見附錄1.3.6 mandResp結(jié)構(gòu)體說明結(jié)構(gòu)體說明 {"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 命令I(lǐng)D用ID要與當(dāng)StatusCode:200 mandResp結(jié)構(gòu)體說明結(jié)構(gòu)體說明 {}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要與當(dāng)StatusCode:201 ID命令的設(shè)備IDWAITTING表示等待執(zhí)行中,RUNNING表示撤銷任務(wù)正在執(zhí)行,SUCCESS表FAILED表示撤銷任務(wù)執(zhí)行失敗,PART_SUCCESS表 mandResp結(jié)構(gòu)體說明結(jié)構(gòu)體說明 {}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,默認(rèn)0指定任務(wù)ID指定設(shè)備IDstartTime之后Hmmss'Z'endTime之前Hmmss'Z'用ID要與當(dāng)查詢成功:StatusCode200 Pagination的任務(wù)ID所屬的應(yīng)用IDIDRUNNING表示撤SUCCESS表示撤FAILED表示撤銷 1.3.6sp結(jié)構(gòu)體說明結(jié) 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給設(shè)備發(fā)送命令消息,實現(xiàn)對傳感器的實時控制。平臺分別提供了下發(fā)至Application發(fā)送命令給網(wǎng)關(guān)(或者網(wǎng)關(guān)下的設(shè)備)指定的服務(wù)下發(fā)命令/。 每個健都是profile中命令的參數(shù)seqNum:APPseqNumPOST請求BODY中攜帶,序列號規(guī)則采用:UUID_XXXX,UUID會根據(jù)JAVA自帶算法生UUID值,XXXX的取值范圍:0001-9999,達(dá)到9999后重新從0001開始,如此循環(huán) urlHTTPS信道回調(diào)地(說明:HTTP信道只可用于調(diào)測)命令已成功投遞StatusCode200命令狀態(tài):sent已發(fā)送deliveriedtoType為CLOUDfailedtoTypeCLOUDHHmmss’Z’如 toType為GATEWAY,如果請求有requestId則同請求的requestId一致,如果請求無requestId則平臺分配一個序 toType為CLOUD,則為null; {{"method":"INVITE-""from":"************","sdp":"**********"}StatusStatusCode:200{"status":"sent","timestamp":"**********"}InvalidaccessTheinputisTheapplicationisnotTheapplicationhasn'tbeenThedeviceDataisThedataindataBaseisTheserviceTypeisnotThedeviceisnot 數(shù),詳見下表param參數(shù)結(jié)構(gòu)說明,param批量命令類型:DeviceList/DeviceTypeDeviceAreaGroupListStatusCode:200{"appId":"******","timeout":1000,"param":{"fileId":}}StatusStatusCode:200{}InvalidaccessThebatchTaskcounthasreachedthelimit.10個時,返回ThebatchTasknamehasBadrequestTheuserhasno "appStatusCode:200任務(wù)狀態(tài) 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 分頁查詢參數(shù),pageNo=null時StatusCode:200 StatusStatusCode:200{"pageSize":1,{"output":null,"param":{}}]}TheinputisTheapplicationisnotTheapplicationhasn'tbeen

RuleDTO1.2id。List<Json表)groupExpress二選一必填自定義結(jié)構(gòu)體(Condition-List<Json規(guī)則的動作。Action為自定義結(jié)構(gòu)Action-SMS、Action-、ListDEVICE類型和TIMER類型結(jié)構(gòu)體GroupElement表示一個condition,自定義結(jié)構(gòu)設(shè)備數(shù)據(jù)的,自定義結(jié) 2030,應(yīng)用場景:溫度在20到30之間觸發(fā)規(guī)鐘,默認(rèn)為0不延時Strategy則觸發(fā)默認(rèn)為pulses,表示收到的傳組設(shè)備數(shù)據(jù)的,自定義結(jié)構(gòu),根據(jù)讀between操作符聯(lián)用時,右2030之間觸發(fā)規(guī)分鐘,默認(rèn)為0不延時結(jié)構(gòu)體Strategy"DoorWindow/status",屬性支持多個,比如OBD需要兩個屬性,經(jīng)度和緯度”,多個屬性中間以between操作符聯(lián)用時,右2030之間觸發(fā)規(guī)分鐘,默認(rèn)為0不延時結(jié)構(gòu)體Strategy比如OBD需要兩個屬性,經(jīng)度和緯度”,多個屬性中間以逗號分隔CMD當(dāng)規(guī)則Demo-通知內(nèi)容通知內(nèi)容(content為空時,Action-結(jié)構(gòu)說明action的編號,在一條規(guī)則范圍內(nèi)唯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向平臺訂閱設(shè)備變更通知(Application訂閱當(dāng)設(shè)備發(fā)生,Application通知給Application?;卣{(diào)通知地址,請參考Application訂閱。{ }}口功能將該信息通知給Application?;卣{(diào)通知地址,請參考Application訂閱。非直連設(shè)備時,gatewayId為設(shè)備所關(guān)聯(lián)的直連設(shè)備(即網(wǎng)關(guān))deviceId。ENDPOINT傳感器.GATEWAY:網(wǎng)關(guān).1.3.1DeviceInfo結(jié){ }}國電信物聯(lián)網(wǎng)開放平臺使用該接口功能將該信息通知給Application。此處的接口路徑是應(yīng)用向平臺訂閱數(shù)據(jù)時的對應(yīng)notifyType為非直連設(shè)備時,gatewayId為設(shè)備所關(guān)聯(lián)的直連設(shè)備(即網(wǎng)關(guān))deviceId。1.3.1DeviceInfo結(jié){"notifyType":"deviceInfoChanged",}}中國電信物聯(lián)網(wǎng)開放平臺使用該接口功能將該信息通知給Application。此處的接口路徑是應(yīng)用向平臺訂閱數(shù)據(jù)時的對應(yīng)notifyType為gatewayIddeviceId。當(dāng)設(shè)備的直連設(shè)備(即網(wǎng)關(guān))deviceId。HHmmss’Z’如 {"notifyType":"deviceDhanged","requestId":"{requestId}","serviceId":"data":{"battery_low":1},}}口功能將該信息通知給Application?;?/p>

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論