云平台标准API接口参数:
<?php header("Content-Type: text/html; charset=utf-8"); if(isset($_REQUEST["plateNumber"])){ $plateNumber = $_REQUEST["plateNumber"]; }else{ $plateNumber = '鄂AAAAAA'; } $data =array( "phone"=>AAAAAAAAAAA, //云平台建立商户账户 "password"=>AAAAAA //云平台建立商户密码 ); function resultJosn($url,$data){ $query = http_build_query($data); $result = file_get_contents($url.'?'.$query); return $result; } $login = resultJosn($url='https://wechat.tdzntech.com/cloudparkapi/apps/shoplogin',$data); echo $login; $json = json_decode($login,true);//将json解析成数组 $token=$json['token']; $shopId=$json['shopId']; $userId=$json['userId']; $shopTicketId=$json['shop']['id']; $data =array( "version" => "1.0", "planNum" => "1", "shopTicketId" => $shopTicketId, "shopId" => $shopId, "userId" => $userId, "autoRefresh"=> "false" ); $getMark = resultJosn($url='https://wechat.tdzntech.com/cloudparkapi/apps/planQrcode',$data); $json = json_decode($getMark,true);//将json解析成数组 $mark=$json['mark']; echo "<br>"; echo $mark; $data=array( "mark" => $mark, "shopId" => $shopId, "plateNumber" => $plateNumber ); $postPlateNumber = resultJosn($url='https://wechat.tdzntech.com/cloudparkapi/api/bindPlateAndTicket',$data); echo "<br>"; echo $postPlateNumber; $json = json_decode($postPlateNumber,true);//将json解析成数组 $text=$json['text']; echo "<br>"; echo $text; ?>
<?php header("Content-Type: text/html; charset=utf-8"); if(isset($_REQUEST["plateNumber"])){ $plateNumber = $_REQUEST["plateNumber"]; }else{ $plateNumber = '鄂AAAAAAA'; } $data =array( "phone"=>XXXXXXXXXXX, //云平台建立商户账户 "password"=>9XXXXX //云平台建立商户账户 ); $query = http_build_query($data); $result = file_get_contents('https://wechat.tdzntech.com/cloudparkapi/apps/shoplogin'.'?'.$query); echo $result; $json = json_decode($result,true);//将json解析成数组 $token=$json['token']; $shopId=$json['shopId']; $userId=$json['userId']; $shopTicketId=$json['shop']['id']; $datab =array( "version" => "1.0", "planNum" => "1", "shopTicketId" => $shopTicketId, "shopId" => $shopId, "userId" => $userId, "autoRefresh"=> "false" ); var_dump($datab); $queryb = http_build_query($datab); $resultb = file_get_contents('https://wechat.tdzntech.com/cloudparkapi/apps/planQrcode'.'?'.$queryb); echo $resultb; $jsonb = json_decode($resultb,true);//将json解析成数组 var_dump($jsonb); $mark=$jsonb['mark']; $data_c=array( "mark" => $mark, "shopId" => $shopId, "plateNumber" => $plateNumber ); $query_c = http_build_query($data_c); $result_c = file_get_contents('https://wechat.tdzntech.com/cloudparkapi/api/bindPlateAndTicket'.'?'.$query_c); echo $result_c; $json_c = json_decode($result_c,true);//将json解析成数组 var_dump($json_c); ?>
充电标准接口 POST
一.查询shopId
请求地址:https://wechat.tdzntech.com/cloudparkapi/apps/shoplogin
请求参数:
{ "version": "1.0", "phone": "XXXXXXXXXXX", //我方分配账户 "password": "XXXXXX" //我方分配密码 }
回返json数据
{ "code": 1, "accountName": "XXX", "shops": [ { "createdTime": 1606014496000, "currentPage": 0, "estateId": 486, "id": 4288, "lastIndex": 0, "numPerPage": 0, "overdueNum": 0, "params": [], "parkCode": "XXXXXXXXXXX", "parkName": "XXXXXX停车场", "price": 0, "remainFree": 0, "remainNum": 9999, "shopId": 1273, "shopName": "XXxxxx", "startIndex": 0, "status": 1, "sumFree": 0, "ticketId": 3296, "ticketName": "XXXXXXXXX", "ticketSum": 10000, "ticketType": 4, "ticketValue": 0, "totalPages": 0, "totalRows": 0, "updateTime": 1606017944000, "useFree": 0, "useNum": 1 } ], "shopId": 1273, "userId": 3779, "token": "6ef115a732eaca3cc9af0519f63cc155" //得到的TOKEN两小时有效 }
二.查询mark
请求URI: (POST)https://wechat.tdzntech.com/cloudparkapi/apps/planQrcode
请求参数:
{ "version": "1.0", "planNum": "1", "shopTicketId": "4288", "shopId": "1273", "userId": "3779", "autoRefresh": "false" }
回返json数据
{ "code": 1, "mark": "YHQ941D3316ACC2447D8FFDD4F8024FFE23" }
三.发送车号
请求URI: (POST)https://wechat.tdzntech.com/cloudparkapi/api/bindPlateAndTicket
请求参数:
{ "mark": "YHQ941D3316ACC2447D8FFDD4F8024FFE23", "shopId": "1273", "plateNumber": "浙AAAAAA" }
返回JSON数据
{ "code": -1, "text": "车场提示: 未找到[浙AD12034]的入场记录." } { "code": -1, "text": "此车场优惠券已领过了!" } { "code": 1, "text": "领取成功!", "remark": "" }