Skip to content

Latest commit

 

History

History
213 lines (143 loc) · 6.13 KB

File metadata and controls

213 lines (143 loc) · 6.13 KB

SibApiV3Sdk.AttributesApi

All URIs are relative to https://api.sendinblue.com/v3

Method HTTP request Description
createAttribute POST /contacts/attributes/{attributeCategory}/{attributeName} Creates contact attribute
deleteAttribute DELETE /contacts/attributes/{attributeCategory}/{attributeName} Deletes an attribute
getAttributes GET /contacts/attributes Lists all attributes
updateAttribute PUT /contacts/attributes/{attributeCategory}/{attributeName} Updates contact attribute

createAttribute

createAttribute(attributeCategory, attributeName, createAttribute)

Creates contact attribute

Example

var SibApiV3Sdk = require('sib-api-v3-sdk');
var defaultClient = SibApiV3Sdk.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
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';

var apiInstance = new SibApiV3Sdk.AttributesApi();

var attributeCategory = "attributeCategory_example"; // String | Category of the attribute

var attributeName = "attributeName_example"; // String | Name of the attribute

var createAttribute = new SibApiV3Sdk.CreateAttribute(); // CreateAttribute | Values to create an attribute

apiInstance.createAttribute(attributeCategory, attributeName, createAttribute).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
attributeCategory String Category of the attribute
attributeName String Name of the attribute
createAttribute CreateAttribute Values to create an attribute

Return type

null (empty response body)

Authorization

api-key

HTTP request headers

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

deleteAttribute

deleteAttribute(attributeCategory, attributeName)

Deletes an attribute

Example

var SibApiV3Sdk = require('sib-api-v3-sdk');
var defaultClient = SibApiV3Sdk.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
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';

var apiInstance = new SibApiV3Sdk.AttributesApi();

var attributeCategory = "attributeCategory_example"; // String | Category of the attribute

var attributeName = "attributeName_example"; // String | Name of the existing attribute

apiInstance.deleteAttribute(attributeCategory, attributeName).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
attributeCategory String Category of the attribute
attributeName String Name of the existing attribute

Return type

null (empty response body)

Authorization

api-key

HTTP request headers

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

getAttributes

GetAttributes getAttributes()

Lists all attributes

Example

var SibApiV3Sdk = require('sib-api-v3-sdk');
var defaultClient = SibApiV3Sdk.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
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';

var apiInstance = new SibApiV3Sdk.AttributesApi();
apiInstance.getAttributes().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

GetAttributes

Authorization

api-key

HTTP request headers

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

updateAttribute

updateAttribute(attributeCategory, attributeName, updateAttribute)

Updates contact attribute

Example

var SibApiV3Sdk = require('sib-api-v3-sdk');
var defaultClient = SibApiV3Sdk.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
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';

var apiInstance = new SibApiV3Sdk.AttributesApi();

var attributeCategory = "attributeCategory_example"; // String | Category of the attribute

var attributeName = "attributeName_example"; // String | Name of the existing attribute

var updateAttribute = new SibApiV3Sdk.UpdateAttribute(); // UpdateAttribute | Values to update an attribute

apiInstance.updateAttribute(attributeCategory, attributeName, updateAttribute).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
attributeCategory String Category of the attribute
attributeName String Name of the existing attribute
updateAttribute UpdateAttribute Values to update an attribute

Return type

null (empty response body)

Authorization

api-key

HTTP request headers

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