Webhook Tests

A WebhookTest is an object that can be sent to your Webhook endpoint for connection and response tests.

Create Webhook Test

SDK Method

Files::WebhookTest.create

Return Object

WebhookTest

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Folder Admin permissions.

Method Arguments

ArgumentDescription
url
string
Required
URL for testing the webhook.
method
string
HTTP method(GET or POST).
encoding
string
HTTP encoding method. Can be JSON, XML, or RAW (form data).
headers
object
Additional request headers.
body
object
Additional body parameters.
raw_body
string
raw body text
file_as_body
boolean
Send the file data as the request body?
file_form_field
string
Send the file data as a named parameter in the request POST body
use_dedicated_ips
boolean
Use dedicated IPs for sending the webhook?

Example Request

begin
  webhook_test = Files::WebhookTest.create(
    url: "https://www.site.com/..."
  )
  # Operate on webhook_test
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

The WebhookTest Object

Some of the methods above return a WebhookTest object. The attributes of this object are listed below.

AttributeDescription
code
int64
Status HTTP code
message
string
Error message
status
string
Status message
data
Auto
Additional data
success
boolean
The success status of the webhook test