Revision as of 14:00, June 6, 2017 by Sbogard (talk | contribs)
Jump to: navigation, search

Sbogard

Uber API

<?php // Display Version dropdown list
   if(!$isIsolated ||!$wgUser->isAnon()) {
       if(($_SERVER['REQUEST_URI'] != '/' . PONYDOCS_DOCUMENTATION_NAMESPACE_NAME) && (!preg_match('/^\/' . PONYDOCS_DOCUMENTATION_NAMESPACE_NAME . '\/(\w+)$/', $_SERVER['REQUEST_URI']))) {
           if(strpos($_SERVER['REQUEST_URI'], '/Documentation/') !== false) { ?>
                   <?php
                   if( $this->data['pIsDocumentationTopic'] )

                           foreach( $this->data['versions'] as $idx => $data ) {
                               echo '<a href="/pure-engage/' . str_replace(':'. $this->data['selectedVersion'] , ':' . $data['name'] , $wgTitle) . '" ';
                               if( !strcmp( $data['name'], $this->data['selectedVersion'] )) {
                                   echo 'style="padding: 0.3em; color: #FDFDFD; background-color: #5e99ff;"';
                               }
                               else echo   'style="padding: 0.3em;" ';
                               if( isset($data['label']))
                                   echo '> ' . $data['label'] . ' </a> ';
                               else 
                                   echo '> ' . $data['name'] .' </a> ';
                           }
                       
                       ?>

<?php

           }
       }
   }    

?>

Access

Methods

Jump to Models

Table of Contents

Estimates

Products

User

  • get /history
  • get /me

Estimates

get /estimates/price

Up
<code class="huge"><span class="http-method">get</span> /estimates/price</code>
Price Estimates (estimatesPriceGet)
The Price Estimates endpoint returns an estimated price range

for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.<br><br>The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.

Query parameters

start_latitude (required)
Query Parameter — Latitude component of start location. format: double
start_longitude (required)
Query Parameter — Longitude component of start location. format: double
end_latitude (required)
Query Parameter — Latitude component of end location. format: double
end_longitude (required)
Query Parameter — Longitude component of end location. format: double


Return type

     array[<a href="#inline_response_200_1">inline_response_200_1</a>]
     


Example data

Content-Type: application/json
<code>[ {
  "high_estimate" : 1.3579000000000001069366817318950779736042022705078125,
  "product_id" : "aeiou",
  "low_estimate" : 1.3579000000000001069366817318950779736042022705078125,
  "surge_multiplier" : 1.3579000000000001069366817318950779736042022705078125,
  "estimate" : "aeiou",
  "display_name" : "aeiou",
  "currency_code" : "aeiou"
} ]</code>

Produces=

This API call produces the following media types according to the Accept request header;

   the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

   An array of price estimates by product
       

0

   Unexpected error
       <a href="#inline_response_default">inline_response_default</a>

<a name="estimatesTimeGet"/>
   <a class="up" href="#__Methods">Up</a>
<code class="huge"><span class="http-method">get</span> /estimates/time</code>
Time Estimates (estimatesTimeGet)
The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.



Query parameters

start_latitude (required)
Query Parameter — Latitude component of start location. format: double
start_longitude (required)
Query Parameter — Longitude component of start location. format: double
customer_uuid (optional)
Query Parameter — Unique customer identifier to be used for experience customization. format: uuid
product_id (optional)
Query Parameter — Unique identifier representing a specific product for a given latitude & longitude.


Return type

     array[<a href="#inline_response_200">inline_response_200</a>]
     


Example data

Content-Type: application/json
<code>[ {
  "image" : "aeiou",
  "product_id" : "aeiou",
  "description" : "aeiou",
  "display_name" : "aeiou",
  "capacity" : "aeiou"
} ]</code>

Produces

   This API call produces the following media types according to the Accept request header;
   the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

   An array of products
       

0

   Unexpected error
       <a href="#inline_response_default">inline_response_default</a>

<a name="Products">Products</a>

<a name="productsGet"/>
   <a class="up" href="#__Methods">Up</a>
