Skip to content

Latest commit

 

History

History
237 lines (163 loc) · 7.39 KB

AttributesApi.md

File metadata and controls

237 lines (163 loc) · 7.39 KB

SibApiV3Sdk.AttributesApi

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

Method HTTP request Description
createAttribute POST /contacts/attributes/{attributeCategory}/{attributeName} Create contact attribute
deleteAttribute DELETE /contacts/attributes/{attributeCategory}/{attributeName} Delete an attribute
getAttributes GET /contacts/attributes List all attributes
updateAttribute PUT /contacts/attributes/{attributeCategory}/{attributeName} Update contact attribute

createAttribute

createAttribute(attributeCategory, attributeName, createAttribute)

Create 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';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.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, partner-key

HTTP request headers

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

deleteAttribute

deleteAttribute(attributeCategory, attributeName)

Delete 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';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.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, partner-key

HTTP request headers

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

getAttributes

GetAttributes getAttributes()

List 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';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.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, partner-key

HTTP request headers

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

updateAttribute

updateAttribute(attributeCategory, attributeName, updateAttribute)

Update 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';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.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, partner-key

HTTP request headers

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