Skip to content

Latest commit

 

History

History
269 lines (175 loc) · 6.37 KB

File metadata and controls

269 lines (175 loc) · 6.37 KB

sendx.TagApi

All URIs are relative to https://api.sendx.io/api/v1/rest

Method HTTP request Description
createTag POST /tag Create tag
deleteTag DELETE /tag/{identifier} Delete tag
getAllTags GET /tag Get all tags
getTag GET /tag/{identifier} Get tag by ID
updateTag PUT /tag/{identifier} Update tag

createTag

RestRTag createTag(restETag)

Create tag

Creates a new tag for contact categorization.

Example

import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';

let apiInstance = new sendx.TagApi();
let restETag = {"name":"VIP Customer"}; // RestETag | 
apiInstance.createTag(restETag).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
restETag RestETag

Return type

RestRTag

Authorization

TeamApiKey

HTTP request headers

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

deleteTag

DeleteResponse deleteTag(identifier)

Delete tag

Deletes a tag from the system.

Example

import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';

let apiInstance = new sendx.TagApi();
let identifier = "identifier_example"; // String | Tag identifier to update
apiInstance.deleteTag(identifier).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
identifier String Tag identifier to update

Return type

DeleteResponse

Authorization

TeamApiKey

HTTP request headers

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

getAllTags

[RestRTag] getAllTags(opts)

Get all tags

Retrieves all tags in your team.

Example

import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';

let apiInstance = new sendx.TagApi();
let opts = {
  'offset': 0, // Number | Number of tags to skip
  'limit': 10 // Number | Maximum number of tags to return
};
apiInstance.getAllTags(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
offset Number Number of tags to skip [optional] [default to 0]
limit Number Maximum number of tags to return [optional] [default to 10]

Return type

[RestRTag]

Authorization

TeamApiKey

HTTP request headers

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

getTag

RestRTag getTag(identifier)

Get tag by ID

Retrieves detailed information about a specific tag.

Example

import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';

let apiInstance = new sendx.TagApi();
let identifier = "identifier_example"; // String | Tag identifier to retrieve
apiInstance.getTag(identifier).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
identifier String Tag identifier to retrieve

Return type

RestRTag

Authorization

TeamApiKey

HTTP request headers

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

updateTag

RestRTag updateTag(restETag, identifier)

Update tag

Updates an existing tag's name.

Example

import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';

let apiInstance = new sendx.TagApi();
let restETag = new sendx.RestETag(); // RestETag | 
let identifier = "identifier_example"; // String | Tag identifier to update
apiInstance.updateTag(restETag, identifier).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
restETag RestETag
identifier String Tag identifier to update

Return type

RestRTag

Authorization

TeamApiKey

HTTP request headers

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