<code class="huge"><span class="http-method">get</span> /products</code>
Product Types (productsGet)
The Products endpoint returns information about the *Uber* products

offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order.



Query parameters

latitude (required)
Query Parameter — Latitude component of location. format: double
longitude (required)
Query Parameter — Longitude component of location. format: double


Return type

     array[<a href="#inline_response_200">inline_response_200</a>]
     


Example data

Content-Type: application/json
<code>[ {
  "image" : "aeiou",
  "product_id" : "aeiou",
  "description" : "aeiou",
  "display_name" : "aeiou",
  "capacity" : "aeiou"
} ]</code>

Produces

   This API call produces the following media types according to the Accept request header;
   the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

   An array of products
       

0

   Unexpected error
       <a href="#inline_response_default">inline_response_default</a>

<a name="User">User</a>

<a name="historyGet"/>
   <a class="up" href="#__Methods">Up</a>
<code class="huge"><span class="http-method">get</span> /history</code>
User Activity (historyGet)
The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.



Query parameters

offset (optional)
Query Parameter — Offset the list of returned results by this amount. Default is zero. format: int32
limit (optional)
Query Parameter — Number of items to retrieve. Default is 5, maximum is 100. format: int32


Return type

     <a href="#inline_response_200_3">inline_response_200_3</a>
     


Example data

Content-Type: application/json
<code>{
  "offset" : 123,
  "limit" : 123,
  "count" : 123,
  "history" : [ {
    "uuid" : "aeiou"
  } ]
}</code>

Produces

   This API call produces the following media types according to the Accept request header;
   the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

   History information for the given user
       <a href="#inline_response_200_3">inline_response_200_3</a>

0

   Unexpected error
       <a href="#inline_response_default">inline_response_default</a>

<a name="meGet"/>
   <a class="up" href="#__Methods">Up</a>
<code class="huge"><span class="http-method">get</span> /me</code>
User Profile (meGet)
The User Profile endpoint returns information about the Uber user that has authorized with the application.




Return type

     <a href="#inline_response_200_2">inline_response_200_2</a>
     


Example data

Content-Type: application/json
<code>{
  "last_name" : "aeiou",
  "promo_code" : "aeiou",
  "first_name" : "aeiou",
  "email" : "aeiou",
  "picture" : "aeiou"
}</code>

Produces

   This API call produces the following media types according to the Accept request header;
   the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

   Profile information for a user
       <a href="#inline_response_200_2">inline_response_200_2</a>

0

   Unexpected error
       <a href="#inline_response_default">inline_response_default</a>

<a href="#__Models">Up</a>

Models

 [ Jump to <a href="#__Methods">Methods</a> ]

Table of Contents

  1. <a href="#Activities">Activities</a>
  2. <a href="#Activity">Activity</a>
  3. <a href="#Error">Error</a>
  4. <a href="#inline_response_200">inline_response_200</a>
  5. <a href="#inline_response_200_1">inline_response_200_1</a>
  6. <a href="#inline_response_200_2">inline_response_200_2</a>
  7. <a href="#inline_response_200_3">inline_response_200_3</a>
  8. <a href="#inline_response_200_3_history">inline_response_200_3_history</a>
  9. <a href="#inline_response_default">inline_response_default</a>
  10. <a href="#PriceEstimate">PriceEstimate</a>
  11. <a href="#Product">Product</a>
  12. <a href="#Profile">Profile</a>

<a name="Activities">Activities - </a> <a class="up" href="#__Models">Up</a>

offset (optional)
<a href="#integer">Integer</a> Position in pagination. format: int32
limit (optional)
<a href="#integer">Integer</a> Number of items to retrieve (100 max). format: int32
count (optional)
<a href="#integer">Integer</a> Total number of items available. format: int32
history (optional)
<a href="#inline_response_200_3_history">array[inline_response_200_3_history]</a>

<a name="Activity">Activity - </a> <a class="up" href="#__Models">Up</a>

uuid (optional)
<a href="#string">String</a> Unique identifier for the activity

<a name="Error">Error - </a> <a class="up" href="#__Models">Up</a>

code (optional)
<a href="#integer">Integer</a> format: int32
message (optional)
<a href="#string">String</a>
fields (optional)
<a href="#string">String</a>

