Skip to content

Latest commit

 

History

History
287 lines (193 loc) · 7.86 KB

CategoriesApi.md

File metadata and controls

287 lines (193 loc) · 7.86 KB

FacestoreApi.CategoriesApi

All URIs are relative to https://api.facestore.local/v1

Method HTTP request Description
addCategories POST /categories
deleteCategoryById DELETE /categories/{id}/
getCategories GET /categories
getCategoryById GET /categories/{id}/
updateCategoryById PUT /categories/{id}/

addCategories

InlineResponse2011 addCategories(category)

Creates a new category in the store.

Example

import FacestoreApi from 'facestore_api';
let defaultClient = FacestoreApi.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
let APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix = 'Token';

let apiInstance = new FacestoreApi.CategoriesApi();

let category = new FacestoreApi.Category(); // Category | Category to add to the store


apiInstance.addCategories(category, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
category Category Category to add to the store

Return type

InlineResponse2011

Authorization

APIKeyHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteCategoryById

deleteCategoryById(id)

deletes a single category based on the ID supplied

Example

import FacestoreApi from 'facestore_api';
let defaultClient = FacestoreApi.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
let APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix = 'Token';

let apiInstance = new FacestoreApi.CategoriesApi();

let id = 789; // Number | ID of category to delete


apiInstance.deleteCategoryById(id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});

Parameters

Name Type Description Notes
id Number ID of category to delete

Return type

null (empty response body)

Authorization

APIKeyHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getCategories

InlineResponse2001 getCategories(opts)

Returns all categories from the system that the user has access to ### Includes You can give the following values on includes parameter: `routes, products`

Example

import FacestoreApi from 'facestore_api';
let defaultClient = FacestoreApi.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
let APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix = 'Token';

let apiInstance = new FacestoreApi.CategoriesApi();

let opts = { 
  'includes': ["includes_example"], // [String] | Include associated objects within response
  'limit': 56 // Number | max records to return
  'orderBy': ["orderBy_example"] // [String] | Specify the field to be sorted, examples:  - `?order_by=id|desc` - `?order_by=updated_at|desc,position|asc` 
};

apiInstance.getCategories(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
includes [String] Include associated objects within response [optional]
limit Number max records to return [optional]
orderBy [String] Specify the field to be sorted, examples: - `?order_by=id desc` - `?order_by=updated_at

Return type

InlineResponse2001

Authorization

APIKeyHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getCategoryById

InlineResponse2011 getCategoryById(id, opts)

Returns a category based on a single ID ### Includes You can give the following values on includes parameter: `routes, products`

Example

import FacestoreApi from 'facestore_api';
let defaultClient = FacestoreApi.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
let APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix = 'Token';

let apiInstance = new FacestoreApi.CategoriesApi();

let id = 789; // Number | ID of category to fetch

let opts = { 
  'includes': ["includes_example"], // [String] | Include associated objects within response
  'limit': 56 // Number | max records to return
};

apiInstance.getCategoryById(id, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
id Number ID of category to fetch
includes [String] Include associated objects within response [optional]
limit Number max records to return [optional]

Return type

InlineResponse2011

Authorization

APIKeyHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateCategoryById

updateCategoryById(id, category)

update a single category based on the ID supplied

Example

import FacestoreApi from 'facestore_api';
let defaultClient = FacestoreApi.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
let APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix = 'Token';

let apiInstance = new FacestoreApi.CategoriesApi();

let id = 789; // Number | ID of category to update

let category = null; // Object | Category to update in store


apiInstance.updateCategoryById(id, category, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});

Parameters

Name Type Description Notes
id Number ID of category to update
category Object Category to update in store

Return type

null (empty response body)

Authorization

APIKeyHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json