Retrieve a webhook endpoint
curl --request GET \
--url https://api.nylon.dev/v1/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nylon.dev/v1/webhooks/{webhookId}', 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}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nylon.dev/v1/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "cly7w1a2b0001x8b3k9m2p0zz",
"url": "https://example.com/nylon/webhooks",
"events": [
"post.published"
],
"status": "active",
"secret_last_four": "8f2a",
"consecutive_failures": 0,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "Production receiver",
"disabled_reason": "<string>",
"last_succeeded_at": "2023-11-07T05:31:56Z",
"last_failed_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required."
}
}{
"error": {
"code": "not_found",
"message": "Post could not be found."
}
}{
"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
Retrieve a webhook endpoint
One endpoint and the state of its deliveries.
GET
https://api.nylon.dev
/
v1
/
webhooks
/
{webhookId}
Retrieve a webhook endpoint
curl --request GET \
--url https://api.nylon.dev/v1/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nylon.dev/v1/webhooks/{webhookId}', 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}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nylon.dev/v1/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "cly7w1a2b0001x8b3k9m2p0zz",
"url": "https://example.com/nylon/webhooks",
"events": [
"post.published"
],
"status": "active",
"secret_last_four": "8f2a",
"consecutive_failures": 0,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "Production receiver",
"disabled_reason": "<string>",
"last_succeeded_at": "2023-11-07T05:31:56Z",
"last_failed_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "unauthorized",
"message": "A valid Nylon API key is required."
}
}{
"error": {
"code": "not_found",
"message": "Post could not be found."
}
}{
"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 endpoint.
Hide child attributes
Hide child attributes
Example:
"cly7w1a2b0001x8b3k9m2p0zz"
Example:
"https://example.com/nylon/webhooks"
Subscribed events. An empty array means every event.
Available options:
post.published, post.partially_published, post.failed, profile.connected, profile.disconnected, profile.needs_attention Nylon disables an endpoint after 20 consecutive failed deliveries.
Available options:
active, disabled The last four characters of the signing secret, to tell two secrets apart.
Example:
"8f2a"
Failed deliveries since the last success. Any success resets it to zero.
Example:
0
Example:
"Production receiver"
⌘I