Skip to content

Files

Latest commit

 

History

History
246 lines (168 loc) · 7.14 KB

AttributesApi.md

File metadata and controls

246 lines (168 loc) · 7.14 KB

SibApiV3Sdk::AttributesApi

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

Method HTTP request Description
create_attribute POST /contacts/attributes/{attributeCategory}/{attributeName} Creates contact attribute
delete_attribute DELETE /contacts/attributes/{attributeCategory}/{attributeName} Deletes an attribute
get_attributes GET /contacts/attributes Lists all attributes
update_attribute PUT /contacts/attributes/{attributeCategory}/{attributeName} Updates contact attribute

create_attribute

create_attribute(attribute_category, attribute_name, create_attribute)

Creates contact attribute

Example

# load the gem
require 'sib-api-v3-sdk'
# setup authorization
SibApiV3Sdk.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['api-key'] = 'Bearer'

  # Configure API key authorization: partner-key
  config.api_key['partner-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['partner-key'] = 'Bearer'
end

api_instance = SibApiV3Sdk::AttributesApi.new

attribute_category = "attribute_category_example" # String | Category of the attribute

attribute_name = "attribute_name_example" # String | Name of the attribute

create_attribute = SibApiV3Sdk::CreateAttribute.new # CreateAttribute | Values to create an attribute


begin
  #Creates contact attribute
  api_instance.create_attribute(attribute_category, attribute_name, create_attribute)
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling AttributesApi->create_attribute: #{e}"
end

Parameters

Name Type Description Notes
attribute_category String Category of the attribute
attribute_name String Name of the attribute
create_attribute CreateAttribute Values to create an attribute

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

delete_attribute

delete_attribute(attribute_category, attribute_name)

Deletes an attribute

Example

# load the gem
require 'sib-api-v3-sdk'
# setup authorization
SibApiV3Sdk.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['api-key'] = 'Bearer'

  # Configure API key authorization: partner-key
  config.api_key['partner-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['partner-key'] = 'Bearer'
end

api_instance = SibApiV3Sdk::AttributesApi.new

attribute_category = "attribute_category_example" # String | Category of the attribute

attribute_name = "attribute_name_example" # String | Name of the existing attribute


begin
  #Deletes an attribute
  api_instance.delete_attribute(attribute_category, attribute_name)
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling AttributesApi->delete_attribute: #{e}"
end

Parameters

Name Type Description Notes
attribute_category String Category of the attribute
attribute_name String Name of the existing attribute

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

get_attributes

GetAttributes get_attributes

Lists all attributes

Example

# load the gem
require 'sib-api-v3-sdk'
# setup authorization
SibApiV3Sdk.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['api-key'] = 'Bearer'

  # Configure API key authorization: partner-key
  config.api_key['partner-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['partner-key'] = 'Bearer'
end

api_instance = SibApiV3Sdk::AttributesApi.new

begin
  #Lists all attributes
  result = api_instance.get_attributes
  p result
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling AttributesApi->get_attributes: #{e}"
end

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

update_attribute

update_attribute(attribute_category, attribute_name, update_attribute)

Updates contact attribute

Example

# load the gem
require 'sib-api-v3-sdk'
# setup authorization
SibApiV3Sdk.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['api-key'] = 'Bearer'

  # Configure API key authorization: partner-key
  config.api_key['partner-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['partner-key'] = 'Bearer'
end

api_instance = SibApiV3Sdk::AttributesApi.new

attribute_category = "attribute_category_example" # String | Category of the attribute

attribute_name = "attribute_name_example" # String | Name of the existing attribute

update_attribute = SibApiV3Sdk::UpdateAttribute.new # UpdateAttribute | Values to update an attribute


begin
  #Updates contact attribute
  api_instance.update_attribute(attribute_category, attribute_name, update_attribute)
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling AttributesApi->update_attribute: #{e}"
end

Parameters

Name Type Description Notes
attribute_category String Category of the attribute
attribute_name String Name of the existing attribute
update_attribute UpdateAttribute Values to update an attribute

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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