Skip to content

Files

Latest commit

 

History

History
611 lines (422 loc) · 18.9 KB

SMSCampaignsApi.md

File metadata and controls

611 lines (422 loc) · 18.9 KB

SibApiV3Sdk::SMSCampaignsApi

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

Method HTTP request Description
create_sms_campaign POST /smsCampaigns Creates an SMS campaign
delete_sms_campaign DELETE /smsCampaigns/{campaignId} Delete the SMS campaign
get_sms_campaign GET /smsCampaigns/{campaignId} Get an SMS campaign
get_sms_campaigns GET /smsCampaigns Returns the informations for all your created SMS campaigns
request_sms_recipient_export POST /smsCampaigns/{campaignId}/exportRecipients Exports the recipients of the specified campaign.
send_sms_campaign_now POST /smsCampaigns/{campaignId}/sendNow Send your SMS campaign immediately
send_sms_report POST /smsCampaigns/{campaignId}/sendReport Send report of SMS campaigns
send_test_sms POST /smsCampaigns/{campaignId}/sendTest Send an SMS
update_sms_campaign PUT /smsCampaigns/{campaignId} Updates an SMS campaign
update_sms_campaign_status PUT /smsCampaigns/{campaignId}/status Update the campaign status

create_sms_campaign

CreateModel create_sms_campaign(create_sms_campaign)

Creates an SMS campaign

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

create_sms_campaign = SibApiV3Sdk::CreateSmsCampaign.new # CreateSmsCampaign | Values to create an SMS Campaign


begin
  #Creates an SMS campaign
  result = api_instance.create_sms_campaign(create_sms_campaign)
  p result
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling SMSCampaignsApi->create_sms_campaign: #{e}"
end

Parameters

Name Type Description Notes
create_sms_campaign CreateSmsCampaign Values to create an SMS Campaign

Return type

CreateModel

Authorization

api-key, partner-key

HTTP request headers

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

delete_sms_campaign

delete_sms_campaign(campaign_id)

Delete the SMS campaign

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

campaign_id = 789 # Integer | id of the SMS campaign


begin
  #Delete the SMS campaign
  api_instance.delete_sms_campaign(campaign_id)
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling SMSCampaignsApi->delete_sms_campaign: #{e}"
end

Parameters

Name Type Description Notes
campaign_id Integer id of the SMS campaign

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

get_sms_campaign

GetSmsCampaign get_sms_campaign(campaign_id)

Get an SMS campaign

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

campaign_id = 789 # Integer | id of the SMS campaign


begin
  #Get an SMS campaign
  result = api_instance.get_sms_campaign(campaign_id)
  p result
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling SMSCampaignsApi->get_sms_campaign: #{e}"
end

Parameters

Name Type Description Notes
campaign_id Integer id of the SMS campaign

Return type

GetSmsCampaign

Authorization

api-key, partner-key

HTTP request headers

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

get_sms_campaigns

GetSmsCampaigns get_sms_campaigns(opts)

Returns the informations for all your created SMS campaigns

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

opts = { 
  status: "status_example", # String | Status of campaign.
  start_date: DateTime.parse("2013-10-20T19:20:30+01:00"), # DateTime | Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
  end_date: DateTime.parse("2013-10-20T19:20:30+01:00"), # DateTime | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
  limit: 500, # Integer | Number limitation for the result returned
  offset: 0 # Integer | Beginning point in the list to retrieve from.
}

begin
  #Returns the informations for all your created SMS campaigns
  result = api_instance.get_sms_campaigns(opts)
  p result
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling SMSCampaignsApi->get_sms_campaigns: #{e}"
end

Parameters

Name Type Description Notes
status String Status of campaign. [optional]
start_date DateTime Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) [optional]
end_date DateTime Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) [optional]
limit Integer Number limitation for the result returned [optional] [default to 500]
offset Integer Beginning point in the list to retrieve from. [optional] [default to 0]

Return type

GetSmsCampaigns

Authorization

api-key, partner-key

HTTP request headers

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

request_sms_recipient_export

CreatedProcessId request_sms_recipient_export(campaign_id, opts)

Exports the recipients of the specified campaign.

It returns the background process ID which on completion calls the notify URL that you have set in the input.

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

campaign_id = 789 # Integer | id of the campaign

opts = { 
  recipient_export: SibApiV3Sdk::RequestSmsRecipientExport.new # RequestSmsRecipientExport | Values to send for a recipient export request
}

begin
  #Exports the recipients of the specified campaign.
  result = api_instance.request_sms_recipient_export(campaign_id, opts)
  p result
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling SMSCampaignsApi->request_sms_recipient_export: #{e}"
end

Parameters

Name Type Description Notes
campaign_id Integer id of the campaign
recipient_export RequestSmsRecipientExport Values to send for a recipient export request [optional]

Return type

CreatedProcessId

Authorization

api-key, partner-key

HTTP request headers

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

send_sms_campaign_now

send_sms_campaign_now(campaign_id)

Send your SMS campaign immediately

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

campaign_id = 789 # Integer | id of the campaign


begin
  #Send your SMS campaign immediately
  api_instance.send_sms_campaign_now(campaign_id)
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling SMSCampaignsApi->send_sms_campaign_now: #{e}"
end

Parameters

Name Type Description Notes
campaign_id Integer id of the campaign

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

send_sms_report

send_sms_report(campaign_id, send_report)

Send report of SMS campaigns

Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.

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

campaign_id = 789 # Integer | id of the campaign

send_report = SibApiV3Sdk::SendReport.new # SendReport | Values for send a report


begin
  #Send report of SMS campaigns
  api_instance.send_sms_report(campaign_id, send_report)
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling SMSCampaignsApi->send_sms_report: #{e}"
end

Parameters

Name Type Description Notes
campaign_id Integer id of the campaign
send_report SendReport Values for send a report

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

send_test_sms

send_test_sms(campaign_id, phone_number)

Send an SMS

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

campaign_id = 789 # Integer | Id of the SMS campaign

phone_number = SibApiV3Sdk::SendTestSms.new # SendTestSms | Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted


begin
  #Send an SMS
  api_instance.send_test_sms(campaign_id, phone_number)
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling SMSCampaignsApi->send_test_sms: #{e}"
end

Parameters

Name Type Description Notes
campaign_id Integer Id of the SMS campaign
phone_number SendTestSms Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

update_sms_campaign

update_sms_campaign(campaign_id, update_sms_campaign)

Updates an SMS campaign

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

campaign_id = 789 # Integer | id of the SMS campaign

update_sms_campaign = SibApiV3Sdk::UpdateSmsCampaign.new # UpdateSmsCampaign | Values to update an SMS Campaign


begin
  #Updates an SMS campaign
  api_instance.update_sms_campaign(campaign_id, update_sms_campaign)
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling SMSCampaignsApi->update_sms_campaign: #{e}"
end

Parameters

Name Type Description Notes
campaign_id Integer id of the SMS campaign
update_sms_campaign UpdateSmsCampaign Values to update an SMS Campaign

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

update_sms_campaign_status

update_sms_campaign_status(campaign_id, status)

Update the campaign status

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

campaign_id = 789 # Integer | id of the campaign

status = SibApiV3Sdk::UpdateCampaignStatus.new # UpdateCampaignStatus | Status of the campaign.


begin
  #Update the campaign status
  api_instance.update_sms_campaign_status(campaign_id, status)
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling SMSCampaignsApi->update_sms_campaign_status: #{e}"
end

Parameters

Name Type Description Notes
campaign_id Integer id of the campaign
status UpdateCampaignStatus Status of the campaign.

Return type

nil (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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