Skip to content

Latest commit

 

History

History
356 lines (249 loc) · 9.24 KB

SendersApi.md

File metadata and controls

356 lines (249 loc) · 9.24 KB

SibApiV3Sdk::SendersApi

All URIs are relative to https://api.sendinblue.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

create_sender

CreateSenderModel create_sender(opts)

Create a new sender

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::SendersApi.new

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

begin
  #Create a new sender
  result = api_instance.create_sender(opts)
  p result
rescue SibApiV3Sdk::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 '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::SendersApi.new

sender_id = 789 # Integer | Id of the sender


begin
  #Delete a sender
  api_instance.delete_sender(sender_id)
rescue SibApiV3Sdk::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 '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::SendersApi.new

begin
  #Get all the dedicated IPs for your account
  result = api_instance.get_ips
  p result
rescue SibApiV3Sdk::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 '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::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 SibApiV3Sdk::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 '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::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 SibApiV3Sdk::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 '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::SendersApi.new

sender_id = 789 # Integer | Id of the sender

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

begin
  #Update a sender
  api_instance.update_sender(sender_id, opts)
rescue SibApiV3Sdk::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