其他分享
首页 > 其他分享> > 腾达智能tdzntech.com云平台API接口

腾达智能tdzntech.com云平台API接口

作者:互联网

函数版本
<?php
header("Content-Type: text/html; charset=utf-8");           
if(isset($_REQUEST["plateNumber"])){
   $plateNumber = $_REQUEST["plateNumber"];
   }else{
   $plateNumber = '浙XXXXXX';
   }
   $data =array(
        "phone"=>XXXXXX,         //云平台上建立商户账户密码
        "password"=>XXXXXX       //云平台上建立商户密码
     );
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);
    var_dump($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);
    var_dump($getMark);
    $json = json_decode($getMark,true);//将json解析成数组
    $mark=$json['mark'];
    $data=array(
          "mark" => $mark,
          "shopId" => $shopId,
          "plateNumber" => $plateNumber
          );
$postPlateNumber = resultJosn($url='https://wechat.tdzntech.com/cloudparkapi/api/bindPlateAndTicket',$data);
     var_dump($postPlateNumber);
     $json = json_decode($postPlateNumber,true);//将json解析成数组
     $text=$json['text'];
     echo $text;

?>
View Code

不带函数的版本

<?php
header("Content-Type: text/html; charset=utf-8");           
if(isset($_REQUEST["plateNumber"])){
   $plateNumber = $_REQUEST["plateNumber"];
   }else{
   $plateNumber = '鄂AAAAAA';
   }
   $data =array(
        "phone"=>XXXXXXXXXXX,      //云平台建立商户账户
        "password"=>XXXXXX         //云平台建立商户密码
     );
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);
var_dump($login);

    $json = json_decode($login,true);//将json解析成数组
    $token=$json['token'];
    $shopId=$json['shopId'];
    $userId=$json['userId'];
    $shopTicketId=$json['shop']['id'];
    echo "<br>";
    echo $token;
    echo "<br>";
    echo $shopId;
    echo "<br>";
    echo $userId;
    echo "<br>";
    $data =array(
          "version" => "1.0",
          "planNum" => "1",
          "shopTicketId" => $shopTicketId,
          "shopId" => $shopId,
          "userId" => $userId,
          "autoRefresh"=> "false"
     );
     var_dump($data);
$getMark = resultJosn($url='https://wechat.tdzntech.com/cloudparkapi/apps/planQrcode',$data);
var_dump($getMark);
$json = json_decode($getMark,true);//将json解析成数组
$mark=$json['mark'];
echo $mark;
     $data=array(
          "mark" => $mark,
          "shopId" => $shopId,
          "plateNumber" => $plateNumber
     );
var_dump($data);
$postPlateNumber = resultJosn($url='https://wechat.tdzntech.com/cloudparkapi/api/bindPlateAndTicket',$data);
var_dump($postPlateNumber);
$json = json_decode($postPlateNumber,true);//将json解析成数组
$text=$json['text'];
echo $text;

     /*$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); */
?>
View Code

云平台标准API接口参数:


充电标准接口 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": ""
}

标签:com,userId,shopId,mark,tdzntech,json,API,data
来源: https://www.cnblogs.com/zhouein/p/14020061.html