uber-php icon indicating copy to clipboard operation
uber-php copied to clipboard

Ride reminder api 404 error

Open sasiarjun opened this issue 7 years ago • 4 comments

When we are calling uber products api its working perfect but wen we call ride reminder api we getting following 404 errors,

PHP Fatal error:  Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: `POST https://sandbox-api.uber.com/v1.2/reminders` resulted in a `404 Not Found` response:
404 page not found

' in /var/www/html/uber/uber/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /var/www/html/uber/uber/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#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 on line 173

following will be our testing code


<?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);

Please help us to fix this.

sasiarjun avatar Jan 11 '18 13:01 sasiarjun

It looks like you are hitting the sandbox URL. I am not sure if Uber has support for this endpoint in the sandbox environment. I can't see anything clearly defined in their documentation. Have you tried in a production environment?

stevenmaguire avatar Jan 11 '18 17:01 stevenmaguire

Yea tried in prod environment, same error coming for prod environment.

sasiarjun avatar Jan 12 '18 05:01 sasiarjun

I don't know what to tell you other than to suggest you contact their support to debug and troubleshoot. This package is does not do anything other than wrap their API based on their documentation, in this case: https://developer.uber.com/docs/riders/references/api/v1.2/reminders-post

I haven't seen your code or error response for your latest production attempt, and assuming it is identical to the first except using sandbox => false in the config, I am not sure what else to say.

If you discover there IS some specific inaccuracy in this project I will happily fix. Right now I am not clear on anything that may be wrong.

stevenmaguire avatar Jan 12 '18 16:01 stevenmaguire

I also just noticed that the endpoint only supports server_token, documented here: https://developer.uber.com/docs/riders/guides/authentication/server-token

You may be getting a 404 due to that.

stevenmaguire avatar Jan 12 '18 17:01 stevenmaguire