1.Overview
Developers should send required parameters to server to get QR code image(base64).
2.Examples
Language Explanation Download Version
php php_sdk instructions Download SDK and DEMO V2.0
java java_sdk instructions Download SDK and DEMO V2.0
c# c#_sdk instructions Download SDK and DEMO V2.0
3. Request URL
4. Request parameter format
/?c=Qrcode&a=getCard&sig={sig}
Sig is the encryption result of developer account SID and Auth Token, get details in Development documentation
HTTP request header:
Accept:application/json;
Content-Type:application/x-www-form-urlencode;charset=uft-8;
Authorization:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
{"mobile":"1330000000","areaCode":"86","communityNo":"13444456566","time":"unix timestamp","cardNo":"DB18Q4V6pe57qvrX","cardType":"0","lockType":"1","openEndTime":"1812051823"}
5. Parameter specification
Attribute Type Constraint Explanation
accountSid String Required Developer Account SID, the unique identifier of developer(32 characters of letters and numbers).
sig String Required Signature, API request required.
Accept String Required Standard HTTP header, content-type: application/json
Content-Type String Required Standard HTTP header, type:application/x-www-form-urlencode;charset=utf-8
Authorization String Required HTTP header authentication information
mobile String Required Excluding the area code phone number, the parameter eg:18510623155 was passed when the room card was created.
areaCode String Optional The user's mobile phone belongs to the country area code, the parameters passed when creating the room card, pay attention to the number before no other characters, default 86.
communityNo String Required Community No.
time String Required UNIX timestamp, for example:1448523919
roomFlag String Required the return No. (Card No., )sent when you create room card,or the address when scan the QRB lock(eg, 'mac:666666666666')
openEndTime String Optional The effective cut-off time of qrcode (time format: 1812051823 December 5th, 2018 at 18:23,cannot exceed 30 days of the current time, and the effective time set by the default QRMaster when it is not transmitted)
cardType String Optional Key type (0: room card, 1: floor card, 2: building card, default 0 when not being transmitted).
lockType String Optional Lock Type[the parameter only works when cardType=1 or cardType=2], 0: QR Lock(default), 1: QRA Lock
resultType String Optional Response type[the parameter only works when cardType=0], 1:only includes data of QR code image(default), 2:only includes the unlock record by BLE SDK Download(effective time can be set by QR Master), 3:The above two all included, 4:Return QRP password.
outInfo String Optional Can't exceed 20 digits, can only be a combination of numbers and letters
6. HTTP JSON request demo
HTTP header
Accept:application/json;
Content-Type:application/x-www-form-urlencode;charset=uft-8;
Authorization:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
{"mobile":"1330000000","areaCode":"86","communityNo":"13444456566","time":"1448523919","cardNo":"DB18Q4V6pe57qvrX","cardType":"0","lockType":"0","openEndTime":"1812051823"}
Http Requested parameters
/?c=Qrcode&a=getCard&sig=031A94222BB0AF73AA0DCDEB92D54609
Successful result(base64QR CodePicture)。
{"status":"200","info":"success","baseImg":"iVBORw0KGgoAAAANSUhEUgAAAM0AAADNAQMAAAAhcmYqAAAABlBMVEX///8AAABVwtN+AAABtElEQVRYhe2XO46EQAxEazRBh3uEvglcDAkkLsbepI9ASIDGW+WeWT7aTU2Cg54eXmLZRdkAd9zxb3yZ2UsHo/A26jLEI/40QF4eNhY85mepz6LRaEvDDJcGz5KMnGlehdaMplbrSoSnOG/8exFSv5RhOyOniejYyijk6h2LMvTjLOwYVPmqs0OyGaeIQl12zaYX+oKW6aVPvyKRWgX0qtaa0/fc6UA8Gk2WApskYbZPaQ7hSEYysVX2bVQMq2V4XIOY0gozeutHwvGIXaLFr1jauS9Mc8gsGeKRGd2EYqFm5bIDWK14pFCDkgplU5VwPHK5auSKs2R7YUciDhlOfs0cLgLYqzcUMa/W/IX2Qu3VG4ooV95psB189G3qDUR096T9kL7Sl0U12tQbidzY2SX6ysnnI5HmblNnDjKOIyAQqVDqlylNtkrq/SQfiCibamp68N6bN/WGoTeHb2dJO9mm3kBU90N/k9i51pf2K9AAHzJKLtcMf9UbifzbwV9j/3Zgv/Y+H4rehcrpdVBvNKKv+GJ22ogikffLig88bmeHERCIpF7NXRmsm5rZHI/uuOPP+AEA3a22UTAOSAAAAABJRU5ErkJggg=="}
Failure reason returning:
{ "status": 4003, "info": "some 错误" }
7. XML request demo
HTTP header
Accept:application/xml;
Content-Type:application/x-www-form-urlencode;charset=uft-8;
Authorization:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<?xml version='1.0' encoding='utf-8'?>
<Request>
<mobile>18819238549</mobile>
<communityNo>1316879800</communityNo>
<time>1448523919</time>
<areaCode>86</areaCode>
<cardNo>DB18Q4V6pe57qvrX</cardNo>
<cardType>0</cardType>
<lockType>0</lockType>
<openEndTime>1812051823</openEndTime>
</Request>
Http Requested parameters
/?c=Qrcode&a=getCard&sig=031A94222BB0AF73AA0DCDEB92D54609
Successful result(base64QR CodePicture)。
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
<status>200</status>
<info>success</info>
<baseImg>iVBORw0KGgoAAAANSUhEUgAAAM0AAADNAQMAAAAhcmYqAAAABlBMVEX\/\/\/8AAABVwtN+AAABtElEQVRYhe2XO46EQAxEazRBh3uEvglcDAkkLsbepI9ASIDGW+WeWT7aTU2Cg54eXmLZRdkAd9zxb3yZ2UsHo\/A26jLEI\/40QF4eNhY85mepz6LRaEvDDJcGz5KMnGlehdaMplbrSoSnOG\/8exFSv5RhOyOniejYyijk6h2LMvTjLOwYVPmqs0OyGaeIQl12zaYX+oKW6aVPvyKRWgX0qtaa0\/fc6UA8Gk2WApskYbZPaQ7hSEYysVX2bVQMq2V4XIOY0gozeutHwvGIXaLFr1jauS9Mc8gsGeKRGd2EYqFm5bIDWK14pFCDkgplU5VwPHK5auSKs2R7YUciDhlOfs0cLgLYqzcUMa\/W\/IX2Qu3VG4ooV95psB189G3qDUR096T9kL7Sl0U12tQbidzY2SX6ysnnI5HmblNnDjKOIyAQqVDqlylNtkrq\/SQfiCibamp68N6bN\/WGoTeHb2dJO9mm3kBU90N\/k9i51pf2K9AAHzJKLtcMf9UbifzbwV9j\/3Zgv\/Y+H4rehcrpdVBvNKKv+GJ22ogikffLig88bmeHERCIpF7NXRmsm5rZHI\/uuOPP+AEA3a22UTAOSAAAAABJRU5ErkJggg==</baseImg>
</Response>
Failure reason returning:
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
<status>4003</status>
<info> some 错误 </info>
</Response>
Hardware Consulting
Software
After-sales
Hotline
400-0900843