All URIs are relative to https://api.sendx.io/api/v1/rest
| Method | HTTP request | Description |
|---|---|---|
| create_webhook | POST /webhook | Create webhook |
| delete_webhook | DELETE /webhook/{identifier} | Delete webhook |
| get_all_webhooks | GET /webhook | Get all webhooks |
| get_webhook | GET /webhook/{identifier} | Get webhook by ID |
| update_webhook | PUT /webhook/{identifier} | Update webhook |
create_webhook(rest_e_webhook)
Create webhook
Creates a new webhook for event notifications.
require 'time'
require 'sendx-ruby-sdk'
# setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-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-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::WebhookApi.new
rest_e_webhook = SendX::RestEWebhook.new({url: 'https://api.example.com/webhooks/sendx', enabled: false}) # RestEWebhook |
begin
# Create webhook
result = api_instance.create_webhook(rest_e_webhook)
p result
rescue SendX::ApiError => e
puts "Error when calling WebhookApi->create_webhook: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_webhook_with_http_info(rest_e_webhook)
begin
# Create webhook
data, status_code, headers = api_instance.create_webhook_with_http_info(rest_e_webhook)
p status_code # => 2xx
p headers # => { ... }
p data # => <RestRWebhook>
rescue SendX::ApiError => e
puts "Error when calling WebhookApi->create_webhook_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| rest_e_webhook | RestEWebhook |
- Content-Type: application/json
- Accept: application/json
delete_webhook(identifier)
Delete webhook
Deletes a webhook configuration. 🎯 Key Features: - Remove webhooks - Stop event delivery - Clean up endpoints
require 'time'
require 'sendx-ruby-sdk'
# setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-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-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::WebhookApi.new
identifier = 'identifier_example' # String | Webhook identifier to update
begin
# Delete webhook
result = api_instance.delete_webhook(identifier)
p result
rescue SendX::ApiError => e
puts "Error when calling WebhookApi->delete_webhook: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> delete_webhook_with_http_info(identifier)
begin
# Delete webhook
data, status_code, headers = api_instance.delete_webhook_with_http_info(identifier)
p status_code # => 2xx
p headers # => { ... }
p data # => <DeleteResponse>
rescue SendX::ApiError => e
puts "Error when calling WebhookApi->delete_webhook_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Webhook identifier to update |
- Content-Type: Not defined
- Accept: application/json
<Array> get_all_webhooks
Get all webhooks
Retrieves all configured webhooks.
require 'time'
require 'sendx-ruby-sdk'
# setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-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-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::WebhookApi.new
begin
# Get all webhooks
result = api_instance.get_all_webhooks
p result
rescue SendX::ApiError => e
puts "Error when calling WebhookApi->get_all_webhooks: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(<Array>, Integer, Hash)> get_all_webhooks_with_http_info
begin
# Get all webhooks
data, status_code, headers = api_instance.get_all_webhooks_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => <Array<RestRWebhook>>
rescue SendX::ApiError => e
puts "Error when calling WebhookApi->get_all_webhooks_with_http_info: #{e}"
endThis endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
get_webhook(identifier)
Get webhook by ID
Retrieves details about a specific webhook.
require 'time'
require 'sendx-ruby-sdk'
# setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-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-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::WebhookApi.new
identifier = 'identifier_example' # String | Webhook identifier to retrieve
begin
# Get webhook by ID
result = api_instance.get_webhook(identifier)
p result
rescue SendX::ApiError => e
puts "Error when calling WebhookApi->get_webhook: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_webhook_with_http_info(identifier)
begin
# Get webhook by ID
data, status_code, headers = api_instance.get_webhook_with_http_info(identifier)
p status_code # => 2xx
p headers # => { ... }
p data # => <RestRWebhook>
rescue SendX::ApiError => e
puts "Error when calling WebhookApi->get_webhook_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Webhook identifier to retrieve |
- Content-Type: Not defined
- Accept: application/json
update_webhook(rest_e_webhook, identifier)
Update webhook
Updates webhook configuration.
require 'time'
require 'sendx-ruby-sdk'
# setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-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-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::WebhookApi.new
rest_e_webhook = SendX::RestEWebhook.new({url: 'https://api.example.com/webhooks/sendx', enabled: false}) # RestEWebhook |
identifier = 'identifier_example' # String | Webhook identifier to update
begin
# Update webhook
result = api_instance.update_webhook(rest_e_webhook, identifier)
p result
rescue SendX::ApiError => e
puts "Error when calling WebhookApi->update_webhook: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> update_webhook_with_http_info(rest_e_webhook, identifier)
begin
# Update webhook
data, status_code, headers = api_instance.update_webhook_with_http_info(rest_e_webhook, identifier)
p status_code # => 2xx
p headers # => { ... }
p data # => <RestRWebhook>
rescue SendX::ApiError => e
puts "Error when calling WebhookApi->update_webhook_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| rest_e_webhook | RestEWebhook | ||
| identifier | String | Webhook identifier to update |
- Content-Type: application/json
- Accept: application/json