貝殼物聯(lián)圖片接口協(xié)議,http協(xié)議接口。
對指定的URL發(fā)起一個(gè)HTTP POST請求,會為指定的圖片接口上傳一幅新的圖像, 使用此API來為圖片接口存儲圖像數(shù)據(jù), 目前只支持上傳jpg, png, gif類型的圖像.
http://www.placeboworld.cn/pubapi/uploadImg/did/<did>/inputid/<inputid>
| 參數(shù)名 | 必需 | 類型 | 說明 |
| did | true | string | 設(shè)備ID |
| input | true | string | 接口ID |
| API-KEY | true | string | 設(shè)備APIKEY,http header內(nèi) |
binary
注意:此處格式與數(shù)值型傳感器等不同,不再使用JSON格式,而是直接上傳圖片的原始內(nèi)容
POST
{"M":"uploadImg","R":"xxx"}xxx——返回代碼,0、1、-1、-2、-3、-4
0:上傳失?。?/p>
1:上傳成功;
-1:APIKEY錯(cuò)誤;
-2:上傳參數(shù)不全或錯(cuò)誤;
-3:接口不屬于該設(shè)備;
-4:接口非圖片接口。
Note: json字符串末尾無“\n”。
需要在HTTP Header中增加API-KEY來授權(quán)寫入操作, 支持一次傳送一幅圖像數(shù)據(jù).
curl --request POST -F "data=@/home/pi/bigiot.png" --header "API-KEY: dxx3db14b" http://www.placeboworld.cn/pubapi/uploadImg/did/449/inputid/844
Note:需要在HTTP Header中增加API-Key來授權(quán)寫入操作, 支持一次傳送一幅圖像數(shù)據(jù);
Note:目前限定相鄰圖像數(shù)據(jù)上傳間隔須大于等于10s;
Note:圖片大小不大于100K;
Note:圖片格式j(luò)pg、png、gif。