All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| webhook_by_publicid_delete | DELETE /webhook/{publicid} | Delete Webhook |
| webhook_by_publicid_get | GET /webhook/{publicid} | Load Webhook |
| webhook_by_publicid_put | PUT /webhook/{publicid} | Update Webhook |
| webhook_get | GET /webhook | Load Webhooks |
| webhook_post | POST /webhook | Add Webhook |
webhook_by_publicid_delete(publicid)
Delete Webhook
Delete the specified notifications webhook. Required Access Level: ModifyWebNotifications
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::WebhookApi.new
publicid = 'publicid_example' # String |
begin
# Delete Webhook
api_instance.webhook_by_publicid_delete(publicid)
rescue ElasticEmail::ApiError => e
puts "Error when calling WebhookApi->webhook_by_publicid_delete: #{e}"
endThis returns an Array which contains the response data (nil in this case), status code and headers.
<Array(nil, Integer, Hash)> webhook_by_publicid_delete_with_http_info(publicid)
begin
# Delete Webhook
data, status_code, headers = api_instance.webhook_by_publicid_delete_with_http_info(publicid)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue ElasticEmail::ApiError => e
puts "Error when calling WebhookApi->webhook_by_publicid_delete_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| publicid | String |
nil (empty response body)
- Content-Type: Not defined
- Accept: Not defined
webhook_by_publicid_get(publicid)
Load Webhook
Load notifications webhook details. Required Access Level: ViewWebNotifications
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::WebhookApi.new
publicid = 'publicid_example' # String |
begin
# Load Webhook
result = api_instance.webhook_by_publicid_get(publicid)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling WebhookApi->webhook_by_publicid_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> webhook_by_publicid_get_with_http_info(publicid)
begin
# Load Webhook
data, status_code, headers = api_instance.webhook_by_publicid_get_with_http_info(publicid)
p status_code # => 2xx
p headers # => { ... }
p data # => <Webhook>
rescue ElasticEmail::ApiError => e
puts "Error when calling WebhookApi->webhook_by_publicid_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| publicid | String |
- Content-Type: Not defined
- Accept: application/json
webhook_by_publicid_put(publicid, webhook_update_payload)
Update Webhook
Update notification webhook. Required Access Level: ModifyWebNotifications
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::WebhookApi.new
publicid = 'publicid_example' # String |
webhook_update_payload = ElasticEmail::WebhookUpdatePayload.new # WebhookUpdatePayload |
begin
# Update Webhook
result = api_instance.webhook_by_publicid_put(publicid, webhook_update_payload)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling WebhookApi->webhook_by_publicid_put: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> webhook_by_publicid_put_with_http_info(publicid, webhook_update_payload)
begin
# Update Webhook
data, status_code, headers = api_instance.webhook_by_publicid_put_with_http_info(publicid, webhook_update_payload)
p status_code # => 2xx
p headers # => { ... }
p data # => <Webhook>
rescue ElasticEmail::ApiError => e
puts "Error when calling WebhookApi->webhook_by_publicid_put_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| publicid | String | ||
| webhook_update_payload | WebhookUpdatePayload |
- Content-Type: application/json
- Accept: application/json
<Array> webhook_get(opts)
Load Webhooks
Returns a list of notification webhooks. Required Access Level: ViewWebNotifications
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::WebhookApi.new
opts = {
limit: 100, # Integer | Maximum number of returned items.
offset: 20 # Integer | How many items should be returned ahead.
}
begin
# Load Webhooks
result = api_instance.webhook_get(opts)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling WebhookApi->webhook_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(<Array>, Integer, Hash)> webhook_get_with_http_info(opts)
begin
# Load Webhooks
data, status_code, headers = api_instance.webhook_get_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <Array<Webhook>>
rescue ElasticEmail::ApiError => e
puts "Error when calling WebhookApi->webhook_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| limit | Integer | Maximum number of returned items. | [optional] |
| offset | Integer | How many items should be returned ahead. | [optional] |
- Content-Type: Not defined
- Accept: application/json
webhook_post(webhook_create_payload)
Add Webhook
Add a notification webhook. Required Access Level: ModifyWebNotifications
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::WebhookApi.new
webhook_create_payload = ElasticEmail::WebhookCreatePayload.new({name: 'attachment.txt', url: 'http://address.for.notification.com'}) # WebhookCreatePayload |
begin
# Add Webhook
result = api_instance.webhook_post(webhook_create_payload)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling WebhookApi->webhook_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> webhook_post_with_http_info(webhook_create_payload)
begin
# Add Webhook
data, status_code, headers = api_instance.webhook_post_with_http_info(webhook_create_payload)
p status_code # => 2xx
p headers # => { ... }
p data # => <Webhook>
rescue ElasticEmail::ApiError => e
puts "Error when calling WebhookApi->webhook_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| webhook_create_payload | WebhookCreatePayload |
- Content-Type: application/json
- Accept: application/json