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
For Node.js
To install the client via NPM use
npm install swappy-client --save
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.
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);
});
All URIs are relative to https://api.swappy.com/
Class | Method | HTTP request | Description |
---|---|---|---|
SwappyRestApi.BulkApi | createBulkJob | POST /v1/bulkjobs | |
SwappyRestApi.BulkApi | getBulkJob | GET /v1/bulkjobs/{id} | |
SwappyRestApi.BulkApi | getBulkJobResult | GET /v1/bulkjobs/{id}/results | |
SwappyRestApi.DataApi | getCategories | GET /v1/categories | |
SwappyRestApi.DataApi | getCategory | GET /v1/categories/{id} | |
SwappyRestApi.DataApi | getDurations | GET /v1/durations | |
SwappyRestApi.DataApi | getOptions | GET /v1/options | |
SwappyRestApi.DataApi | getShippingMethods | GET /v1/shippingmethods | |
SwappyRestApi.MiscApi | getSoftwareVersion | GET /v1/version | |
SwappyRestApi.OauthApi | getMe | GET /v1/me | |
SwappyRestApi.OauthApi | getMyAddresses | GET /v1/me/addresses | |
SwappyRestApi.OauthApi | oauth2AuthorizeGet | GET /oauth2/authorize | |
SwappyRestApi.OauthApi | oauth2TokenPost | POST /oauth2/token | |
SwappyRestApi.ProductsApi | createProduct | POST /v1/products | |
SwappyRestApi.ProductsApi | endProduct | DELETE /v1/products/{id} | |
SwappyRestApi.ProductsApi | getProduct | GET /v1/products/{id} | |
SwappyRestApi.ProductsApi | updateProduct | PATCH /v1/products/{id} | |
SwappyRestApi.ProductsApi | uploadPicture | POST /v1/pictures |
- SwappyRestApi.Address
- SwappyRestApi.BulkJob
- SwappyRestApi.BulkJobResult
- SwappyRestApi.Category
- SwappyRestApi.Delivery
- SwappyRestApi.DeliveryType
- SwappyRestApi.Duration
- SwappyRestApi.Error
- SwappyRestApi.FieldError
- SwappyRestApi.InlineResponse200
- SwappyRestApi.InlineResponse2001
- SwappyRestApi.Live
- SwappyRestApi.Member
- SwappyRestApi.Option
- SwappyRestApi.Payment
- SwappyRestApi.Product
- SwappyRestApi.ProductBulkResponse
- SwappyRestApi.ProductEstimate
- SwappyRestApi.ProductImage
- SwappyRestApi.ProductOffer
- SwappyRestApi.ProductTaxes
- SwappyRestApi.ShippingMethod
- SwappyRestApi.ShortAddress
- SwappyRestApi.ShortMember
- SwappyRestApi.ShortProduct
- SwappyRestApi.ShortProductOffer
- SwappyRestApi.TempImage
- SwappyRestApi.ValidationError
- 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