小编Riz*_*ill的帖子

HotelBeds Php API为我提供空洞的结果

我试过这段代码来访问数据但无法获取.任何人都知道如何添加此文件(Xml)

XML文件

<availabilityRQ xmlns="http://www.hotelbeds.com/schemas/messages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<stay checkIn="2015-12-28" checkOut="2015-12-29"/>
 <occupancies>
  <occupancy rooms="1" adults="1" children="1">
   <paxes>
    <pax type="AD" age="31"/>
    <pax type="CH" age="3"/> 
    </paxes>
  </occupancy> 
 </occupancies>
 <hotels>
           <hotel>1067</hotel> 
           <hotel>1070</hotel>
           <hotel>135813</hotel> 
        </hotels> 
</availabilityRQ>
Run Code Online (Sandbox Code Playgroud)

要拨打的代码

以下示例要求PHP版本大于5.5.x且库pecl_http => 2.5.3您可以通过https://pecl.php.net安装它

// Your API Key and secret
$apiKey = "6355445214552444";
$sharedSecret = "5456842";

// Signature is generated by SHA256 (Api-Key + Shared Secret + Timestamp (in seconds))
$signature = hash("sha256", $apiKey.$sharedSecret.time());

// Example of call to the API
$endpoint = "https://api.test.hotelbeds.com/hotel-api/1.0/status";

$request = new http\Client\Request("GET", …
Run Code Online (Sandbox Code Playgroud)

php api

9
推荐指数
1
解决办法
1554
查看次数

标签 统计

api ×1

php ×1