All URIs are relative to https://api.sendinblue.com/v3
Method | HTTP request | Description |
---|---|---|
add_contact_to_list | POST /contacts/lists/{listId}/contacts/add | Add existing contacts to a list |
create_attribute | POST /contacts/attributes/{attributeCategory}/{attributeName} | Creates contact attribute |
create_contact | POST /contacts | Create a contact |
create_folder | POST /contacts/folders | Create a folder |
create_list | POST /contacts/lists | Create a list |
delete_attribute | DELETE /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute |
delete_contact | DELETE /contacts/{email} | Deletes a contact |
delete_folder | DELETE /contacts/folders/{folderId} | Delete a folder (and all its lists) |
delete_list | DELETE /contacts/lists/{listId} | Delete a list |
get_attributes | GET /contacts/attributes | Lists all attributes |
get_contact_info | GET /contacts/{email} | Retrieves contact informations |
get_contact_stats | GET /contacts/{email}/campaignStats | Get the campaigns statistics for a contact |
get_contacts | GET /contacts | Get all the contacts |
get_contacts_from_list | GET /contacts/lists/{listId}/contacts | Get the contacts in a list |
get_folder | GET /contacts/folders/{folderId} | Returns folder details |
get_folder_lists | GET /contacts/folders/{folderId}/lists | Get the lists in a folder |
get_folders | GET /contacts/folders | Get all the folders |
get_list | GET /contacts/lists/{listId} | Get the details of a list |
get_lists | GET /contacts/lists | Get all the lists |
import_contacts | POST /contacts/import | Import contacts |
remove_contact_from_list | POST /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list |
request_contact_export | POST /contacts/export | Export contacts |
update_attribute | PUT /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute |
update_contact | PUT /contacts/{email} | Updates a contact |
update_folder | PUT /contacts/folders/{folderId} | Update a contact folder |
update_list | PUT /contacts/lists/{listId} | Update a list |
PostContactInfo add_contact_to_list(list_id, contact_emails)
Add existing contacts to a list
# 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::ContactsApi.new
list_id = 789 # Integer | Id of the list
contact_emails = SibApiV3Sdk::AddContactToList.new # AddContactToList | Emails addresses of the contacts
begin
#Add existing contacts to a list
result = api_instance.add_contact_to_list(list_id, contact_emails)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->add_contact_to_list: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
list_id | Integer | Id of the list | |
contact_emails | AddContactToList | Emails addresses of the contacts |
- Content-Type: application/json
- Accept: application/json
create_attribute(attribute_category, attribute_name, create_attribute)
Creates contact attribute
# 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::ContactsApi.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 ContactsApi->create_attribute: #{e}"
end
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 |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
CreateUpdateContactModel create_contact(create_contact)
Create a contact
# 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::ContactsApi.new
create_contact = SibApiV3Sdk::CreateContact.new # CreateContact | Values to create a contact
begin
#Create a contact
result = api_instance.create_contact(create_contact)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->create_contact: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
create_contact | CreateContact | Values to create a contact |
- Content-Type: application/json
- Accept: application/json
CreateModel create_folder(create_folder)
Create a folder
# 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::ContactsApi.new
create_folder = SibApiV3Sdk::CreateUpdateFolder.new # CreateUpdateFolder | Name of the folder
begin
#Create a folder
result = api_instance.create_folder(create_folder)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->create_folder: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
create_folder | CreateUpdateFolder | Name of the folder |
- Content-Type: application/json
- Accept: application/json
CreateModel create_list(create_list)
Create a list
# 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::ContactsApi.new
create_list = SibApiV3Sdk::CreateList.new # CreateList | Values to create a list
begin
#Create a list
result = api_instance.create_list(create_list)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->create_list: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
create_list | CreateList | Values to create a list |
- Content-Type: application/json
- Accept: application/json
delete_attribute(attribute_category, attribute_name)
Deletes an attribute
# 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::ContactsApi.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 ContactsApi->delete_attribute: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
attribute_category | String | Category of the attribute | |
attribute_name | String | Name of the existing attribute |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
delete_contact(email)
Deletes a contact
# 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::ContactsApi.new
email = "email_example" # String | Email (urlencoded) of the contact
begin
#Deletes a contact
api_instance.delete_contact(email)
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->delete_contact: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
String | Email (urlencoded) of the contact |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
delete_folder(folder_id)
Delete a folder (and all its lists)
# 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::ContactsApi.new
folder_id = 789 # Integer | Id of the folder
begin
#Delete a folder (and all its lists)
api_instance.delete_folder(folder_id)
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->delete_folder: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
folder_id | Integer | Id of the folder |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
delete_list(list_id)
Delete a list
# 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::ContactsApi.new
list_id = 789 # Integer | Id of the list
begin
#Delete a list
api_instance.delete_list(list_id)
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->delete_list: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
list_id | Integer | Id of the list |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
GetAttributes get_attributes
Lists all attributes
# 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::ContactsApi.new
begin
#Lists all attributes
result = api_instance.get_attributes
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->get_attributes: #{e}"
end
This endpoint does not need any parameter.
- Content-Type: application/json
- Accept: application/json
GetExtendedContactDetails get_contact_info(email)
Retrieves contact informations
# 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::ContactsApi.new
email = "email_example" # String | Email (urlencoded) of the contact OR its SMS attribute value
begin
#Retrieves contact informations
result = api_instance.get_contact_info(email)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->get_contact_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
String | Email (urlencoded) of the contact OR its SMS attribute value |
- Content-Type: application/json
- Accept: application/json
GetContactCampaignStats get_contact_stats(email)
Get the campaigns statistics for a contact
# 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::ContactsApi.new
email = "email_example" # String | Email address (urlencoded) of the contact
begin
#Get the campaigns statistics for a contact
result = api_instance.get_contact_stats(email)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->get_contact_stats: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
String | Email address (urlencoded) of the contact |
- Content-Type: application/json
- Accept: application/json
GetContacts get_contacts(opts)
Get all the contacts
# 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::ContactsApi.new
opts = {
limit: 50, # Integer | Number of documents per page
offset: 0, # Integer | Index of the first document of the page
modified_since: DateTime.parse("2013-10-20T19:20:30+01:00") # DateTime | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
}
begin
#Get all the contacts
result = api_instance.get_contacts(opts)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->get_contacts: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
limit | Integer | Number of documents per page | [optional] [default to 50] |
offset | Integer | Index of the first document of the page | [optional] [default to 0] |
modified_since | DateTime | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] |
- Content-Type: application/json
- Accept: application/json
GetContacts get_contacts_from_list(list_id, opts)
Get the contacts in a list
# 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::ContactsApi.new
list_id = 789 # Integer | Id of the list
opts = {
modified_since: DateTime.parse("2013-10-20T19:20:30+01:00"), # DateTime | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
limit: 50, # Integer | Number of documents per page
offset: 0 # Integer | Index of the first document of the page
}
begin
#Get the contacts in a list
result = api_instance.get_contacts_from_list(list_id, opts)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->get_contacts_from_list: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
list_id | Integer | Id of the list | |
modified_since | DateTime | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] |
limit | Integer | Number of documents per page | [optional] [default to 50] |
offset | Integer | Index of the first document of the page | [optional] [default to 0] |
- Content-Type: application/json
- Accept: application/json
GetFolder get_folder(folder_id)
Returns folder details
# 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::ContactsApi.new
folder_id = 789 # Integer | id of the folder
begin
#Returns folder details
result = api_instance.get_folder(folder_id)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->get_folder: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
folder_id | Integer | id of the folder |
- Content-Type: application/json
- Accept: application/json
GetFolderLists get_folder_lists(folder_id, opts)
Get the lists in a folder
# 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::ContactsApi.new
folder_id = 789 # Integer | Id of the folder
opts = {
limit: 10, # Integer | Number of documents per page
offset: 0 # Integer | Index of the first document of the page
}
begin
#Get the lists in a folder
result = api_instance.get_folder_lists(folder_id, opts)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->get_folder_lists: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
folder_id | Integer | Id of the folder | |
limit | Integer | Number of documents per page | [optional] [default to 10] |
offset | Integer | Index of the first document of the page | [optional] [default to 0] |
- Content-Type: application/json
- Accept: application/json
GetFolders get_folders(limit, offset)
Get all the folders
# 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::ContactsApi.new
limit = 10 # Integer | Number of documents per page
offset = 0 # Integer | Index of the first document of the page
begin
#Get all the folders
result = api_instance.get_folders(limit, offset)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->get_folders: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
limit | Integer | Number of documents per page | [default to 10] |
offset | Integer | Index of the first document of the page | [default to 0] |
- Content-Type: application/json
- Accept: application/json
GetExtendedList get_list(list_id)
Get the details of a list
# 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::ContactsApi.new
list_id = 789 # Integer | Id of the list
begin
#Get the details of a list
result = api_instance.get_list(list_id)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->get_list: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
list_id | Integer | Id of the list |
- Content-Type: application/json
- Accept: application/json
GetLists get_lists(opts)
Get all the lists
# 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::ContactsApi.new
opts = {
limit: 10, # Integer | Number of documents per page
offset: 0 # Integer | Index of the first document of the page
}
begin
#Get all the lists
result = api_instance.get_lists(opts)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->get_lists: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
limit | Integer | Number of documents per page | [optional] [default to 10] |
offset | Integer | Index of the first document of the page | [optional] [default to 0] |
- Content-Type: application/json
- Accept: application/json
CreatedProcessId import_contacts(request_contact_import)
Import contacts
It returns the background process ID which on completion calls the notify URL that you have set in the input.
# 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::ContactsApi.new
request_contact_import = SibApiV3Sdk::RequestContactImport.new # RequestContactImport | Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns``
begin
#Import contacts
result = api_instance.import_contacts(request_contact_import)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->import_contacts: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
request_contact_import | RequestContactImport | Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` |
- Content-Type: application/json
- Accept: application/json
PostContactInfo remove_contact_from_list(list_id, contact_emails)
Remove existing contacts from a list
# 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::ContactsApi.new
list_id = 789 # Integer | Id of the list
contact_emails = SibApiV3Sdk::RemoveContactFromList.new # RemoveContactFromList | Emails adresses of the contact
begin
#Remove existing contacts from a list
result = api_instance.remove_contact_from_list(list_id, contact_emails)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->remove_contact_from_list: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
list_id | Integer | Id of the list | |
contact_emails | RemoveContactFromList | Emails adresses of the contact |
- Content-Type: application/json
- Accept: application/json
CreatedProcessId request_contact_export(request_contact_export)
Export contacts
It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.
# 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::ContactsApi.new
request_contact_export = SibApiV3Sdk::RequestContactExport.new # RequestContactExport | Values to request a contact export
begin
#Export contacts
result = api_instance.request_contact_export(request_contact_export)
p result
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->request_contact_export: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
request_contact_export | RequestContactExport | Values to request a contact export |
- Content-Type: application/json
- Accept: application/json
update_attribute(attribute_category, attribute_name, update_attribute)
Updates contact attribute
# 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::ContactsApi.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 ContactsApi->update_attribute: #{e}"
end
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 |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
update_contact(email, update_contact)
Updates a contact
# 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::ContactsApi.new
email = "email_example" # String | Email (urlencoded) of the contact
update_contact = SibApiV3Sdk::UpdateContact.new # UpdateContact | Values to update a contact
begin
#Updates a contact
api_instance.update_contact(email, update_contact)
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->update_contact: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
String | Email (urlencoded) of the contact | ||
update_contact | UpdateContact | Values to update a contact |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
update_folder(folder_id, update_folder)
Update a contact folder
# 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::ContactsApi.new
folder_id = 789 # Integer | Id of the folder
update_folder = SibApiV3Sdk::CreateUpdateFolder.new # CreateUpdateFolder | Name of the folder
begin
#Update a contact folder
api_instance.update_folder(folder_id, update_folder)
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->update_folder: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
folder_id | Integer | Id of the folder | |
update_folder | CreateUpdateFolder | Name of the folder |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
update_list(list_id, update_list)
Update a list
# 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::ContactsApi.new
list_id = 789 # Integer | Id of the list
update_list = SibApiV3Sdk::UpdateList.new # UpdateList | Values to update a list
begin
#Update a list
api_instance.update_list(list_id, update_list)
rescue SibApiV3Sdk::ApiError => e
puts "Exception when calling ContactsApi->update_list: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
list_id | Integer | Id of the list | |
update_list | UpdateList | Values to update a list |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json