npm.io
1.0.0 • Published 9 years ago

flatties_api

Licence
Apache-2.0
Version
1.0.0
Deps
1
Vulns
1
Weekly
0

flatties_api

FlattiesApi - JavaScript client for flatties_api Flatties services. This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0-rc1
  • Package version: 1.0.0-rc1
  • Build date: 2016-10-21T2239.468Z
  • Build package: class io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install flatties_api --save
git

If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/flatties_api then install it via:

    npm install YOUR_USERNAME/flatties_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 FlattiesApi = require('flatties_api');

var defaultClient = FlattiesApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: flatties_auth
var flatties_auth = defaultClient.authentications['flatties_auth'];
flatties_auth.accessToken = "YOUR ACCESS TOKEN"

var api = new FlattiesApi.ListingApi()

var opts = { 
  'limit': 56, // {Integer} An optional number listings that are returned in each page. If zero or less, a default limit is used. Note that this is an upper limit. If there are not enough listings remaining in the list, then fewer will be returned.
  'start': "start_example" // {String} An optional cursor that points to the starting page of data. Typically obtained from a previous call.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAllListings(opts, callback);

Documentation for API Endpoints

All URIs are relative to https://endpoints-dot-flatties-test01.appspot.com/v1

Class Method HTTP request Description
FlattiesApi.ListingApi getAllListings GET /listings/all Get all listings.
FlattiesApi.ListingApi getListing GET /listings/{listingId} Get listing details.
FlattiesApi.ListingApi getListings GET /listings Get listings in the vicinity of the specified location.
FlattiesApi.ListingApi getListingsByTileKey GET /listings/byTileKey Get listings in the tile represented by the specified tile key.
FlattiesApi.ListingApi removeListing DELETE /listings/{listingId} Delete a listing.
FlattiesApi.ListingApi updateListing PUT /listings/{listingId} Update an existing listing.
FlattiesApi.UserApi addListing POST /user/{userId}/listings Add a new listing to the user's listings.
FlattiesApi.UserApi getTestUsers GET /users/test Get a list of test users.
FlattiesApi.UserApi getUser GET /user/me User profile
FlattiesApi.UserApi getUserListings GET /user/{userId}/listings Get a user's listings.
FlattiesApi.UserApi loginUser POST /user/login Login a user and add the user if new.

Documentation for Models

Documentation for Authorization

flatties_auth
  • Type: OAuth
  • Flow: implicit
  • Authorization URL: Not used
  • Scopes:
    • apptank: Perform actions on behalf of the Apptank organization.
    • user: Perform actions on behalf of an individual user.