uber-api
UberApi - JavaScript client for uber-api Move your app forward with the Uber API This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-07-28T08:36:48.252Z
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
Installation
Node.js
Fornpm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install uber-api --save
git
If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/uber-api then install it via:
npm install YOUR_USERNAME/uber-api --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Getting Started
Please follow the installation instruction and execute the following JS code:
var UberApi = require('uber-api');
var api = new UberApi.EstimatesApi()
var startLatitude = 1.2; // {Number} Latitude component of start location.
var startLongitude = 1.2; // {Number} Longitude component of start location.
var endLatitude = 1.2; // {Number} Latitude component of end location.
var endLongitude = 1.2; // {Number} Longitude component of end location.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.estimatesPriceGet(startLatitude, startLongitude, endLatitude, endLongitude, callback);
Documentation for API Endpoints
All URIs are relative to https://api.uber.com/v1
Class | Method | HTTP request | Description |
---|---|---|---|
UberApi.EstimatesApi | estimatesPriceGet | GET /estimates/price | Price Estimates |
UberApi.EstimatesApi | estimatesTimeGet | GET /estimates/time | Time Estimates |
UberApi.ProductsApi | productsGet | GET /products | Product Types |
UberApi.UserApi | historyGet | GET /history | User Activity |
UberApi.UserApi | meGet | GET /me | User Profile |
Documentation for Models
- UberApi.Activities
- UberApi.Activity
- UberApi.Error
- UberApi.PriceEstimate
- UberApi.Product
- UberApi.Profile
Documentation for Authorization
All endpoints do not require authorization.