<a name="inline_response_200">inline_response_200 - </a> <a class="up" href="#__Models">Up</a>

product_id (optional)
<a href="#string">String</a> Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles.
description (optional)
<a href="#string">String</a> Description of product.
display_name (optional)
<a href="#string">String</a> Display name of product.
capacity (optional)
<a href="#string">String</a> Capacity of product. For example, 4 people.
image (optional)
<a href="#string">String</a> Image URL representing the product.

<a name="inline_response_200_1">inline_response_200_1 - </a> <a class="up" href="#__Models">Up</a>

product_id (optional)
<a href="#string">String</a> Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles
currency_code (optional)
<a href="#string">String</a> [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code.
display_name (optional)
<a href="#string">String</a> Display name of product.
estimate (optional)
<a href="#string">String</a> Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI.
low_estimate (optional)
<a href="#number">BigDecimal</a> Lower bound of the estimated price.
high_estimate (optional)
<a href="#number">BigDecimal</a> Upper bound of the estimated price.
surge_multiplier (optional)
<a href="#number">BigDecimal</a> Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.

<a name="inline_response_200_2">inline_response_200_2 - </a> <a class="up" href="#__Models">Up</a>

first_name (optional)
<a href="#string">String</a> First name of the Uber user.
last_name (optional)
<a href="#string">String</a> Last name of the Uber user.
email (optional)
<a href="#string">String</a> Email address of the Uber user
picture (optional)
<a href="#string">String</a> Image URL of the Uber user.
promo_code (optional)
<a href="#string">String</a> Promo code of the Uber user.

<a name="inline_response_200_3">inline_response_200_3 - </a> <a class="up" href="#__Models">Up</a>

offset (optional)
<a href="#integer">Integer</a> Position in pagination. format: int32
limit (optional)
<a href="#integer">Integer</a> Number of items to retrieve (100 max). format: int32
count (optional)
<a href="#integer">Integer</a> Total number of items available. format: int32
history (optional)
<a href="#inline_response_200_3_history">array[inline_response_200_3_history]</a>

<a name="inline_response_200_3_history">inline_response_200_3_history - </a> <a class="up" href="#__Models">Up</a>

uuid (optional)
<a href="#string">String</a> Unique identifier for the activity

<a name="inline_response_default">inline_response_default - </a> <a class="up" href="#__Models">Up</a>

code (optional)
<a href="#integer">Integer</a> format: int32
message (optional)
<a href="#string">String</a>
fields (optional)
<a href="#string">String</a>

<a name="PriceEstimate">PriceEstimate - </a> <a class="up" href="#__Models">Up</a>

product_id (optional)
<a href="#string">String</a> Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles
currency_code (optional)
<a href="#string">String</a> [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code.
display_name (optional)
<a href="#string">String</a> Display name of product.
estimate (optional)
<a href="#string">String</a> Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI.
low_estimate (optional)
<a href="#number">BigDecimal</a> Lower bound of the estimated price.
high_estimate (optional)
<a href="#number">BigDecimal</a> Upper bound of the estimated price.
surge_multiplier (optional)
<a href="#number">BigDecimal</a> Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.

<a name="Product">Product - </a> <a class="up" href="#__Models">Up</a>

product_id (optional)
<a href="#string">String</a> Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles.
description (optional)
<a href="#string">String</a> Description of product.
display_name (optional)
<a href="#string">String</a> Display name of product.
capacity (optional)
<a href="#string">String</a> Capacity of product. For example, 4 people.
image (optional)
<a href="#string">String</a> Image URL representing the product.

<a name="Profile">Profile - </a> <a class="up" href="#__Models">Up</a>

first_name (optional)
<a href="#string">String</a> First name of the Uber user.
last_name (optional)
<a href="#string">String</a> Last name of the Uber user.
email (optional)
<a href="#string">String</a> Email address of the Uber user
picture (optional)
<a href="#string">String</a> Image URL of the Uber user.
promo_code (optional)
<a href="#string">String</a> Promo code of the Uber user.
 </body>
Comments or questions about this documentation? Contact us for support!