All URIs are relative to https://api.swappy.com/
| Method | HTTP request | Description |
|---|---|---|
| getCategories | GET /v1/categories | |
| getCategory | GET /v1/categories/{id} | |
| getDurations | GET /v1/durations | |
| getOptions | GET /v1/options | |
| getShippingMethods | GET /v1/shippingmethods |
[Category] getCategories(opts)
Get all categories from the website
var SwappyRestApi = require('swappy_rest_api');
var defaultClient = SwappyRestApi.ApiClient.default;
// Configure OAuth2 access token for authorization: oauth
var oauth = defaultClient.authentications['oauth'];
oauth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwappyRestApi.DataApi();
var opts = {
'depth': 56, // Integer | Number sublevels wanted, `1` for top level only. **default:** no limit
'ifNoneMatch': "ifNoneMatch_example", // String | Etag, will return `304 Not Modified` if content hasn't changed
'ifModifiedSince': new Date("2013-10-20T19:20:30+01:00"), // Date | Will return `304 Not Modified` if content hasn't changed
'language': "language_example" // String | Language for the response
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getCategories(opts, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| depth | Integer | Number sublevels wanted, `1` for top level only. default: no limit | [optional] |
| ifNoneMatch | String | Etag, will return `304 Not Modified` if content hasn't changed | [optional] |
| ifModifiedSince | Date | Will return `304 Not Modified` if content hasn't changed | [optional] |
| language | String | Language for the response | [optional] |
- Content-Type: application/json
- Accept: application/json
Category getCategory(id, opts)
Get one category categories from the website
var SwappyRestApi = require('swappy_rest_api');
var defaultClient = SwappyRestApi.ApiClient.default;
// Configure OAuth2 access token for authorization: oauth
var oauth = defaultClient.authentications['oauth'];
oauth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwappyRestApi.DataApi();
var id = 56; // Integer | Product ID
var opts = {
'ifNoneMatch': "ifNoneMatch_example", // String | Etag, will return `304 Not Modified` if content hasn't changed
'ifModifiedSince': new Date("2013-10-20T19:20:30+01:00"), // Date | Will return `304 Not Modified` if content hasn't changed
'language': "language_example" // String | Language for the response
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getCategory(id, opts, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| id | Integer | Product ID | |
| ifNoneMatch | String | Etag, will return `304 Not Modified` if content hasn't changed | [optional] |
| ifModifiedSince | Date | Will return `304 Not Modified` if content hasn't changed | [optional] |
| language | String | Language for the response | [optional] |
- Content-Type: application/json
- Accept: application/json
InlineResponse200 getDurations(opts)
Get available durations
var SwappyRestApi = require('swappy_rest_api');
var defaultClient = SwappyRestApi.ApiClient.default;
// Configure OAuth2 access token for authorization: oauth
var oauth = defaultClient.authentications['oauth'];
oauth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwappyRestApi.DataApi();
var opts = {
'ifNoneMatch': "ifNoneMatch_example", // String | Etag, will return `304 Not Modified` if content hasn't changed
'ifModifiedSince': new Date("2013-10-20T19:20:30+01:00"), // Date | Will return `304 Not Modified` if content hasn't changed
'language': "language_example" // String | Language for the response
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getDurations(opts, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| ifNoneMatch | String | Etag, will return `304 Not Modified` if content hasn't changed | [optional] |
| ifModifiedSince | Date | Will return `304 Not Modified` if content hasn't changed | [optional] |
| language | String | Language for the response | [optional] |
- Content-Type: application/json
- Accept: application/json
[Option] getOptions(opts)
Get paying options for a product
var SwappyRestApi = require('swappy_rest_api');
var defaultClient = SwappyRestApi.ApiClient.default;
// Configure OAuth2 access token for authorization: oauth
var oauth = defaultClient.authentications['oauth'];
oauth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwappyRestApi.DataApi();
var opts = {
'ifNoneMatch': "ifNoneMatch_example", // String | Etag, will return `304 Not Modified` if content hasn't changed
'ifModifiedSince': new Date("2013-10-20T19:20:30+01:00"), // Date | Will return `304 Not Modified` if content hasn't changed
'language': "language_example" // String | Language for the response
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getOptions(opts, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| ifNoneMatch | String | Etag, will return `304 Not Modified` if content hasn't changed | [optional] |
| ifModifiedSince | Date | Will return `304 Not Modified` if content hasn't changed | [optional] |
| language | String | Language for the response | [optional] |
- Content-Type: application/json
- Accept: application/json
[ShippingMethod] getShippingMethods(opts)
Get all shipping methods
var SwappyRestApi = require('swappy_rest_api');
var defaultClient = SwappyRestApi.ApiClient.default;
// Configure OAuth2 access token for authorization: oauth
var oauth = defaultClient.authentications['oauth'];
oauth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwappyRestApi.DataApi();
var opts = {
'ifNoneMatch': "ifNoneMatch_example", // String | Etag, will return `304 Not Modified` if content hasn't changed
'ifModifiedSince': new Date("2013-10-20T19:20:30+01:00"), // Date | Will return `304 Not Modified` if content hasn't changed
'language': "language_example" // String | Language for the response
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getShippingMethods(opts, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| ifNoneMatch | String | Etag, will return `304 Not Modified` if content hasn't changed | [optional] |
| ifModifiedSince | Date | Will return `304 Not Modified` if content hasn't changed | [optional] |
| language | String | Language for the response | [optional] |
- Content-Type: application/json
- Accept: application/json