All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| campaigns_automation_by_name_trigger_post | POST /campaigns/automation/{name}/trigger | Trigger Automation for Contact |
| campaigns_by_name_delete | DELETE /campaigns/{name} | Delete Campaign |
| campaigns_by_name_get | GET /campaigns/{name} | Load Campaign |
| campaigns_by_name_pause_put | PUT /campaigns/{name}/pause | Pause Campaign |
| campaigns_by_name_put | PUT /campaigns/{name} | Update Campaign |
| campaigns_get | GET /campaigns | Load Campaigns |
| campaigns_post | POST /campaigns | Add Campaign |
campaigns_automation_by_name_trigger_post(name, contact_email)
Trigger Automation for Contact
Manually trigger an Automation for a contact. Required Access Level: ModifyAutomations
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = '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['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::CampaignsApi.new
name = 'name_example' # String |
contact_email = 'contact_email_example' # String |
begin
# Trigger Automation for Contact
api_instance.campaigns_automation_by_name_trigger_post(name, contact_email)
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_automation_by_name_trigger_post: #{e}"
endThis returns an Array which contains the response data (nil in this case), status code and headers.
<Array(nil, Integer, Hash)> campaigns_automation_by_name_trigger_post_with_http_info(name, contact_email)
begin
# Trigger Automation for Contact
data, status_code, headers = api_instance.campaigns_automation_by_name_trigger_post_with_http_info(name, contact_email)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_automation_by_name_trigger_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | ||
| contact_email | String |
nil (empty response body)
- Content-Type: Not defined
- Accept: Not defined
campaigns_by_name_delete(name)
Delete Campaign
Delete the specific campaign. This does not cancel in progress email, see Cancel In Progress. Required Access Level: ModifyCampaigns
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = '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['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::CampaignsApi.new
name = 'name_example' # String | Name of Campaign to delete
begin
# Delete Campaign
api_instance.campaigns_by_name_delete(name)
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_by_name_delete: #{e}"
endThis returns an Array which contains the response data (nil in this case), status code and headers.
<Array(nil, Integer, Hash)> campaigns_by_name_delete_with_http_info(name)
begin
# Delete Campaign
data, status_code, headers = api_instance.campaigns_by_name_delete_with_http_info(name)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_by_name_delete_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | Name of Campaign to delete |
nil (empty response body)
- Content-Type: Not defined
- Accept: Not defined
campaigns_by_name_get(name)
Load Campaign
Returns the specified campaign details. Required Access Level: ViewCampaigns
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = '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['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::CampaignsApi.new
name = 'name_example' # String | Name of Campaign to get
begin
# Load Campaign
result = api_instance.campaigns_by_name_get(name)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_by_name_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> campaigns_by_name_get_with_http_info(name)
begin
# Load Campaign
data, status_code, headers = api_instance.campaigns_by_name_get_with_http_info(name)
p status_code # => 2xx
p headers # => { ... }
p data # => <Campaign>
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_by_name_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | Name of Campaign to get |
- Content-Type: Not defined
- Accept: application/json
campaigns_by_name_pause_put(name)
Pause Campaign
Pauses the specific campaign, cancelling emails that are waiting to be sent. Required Access Level: ModifyCampaigns
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = '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['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::CampaignsApi.new
name = 'name_example' # String | Name of Campaign to pause
begin
# Pause Campaign
api_instance.campaigns_by_name_pause_put(name)
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_by_name_pause_put: #{e}"
endThis returns an Array which contains the response data (nil in this case), status code and headers.
<Array(nil, Integer, Hash)> campaigns_by_name_pause_put_with_http_info(name)
begin
# Pause Campaign
data, status_code, headers = api_instance.campaigns_by_name_pause_put_with_http_info(name)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_by_name_pause_put_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | Name of Campaign to pause |
nil (empty response body)
- Content-Type: Not defined
- Accept: Not defined
campaigns_by_name_put(name, campaign)
Update Campaign
Updates a previously added campaign. Only Active and Paused campaigns can be updated. Required Access Level: ModifyCampaigns
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = '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['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::CampaignsApi.new
name = 'name_example' # String | Name of Campaign to update
campaign = ElasticEmail::Campaign.new({name: 'name_example', recipients: ElasticEmail::CampaignRecipient.new}) # Campaign | JSON representation of a campaign
begin
# Update Campaign
result = api_instance.campaigns_by_name_put(name, campaign)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_by_name_put: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> campaigns_by_name_put_with_http_info(name, campaign)
begin
# Update Campaign
data, status_code, headers = api_instance.campaigns_by_name_put_with_http_info(name, campaign)
p status_code # => 2xx
p headers # => { ... }
p data # => <Campaign>
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_by_name_put_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | Name of Campaign to update | |
| campaign | Campaign | JSON representation of a campaign |
- Content-Type: application/json
- Accept: application/json
<Array> campaigns_get(opts)
Load Campaigns
Returns a list all of your campaigns. Limited to 1000 results. Required Access Level: ViewCampaigns
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = '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['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::CampaignsApi.new
opts = {
search: 'search_example', # String | Text fragment used for searching in Campaign name (using the 'contains' rule)
offset: 20, # Integer | How many items should be returned ahead.
limit: 100 # Integer | Maximum number of returned items.
}
begin
# Load Campaigns
result = api_instance.campaigns_get(opts)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(<Array>, Integer, Hash)> campaigns_get_with_http_info(opts)
begin
# Load Campaigns
data, status_code, headers = api_instance.campaigns_get_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <Array<Campaign>>
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| search | String | Text fragment used for searching in Campaign name (using the 'contains' rule) | [optional] |
| offset | Integer | How many items should be returned ahead. | [optional] |
| limit | Integer | Maximum number of returned items. | [optional] |
- Content-Type: Not defined
- Accept: application/json
campaigns_post(campaign)
Add Campaign
Add a campaign for processing. Required Access Level: ModifyCampaigns
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = '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['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::CampaignsApi.new
campaign = ElasticEmail::Campaign.new({name: 'name_example', recipients: ElasticEmail::CampaignRecipient.new}) # Campaign | JSON representation of a campaign
begin
# Add Campaign
result = api_instance.campaigns_post(campaign)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> campaigns_post_with_http_info(campaign)
begin
# Add Campaign
data, status_code, headers = api_instance.campaigns_post_with_http_info(campaign)
p status_code # => 2xx
p headers # => { ... }
p data # => <Campaign>
rescue ElasticEmail::ApiError => e
puts "Error when calling CampaignsApi->campaigns_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| campaign | Campaign | JSON representation of a campaign |
- Content-Type: application/json
- Accept: application/json