Send a test event
curl --request POST \
--url https://api.nylon.dev/v1/webhooks/{webhookId}/test \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nylon.dev/v1/webhooks/{webhookId}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nylon.dev/v1/webhooks/{webhookId}/test"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nylon.dev/v1/webhooks/{webhookId}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.nylon.dev/v1/webhooks/{webhookId}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "cly7w4c5d0002x8b3n1q3r0aa",
"webhook_id": "<string>",
"event": "post.failed",
"status": "pending",
"attempts": 1,
"created_at": "2023-11-07T05:31:56Z",
"next_attempt_at": "2023-11-07T05:31:56Z",
"response_status": 200,
"response_body": "<string>",
"error": "The endpoint returned 500.",
"delivered_at": "2023-11-07T05:31:56Z",
"data": {}
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required."
}
}{
"error": {
"code": "not_found",
"message": "Post could not be found."
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required.",
"details": [
{
"message": "Instagram requires at least 1 media item — text-only posts are not supported.",
"field": "profile_ids",
"network": "instagram",
"code": "invalid_request"
}
]
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after the window resets."
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required.",
"details": [
{
"message": "Instagram requires at least 1 media item — text-only posts are not supported.",
"field": "profile_ids",
"network": "instagram",
"code": "invalid_request"
}
]
}
}Webhooks
Send a test event
Deliver a signed test event now and see exactly what your endpoint returned.
POST
https://api.nylon.dev
/
v1
/
webhooks
/
{webhookId}
/
test
Send a test event
curl --request POST \
--url https://api.nylon.dev/v1/webhooks/{webhookId}/test \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nylon.dev/v1/webhooks/{webhookId}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nylon.dev/v1/webhooks/{webhookId}/test"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nylon.dev/v1/webhooks/{webhookId}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.nylon.dev/v1/webhooks/{webhookId}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "cly7w4c5d0002x8b3n1q3r0aa",
"webhook_id": "<string>",
"event": "post.failed",
"status": "pending",
"attempts": 1,
"created_at": "2023-11-07T05:31:56Z",
"next_attempt_at": "2023-11-07T05:31:56Z",
"response_status": 200,
"response_body": "<string>",
"error": "The endpoint returned 500.",
"delivered_at": "2023-11-07T05:31:56Z",
"data": {}
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required."
}
}{
"error": {
"code": "not_found",
"message": "Post could not be found."
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required.",
"details": [
{
"message": "Instagram requires at least 1 media item — text-only posts are not supported.",
"field": "profile_ids",
"network": "instagram",
"code": "invalid_request"
}
]
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after the window resets."
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required.",
"details": [
{
"message": "Instagram requires at least 1 media item — text-only posts are not supported.",
"field": "profile_ids",
"network": "instagram",
"code": "invalid_request"
}
]
}
}Authorizations
An API key beginning with nylon_live_.
Path Parameters
The Nylon id of the webhook endpoint.
Example:
"cly7w1a2b0001x8b3k9m2p0zz"
Response
The delivery, with whatever the endpoint returned.
Hide child attributes
Hide child attributes
Also the id in the payload and the Nylon-Delivery header — deduplicate on it.
Example:
"cly7w4c5d0002x8b3n1q3r0aa"
Example:
"post.failed"
pending means a further attempt is due; failed means the attempts are exhausted.
Available options:
pending, delivered, failed Example:
1
When the next attempt is due. Null once the delivery is settled.
Example:
200
The first 2000 characters of what your endpoint returned.
Example:
"The endpoint returned 500."
The event payload, exactly as it was sent under data.
⌘I