0.1.1 • Published 7 years ago

swappy-client v0.1.1

Weekly downloads
1
License
Apache-2.0
Repository
-
Last release
7 years ago

Swappy.com Node.js REST api client

JavaScript client for Swappy.com This is Swappy's REST API. See below for all available endpoints. This is an alpha version and might still be subject to change This SDK is automatically generated by the Swagger Codegen project:

##This is almost entirely generated, please use with caution

  • API version: 0.1.0
  • Package version: 0.1.1
  • Build date: 2016-12-09T16:59:59.629-05:00
  • Build package: class io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To install the client via NPM use

npm install swappy-client --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 SwappyRestApi = require('swappy_rest_api');

var defaultClient = SwappyRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth
defaultClient.authentications.oauth.accessToken = "YOUR ACCESS TOKEN";

var api = new SwappyRestApi.OauthApi();

api.getMe({}, function(error, data, response) {
    if (error) {
        return console.error(error);
    }
    console.log('Hello, you name is', data.first_name, data.last_name);
});

Documentation for API Endpoints

All URIs are relative to https://api.swappy.com/

ClassMethodHTTP requestDescription
SwappyRestApi.BulkApicreateBulkJobPOST /v1/bulkjobs
SwappyRestApi.BulkApigetBulkJobGET /v1/bulkjobs/{id}
SwappyRestApi.BulkApigetBulkJobResultGET /v1/bulkjobs/{id}/results
SwappyRestApi.DataApigetCategoriesGET /v1/categories
SwappyRestApi.DataApigetCategoryGET /v1/categories/{id}
SwappyRestApi.DataApigetDurationsGET /v1/durations
SwappyRestApi.DataApigetOptionsGET /v1/options
SwappyRestApi.DataApigetShippingMethodsGET /v1/shippingmethods
SwappyRestApi.MiscApigetSoftwareVersionGET /v1/version
SwappyRestApi.OauthApigetMeGET /v1/me
SwappyRestApi.OauthApigetMyAddressesGET /v1/me/addresses
SwappyRestApi.OauthApioauth2AuthorizeGetGET /oauth2/authorize
SwappyRestApi.OauthApioauth2TokenPostPOST /oauth2/token
SwappyRestApi.ProductsApicreateProductPOST /v1/products
SwappyRestApi.ProductsApiendProductDELETE /v1/products/{id}
SwappyRestApi.ProductsApigetProductGET /v1/products/{id}
SwappyRestApi.ProductsApiupdateProductPATCH /v1/products/{id}
SwappyRestApi.ProductsApiuploadPicturePOST /v1/pictures

Documentation for Models

Documentation for Authorization

oauth

  • Type: OAuth
  • Flow: implicit
  • Authorization URL: https://api.swappy.com/oauth2/authorize
  • Scopes:
    • buy: Manage your purchases
    • sell: Create and manage your products
    • email: View you email address
    • addresses: Manage your postal adresses