Skip to content

Latest commit

 

History

History
228 lines (159 loc) · 6.97 KB

CategoryApi.md

File metadata and controls

228 lines (159 loc) · 6.97 KB

GeinsSdkApiMgmtJavascript.CategoryApi

All URIs are relative to https://mgmtapi.geins.io

Method HTTP request Description
createCategory POST /API/Category Create category
getCategory GET /API/Category/{id} Get category
queryCategories POST /API/Category/Query Query categories
updateCategory PUT /API/Category/{id} Update category

createCategory

EnvelopeCategoryModelsReadCategory createCategory(category)

Create category

Example

import GeinsSdkApiMgmtJavascript from '@geins/sdk-api-mgmt-javascript';
let defaultClient = GeinsSdkApiMgmtJavascript.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: basicAuth
let basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

let apiInstance = new GeinsSdkApiMgmtJavascript.CategoryApi();
let category = new GeinsSdkApiMgmtJavascript.CategoryModelsWriteCategory(); // CategoryModelsWriteCategory | The category to create.
apiInstance.createCategory(category, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
category CategoryModelsWriteCategory The category to create.

Return type

EnvelopeCategoryModelsReadCategory

Authorization

apiKey, basicAuth

HTTP request headers

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

getCategory

EnvelopeCategoryModelsReadCategory getCategory(id)

Get category

Example

import GeinsSdkApiMgmtJavascript from '@geins/sdk-api-mgmt-javascript';
let defaultClient = GeinsSdkApiMgmtJavascript.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: basicAuth
let basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

let apiInstance = new GeinsSdkApiMgmtJavascript.CategoryApi();
let id = 56; // Number | The id of the category to get.
apiInstance.getCategory(id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
id Number The id of the category to get.

Return type

EnvelopeCategoryModelsReadCategory

Authorization

apiKey, basicAuth

HTTP request headers

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

queryCategories

[CategoryModelsReadCategory] queryCategories(query)

Query categories

Example

import GeinsSdkApiMgmtJavascript from '@geins/sdk-api-mgmt-javascript';
let defaultClient = GeinsSdkApiMgmtJavascript.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: basicAuth
let basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

let apiInstance = new GeinsSdkApiMgmtJavascript.CategoryApi();
let query = new GeinsSdkApiMgmtJavascript.CategoryModelsCategoryQuery(); // CategoryModelsCategoryQuery | The query to filter categories by.
apiInstance.queryCategories(query, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
query CategoryModelsCategoryQuery The query to filter categories by.

Return type

[CategoryModelsReadCategory]

Authorization

apiKey, basicAuth

HTTP request headers

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

updateCategory

EnvelopeCategoryModelsReadCategory updateCategory(id, category)

Update category

Leaving out a property will ensure no changes are made to that property. Collection properties will delete and/or add as necessary to match the supplied data.

Example

import GeinsSdkApiMgmtJavascript from '@geins/sdk-api-mgmt-javascript';
let defaultClient = GeinsSdkApiMgmtJavascript.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: basicAuth
let basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

let apiInstance = new GeinsSdkApiMgmtJavascript.CategoryApi();
let id = 56; // Number | The id of the category to update.
let category = new GeinsSdkApiMgmtJavascript.CategoryModelsWriteCategory(); // CategoryModelsWriteCategory | The category data to update.
apiInstance.updateCategory(id, category, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
id Number The id of the category to update.
category CategoryModelsWriteCategory The category data to update.

Return type

EnvelopeCategoryModelsReadCategory

Authorization

apiKey, basicAuth

HTTP request headers

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