Skip to content

Latest commit

 

History

History
417 lines (292 loc) · 10.6 KB

SendersApi.md

File metadata and controls

417 lines (292 loc) · 10.6 KB

Brevo::SendersApi

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

Method HTTP request Description
create_sender POST /senders Create a new sender
delete_sender DELETE /senders/{senderId} Delete a sender
get_ips GET /senders/ips Get all the dedicated IPs for your account
get_ips_from_sender GET /senders/{senderId}/ips Get all the dedicated IPs for a sender
get_senders GET /senders Get the list of all your senders
update_sender PUT /senders/{senderId} Update a sender
validate_sender_by_otp PUT /senders/{senderId}/validate Update a sender

create_sender

CreateSenderModel create_sender(opts)

Create a new sender

Example

# load the gem
require 'brevo'
# setup authorization
Brevo.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 = Brevo::SendersApi.new

opts = { 
  sender: Brevo::CreateSender.new # CreateSender | sender's name
}

begin
  #Create a new sender
  result = api_instance.create_sender(opts)
  p result
rescue Brevo::ApiError => e
  puts "Exception when calling SendersApi->create_sender: #{e}"
end

Parameters

Name Type Description Notes
sender CreateSender sender's name [optional]

Return type

CreateSenderModel

Authorization

api-key, partner-key

HTTP request headers

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

delete_sender

delete_sender(sender_id)

Delete a sender

Example

# load the gem
require 'brevo'
# setup authorization
Brevo.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 = Brevo::SendersApi.new

sender_id = 789 # Integer | Id of the sender


begin
  #Delete a sender
  api_instance.delete_sender(sender_id)
rescue Brevo::ApiError => e
  puts "Exception when calling SendersApi->delete_sender: #{e}"
end

Parameters

Name Type Description Notes
sender_id Integer Id of the sender

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

get_ips

GetIps get_ips

Get all the dedicated IPs for your account

Example

# load the gem
require 'brevo'
# setup authorization
Brevo.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 = Brevo::SendersApi.new

begin
  #Get all the dedicated IPs for your account
  result = api_instance.get_ips
  p result
rescue Brevo::ApiError => e
  puts "Exception when calling SendersApi->get_ips: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

GetIps

Authorization

api-key, partner-key

HTTP request headers

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

get_ips_from_sender

GetIpsFromSender get_ips_from_sender(sender_id)

Get all the dedicated IPs for a sender

Example

# load the gem
require 'brevo'
# setup authorization
Brevo.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 = Brevo::SendersApi.new

sender_id = 789 # Integer | Id of the sender


begin
  #Get all the dedicated IPs for a sender
  result = api_instance.get_ips_from_sender(sender_id)
  p result
rescue Brevo::ApiError => e
  puts "Exception when calling SendersApi->get_ips_from_sender: #{e}"
end

Parameters

Name Type Description Notes
sender_id Integer Id of the sender

Return type

GetIpsFromSender

Authorization

api-key, partner-key

HTTP request headers

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

get_senders

GetSendersList get_senders(opts)

Get the list of all your senders

Example

# load the gem
require 'brevo'
# setup authorization
Brevo.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 = Brevo::SendersApi.new

opts = { 
  ip: 'ip_example', # String | Filter your senders for a specific ip (available for dedicated IP usage only)
  domain: 'domain_example' # String | Filter your senders for a specific domain
}

begin
  #Get the list of all your senders
  result = api_instance.get_senders(opts)
  p result
rescue Brevo::ApiError => e
  puts "Exception when calling SendersApi->get_senders: #{e}"
end

Parameters

Name Type Description Notes
ip String Filter your senders for a specific ip (available for dedicated IP usage only) [optional]
domain String Filter your senders for a specific domain [optional]

Return type

GetSendersList

Authorization

api-key, partner-key

HTTP request headers

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

update_sender

update_sender(sender_id, opts)

Update a sender

Example

# load the gem
require 'brevo'
# setup authorization
Brevo.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 = Brevo::SendersApi.new

sender_id = 789 # Integer | Id of the sender

opts = { 
  sender: Brevo::UpdateSender.new # UpdateSender | sender's name
}

begin
  #Update a sender
  api_instance.update_sender(sender_id, opts)
rescue Brevo::ApiError => e
  puts "Exception when calling SendersApi->update_sender: #{e}"
end

Parameters

Name Type Description Notes
sender_id Integer Id of the sender
sender UpdateSender sender's name [optional]

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

validate_sender_by_otp

validate_sender_by_otp(sender_id, opts)

Update a sender

Example

# load the gem
require 'brevo'
# setup authorization
Brevo.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 = Brevo::SendersApi.new

sender_id = 789 # Integer | Id of the sender

opts = { 
  otp: Brevo::Otp.new # Otp | otp
}

begin
  #Update a sender
  api_instance.validate_sender_by_otp(sender_id, opts)
rescue Brevo::ApiError => e
  puts "Exception when calling SendersApi->validate_sender_by_otp: #{e}"
end

Parameters

Name Type Description Notes
sender_id Integer Id of the sender
otp Otp otp [optional]

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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