Webhook Tests

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

Create Webhook Test

SDK Function

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.

Function 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

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.WebhookTest;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("url", "https://www.site.com/...");
  
  WebhookTest webhookTest = WebhookTest.create(parameters);
  // Operate on webhookTest
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

The WebhookTest Object

Some of the functions 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