骑行提醒api 404错误

时间:2018-01-11 14:04:17

标签: php http-status-code-404 uber-api guzzlehttp

当我们致电Uber Products API时,其工作正常,但当我们致电Ride Reminder API时,我们会收到404错误:

  

PHP致命错误:未捕获异常GuzzleHttp \ Exception \ ClientException

带有消息

  

客户端错误:发布https://sandbox-api.uber.com/v1.2/reminders

导致404 Not Found响应:

  

未找到404页面   /var/www/html/uber/uber/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113   堆栈跟踪:       #0 /var/www/html/uber/uber/vendor/guzzlehttp/guzzle/src/Middleware.php(65):   GuzzleHttp \异常\ RequestException ::创建(对象(GuzzleHttp \ PSR7 \请求),   对象(GuzzleHttp \ PSR7 \响应))       #1 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/Promise.php(203):   GuzzleHttp \中间件:: GuzzleHttp {闭合}(对象(GuzzleHttp \ PSR7 \响应))       #2 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/Promise.php(156):   GuzzleHttp \无极\无极:: callHandler(1,   对象(GuzzleHttp \ Psr7 \ Response),数组)       #3 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/TaskQueue.php(47):   GuzzleHttp \无极\无极:: GuzzleHttp \ {承诺关闭}()       #4 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/Promise.php(246):   Guzzle in   /var/www/html/uber/uber/vendor/stevenmaguire/uber-php/src/Client.php   在第173行

我们正在使用以下示例代码来解决,让我知道可能会出现什么问题。

<?php
include "vendor/autoload.php";

$client = new Stevenmaguire\Uber\Client(array(
    'access_token' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
    'server_token' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
    'use_sandbox'  => true, // optional, default false
    'version'      => 'v1.2', // optional, default 'v1.2'
    'locale'       => 'en_US', // optional, default 'en_US'
));

$products = $client->getProducts(array(
    'latitude' => '41.85582993',
    'longitude' => '-87.62730337'
));
var_dump($products);

$attributes = array(
    'reminder_time' => '1429294463',
    'phone_number' => '555-555-5555',
    'event' => array(
        'time' => '1515750429',
        'name' => 'John with friends',
        'location' => 'Dolores Park',
        'latitude' => '37.759773',
        'longitude' => '-122.427063',
        'product_id' => "737d4e43-9e12-4a81-add3-acb101bab4c7",
    ),
);
$reminder = $client->createReminder($attributes);
var_dump($reminder);

请帮助我们解决此问题。

1 个答案:

答案 0 :(得分:2)

来自http://developer.uber.com的乘车提醒已删除文档,目前不支持这些文档。