API-viiteopas
Webhooks
Webhook endpoints, their deliveries and the event types they can receive.
List webhook event types
GET/webhooks/event-types
Lists every event type a webhook can receive, with what it means, the scopes a subscription to it needs, its payload's JSON schema and an example.
- Käyttöoikeudet
- webhooks:read
Vastaukset
- 200 The types. WebhookEventTypeList
Kentät
dataWebhookEventType[]The types.
Näytä kentät
typestringThe type: attendee.registered and the others.
summarystring tai nullIn a few words.
descriptionstring tai nullWhen it is sent and what it carries.
scopesstring[]The scopes a key needs to subscribe to it through /hooks.
schemaobjectThe JSON schema of the signed body: { type, timestamp, data }.
exampleobjectAn example of the signed body.
- 401 invalidKey, keyExpired, keyRevoked.
- 403 missingScope.
- 429 rateLimited.
Hylkäykset
Pyyntö
curl "https://attendbeacon.com/api/v1/webhooks/event-types" \
-H "Authorization: Bearer $ATTENDBEACON_KEY"const response = await fetch("https://attendbeacon.com/api/v1/webhooks/event-types", {
headers: {
Authorization: `Bearer ${process.env.ATTENDBEACON_KEY}`
}
});
if (!response.ok) throw new Error((await response.json()).detail);
const data = await response.json();using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ATTENDBEACON_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Get, "https://attendbeacon.com/api/v1/webhooks/event-types");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();import os
import requests
response = requests.get(
"https://attendbeacon.com/api/v1/webhooks/event-types",
headers={
"Authorization": f"Bearer {os.environ['ATTENDBEACON_KEY']}"
}
)
response.raise_for_status()
data = response.json()$headers = @{
Authorization = "Bearer $env:ATTENDBEACON_KEY"
}
$data = Invoke-RestMethod -Method Get -Uri "https://attendbeacon.com/api/v1/webhooks/event-types" -Headers $headers401 invalidKey, keyExpired, keyRevoked.
{
"type": "https://attendbeacon.com/developers/errors#invalidKey",
"title": "No working API key",
"status": 401,
"detail": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key.",
"instance": "/api/v1/webhooks/event-types",
"code": "invalidKey",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"error": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key."
}List webhook endpoints
GET/webhooks
Lists the workspace's webhook endpoints. Their secrets are never shown, and an address's query is hidden.
- Käyttöoikeudet
- webhooks:read
Vastaukset
- 200 The endpoints. WebhookList
Kentät
dataWebhook[]The endpoints.
Näytä kentät
webhookIdstring (uuid)The endpoint's id.
urlstringIts address, with any query hidden.
hoststringIts host.
descriptionstring tai nullWhat it is for.
eventTypesstring[]What it receives.
activebooleanWhether it is switched on.
disabledReasonstring tai nullWhy it stopped by itself: gone (it answered 410).
lastStatusstring tai nullHow its last delivery went: succeeded or failed.
lastDeliveryUtcstring (date-time) tai nullWhen it was last called, in UTC.
createdUtcstring (date-time)When it was added, in UTC.
createdBystringWho added it.
mostinteger (int32)The most a workspace may have.
- 401 invalidKey, keyExpired, keyRevoked.
- 403 missingScope.
- 429 rateLimited.
Hylkäykset
Pyyntö
curl "https://attendbeacon.com/api/v1/webhooks" \
-H "Authorization: Bearer $ATTENDBEACON_KEY"const response = await fetch("https://attendbeacon.com/api/v1/webhooks", {
headers: {
Authorization: `Bearer ${process.env.ATTENDBEACON_KEY}`
}
});
if (!response.ok) throw new Error((await response.json()).detail);
const data = await response.json();using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ATTENDBEACON_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Get, "https://attendbeacon.com/api/v1/webhooks");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();import os
import requests
response = requests.get(
"https://attendbeacon.com/api/v1/webhooks",
headers={
"Authorization": f"Bearer {os.environ['ATTENDBEACON_KEY']}"
}
)
response.raise_for_status()
data = response.json()$headers = @{
Authorization = "Bearer $env:ATTENDBEACON_KEY"
}
$data = Invoke-RestMethod -Method Get -Uri "https://attendbeacon.com/api/v1/webhooks" -Headers $headers401 invalidKey, keyExpired, keyRevoked.
{
"type": "https://attendbeacon.com/developers/errors#invalidKey",
"title": "No working API key",
"status": 401,
"detail": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key.",
"instance": "/api/v1/webhooks",
"code": "invalidKey",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"error": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key."
}Add a webhook endpoint Muuttaa tietoja
POST/webhooks
Adds a webhook endpoint for some event types. Its signing secret is in this answer and nowhere else afterwards, so an Idempotency-Key is not honoured here: the answer is never kept. The key needs the scopes of what the event types deliver (GET /webhooks/event-types), and the endpoint is switched off when the key is revoked or expires.
- Käyttöoikeudet
- webhooks:write
- Lähetä Idempotency-Key, niin uudelleenyritykset ovat turvallisia. →
Runko NewWebhook
The endpoint.
urlstring (uri)The https address to call. A public address only.
descriptionstring tai nullWhat it is for, at most 200 characters.
eventTypesstring[]What it receives: attendee.registered and the others (GET /webhooks/event-types).
activebooleanSwitched on; a new one starts on.
Vastaukset
- 201 The endpoint and its secret. WebhookCreated
Kentät
webhookWebhookA webhook endpoint: an address told what happens, signed the Standard Webhooks way.
Näytä kentät
webhookIdstring (uuid)The endpoint's id.
urlstringIts address, with any query hidden.
hoststringIts host.
descriptionstring tai nullWhat it is for.
eventTypesstring[]What it receives.
activebooleanWhether it is switched on.
disabledReasonstring tai nullWhy it stopped by itself: gone (it answered 410).
lastStatusstring tai nullHow its last delivery went: succeeded or failed.
lastDeliveryUtcstring (date-time) tai nullWhen it was last called, in UTC.
createdUtcstring (date-time)When it was added, in UTC.
createdBystringWho added it.
secretstringThe signing secret, whsec_ and Base64. Keep it: it is never shown again; POST /webhooks/{webhookId}/secret makes a new one.
- 400 invalidBody, invalidRequest, tooManyEndpoints.
- 401 invalidKey, keyExpired, keyRevoked.
- 403 missingScope, demoWorkspace.
- 429 rateLimited.
- 503 webhooksUnavailable.
Hylkäykset
invalidKey keyExpired keyRevoked rateLimited missingScope invalidBody invalidRequest demoWorkspace tooManyEndpoints webhooksUnavailable
Pyyntö
curl -X POST "https://attendbeacon.com/api/v1/webhooks" \
-H "Authorization: Bearer $ATTENDBEACON_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"url": "https://hooks.example.com/attendbeacon",
"description": "CRM sync",
"eventTypes": [
"attendee.registered",
"attendee.cancelled",
"attendee.erased"
]
}'const response = await fetch("https://attendbeacon.com/api/v1/webhooks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ATTENDBEACON_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json"
},
body: JSON.stringify({
"url": "https://hooks.example.com/attendbeacon",
"description": "CRM sync",
"eventTypes": [
"attendee.registered",
"attendee.cancelled",
"attendee.erased"
]
})
});
if (!response.ok) throw new Error((await response.json()).detail);
const data = await response.json();using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ATTENDBEACON_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://attendbeacon.com/api/v1/webhooks");
request.Headers.Add("Idempotency-Key", Guid.NewGuid().ToString());
request.Content = new StringContent("""
{
"url": "https://hooks.example.com/attendbeacon",
"description": "CRM sync",
"eventTypes": [
"attendee.registered",
"attendee.cancelled",
"attendee.erased"
]
}
""", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();import os, uuid
import requests
response = requests.post(
"https://attendbeacon.com/api/v1/webhooks",
headers={
"Authorization": f"Bearer {os.environ['ATTENDBEACON_KEY']}",
"Idempotency-Key": str(uuid.uuid4())
},
json={
"url": "https://hooks.example.com/attendbeacon",
"description": "CRM sync",
"eventTypes": [
"attendee.registered",
"attendee.cancelled",
"attendee.erased"
]
}
)
response.raise_for_status()
data = response.json()$headers = @{
Authorization = "Bearer $env:ATTENDBEACON_KEY"
"Idempotency-Key" = [guid]::NewGuid().ToString()
}
$body = @'
{
"url": "https://hooks.example.com/attendbeacon",
"description": "CRM sync",
"eventTypes": [
"attendee.registered",
"attendee.cancelled",
"attendee.erased"
]
}
'@
$data = Invoke-RestMethod -Method Post -Uri "https://attendbeacon.com/api/v1/webhooks" -Headers $headers -ContentType "application/json" -Body $body400 invalidBody, invalidRequest, tooManyEndpoints.
{
"type": "https://attendbeacon.com/developers/errors#invalidBody",
"title": "The body is not readable",
"status": 400,
"detail": "The body is not JSON, or a field has the wrong type.",
"instance": "/api/v1/webhooks",
"code": "invalidBody",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"error": "The body is not JSON, or a field has the wrong type."
}Get a webhook endpoint
GET/webhooks/{webhookId}
Gets one webhook endpoint, without its secret.
- Käyttöoikeudet
- webhooks:read
- Vastaa ETagilla; lähetä If-None-Match, niin vältät turhan latauksen.
Parametrit
polku
webhookIdstring (uuid)pakollinenThe webhook endpoint's id.
otsake
If-None-MatchstringThe ETag you have: when it is still current the answer is 304 with no body.
Vastaukset
- 200 The endpoint. Webhook
Kentät
webhookIdstring (uuid)The endpoint's id.
urlstringIts address, with any query hidden.
hoststringIts host.
descriptionstring tai nullWhat it is for.
eventTypesstring[]What it receives.
activebooleanWhether it is switched on.
disabledReasonstring tai nullWhy it stopped by itself: gone (it answered 410).
lastStatusstring tai nullHow its last delivery went: succeeded or failed.
lastDeliveryUtcstring (date-time) tai nullWhen it was last called, in UTC.
createdUtcstring (date-time)When it was added, in UTC.
createdBystringWho added it.
- 304 Not modified: If-None-Match named the representation as it is.
- 401 invalidKey, keyExpired, keyRevoked.
- 403 missingScope.
- 404 notFound.
- 429 rateLimited.
Hylkäykset
invalidKey keyExpired keyRevoked rateLimited missingScope notFound
Pyyntö
curl "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b" \
-H "Authorization: Bearer $ATTENDBEACON_KEY"const response = await fetch("https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b", {
headers: {
Authorization: `Bearer ${process.env.ATTENDBEACON_KEY}`
}
});
if (!response.ok) throw new Error((await response.json()).detail);
const data = await response.json();using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ATTENDBEACON_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Get, "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();import os
import requests
response = requests.get(
"https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b",
headers={
"Authorization": f"Bearer {os.environ['ATTENDBEACON_KEY']}"
}
)
response.raise_for_status()
data = response.json()$headers = @{
Authorization = "Bearer $env:ATTENDBEACON_KEY"
}
$data = Invoke-RestMethod -Method Get -Uri "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b" -Headers $headers401 invalidKey, keyExpired, keyRevoked.
{
"type": "https://attendbeacon.com/developers/errors#invalidKey",
"title": "No working API key",
"status": 401,
"detail": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key.",
"instance": "/api/v1/webhooks/{webhookId}",
"code": "invalidKey",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"error": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key."
}Change a webhook endpoint Muuttaa tietoja
PATCH/webhooks/{webhookId}
Changes an endpoint's address, description, event types, or switches it on or off. A field left out stays as it is. A new address or new event types need the scopes of everything the endpoint will then receive.
- Käyttöoikeudet
- webhooks:write
- Lähetä If-Match lukemasi ETagin kanssa, jotta välissä tehtyä muutosta ei kirjoiteta yli.
Parametrit
polku
webhookIdstring (uuid)pakollinenThe webhook endpoint's id.
otsake
If-MatchstringThe ETag you read, so a change made since is refused (412) rather than overwritten.
Runko NewWebhook
The fields to change.
urlstring (uri)The https address to call. A public address only.
descriptionstring tai nullWhat it is for, at most 200 characters.
eventTypesstring[]What it receives: attendee.registered and the others (GET /webhooks/event-types).
activebooleanSwitched on; a new one starts on.
Vastaukset
- 200 The endpoint as it is now. Webhook
Kentät
webhookIdstring (uuid)The endpoint's id.
urlstringIts address, with any query hidden.
hoststringIts host.
descriptionstring tai nullWhat it is for.
eventTypesstring[]What it receives.
activebooleanWhether it is switched on.
disabledReasonstring tai nullWhy it stopped by itself: gone (it answered 410).
lastStatusstring tai nullHow its last delivery went: succeeded or failed.
lastDeliveryUtcstring (date-time) tai nullWhen it was last called, in UTC.
createdUtcstring (date-time)When it was added, in UTC.
createdBystringWho added it.
- 400 invalidBody, invalidRequest.
- 401 invalidKey, keyExpired, keyRevoked.
- 403 missingScope, demoWorkspace.
- 404 notFound.
- 412 preconditionFailed.
- 429 rateLimited.
Hylkäykset
invalidKey keyExpired keyRevoked rateLimited missingScope notFound invalidBody invalidRequest demoWorkspace preconditionFailed
Pyyntö
curl -X PATCH "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b" \
-H "Authorization: Bearer $ATTENDBEACON_KEY" \
-H "If-Match: $ETAG" \
-H "Content-Type: application/json" \
-d '{
"active": false
}'const response = await fetch("https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.ATTENDBEACON_KEY}`,
"If-Match": etag,
"Content-Type": "application/json"
},
body: JSON.stringify({
"active": false
})
});
if (!response.ok) throw new Error((await response.json()).detail);
const data = await response.json();using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ATTENDBEACON_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Patch, "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b");
request.Headers.IfMatch.Add(new EntityTagHeaderValue(etag));
request.Content = new StringContent("""
{
"active": false
}
""", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();import os
import requests
response = requests.patch(
"https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b",
headers={
"Authorization": f"Bearer {os.environ['ATTENDBEACON_KEY']}",
"If-Match": etag
},
json={
"active": False
}
)
response.raise_for_status()
data = response.json()$headers = @{
Authorization = "Bearer $env:ATTENDBEACON_KEY"
"If-Match" = $etag
}
$body = @'
{
"active": false
}
'@
$data = Invoke-RestMethod -Method Patch -Uri "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b" -Headers $headers -ContentType "application/json" -Body $body400 invalidBody, invalidRequest.
{
"type": "https://attendbeacon.com/developers/errors#invalidBody",
"title": "The body is not readable",
"status": 400,
"detail": "The body is not JSON, or a field has the wrong type.",
"instance": "/api/v1/webhooks/{webhookId}",
"code": "invalidBody",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"error": "The body is not JSON, or a field has the wrong type."
}Remove a webhook endpoint Muuttaa tietoja
DELETE/webhooks/{webhookId}
Removes an endpoint and its secret. Nothing more is sent to it.
- Käyttöoikeudet
- webhooks:write
Parametrit
polku
webhookIdstring (uuid)pakollinenThe webhook endpoint's id.
Vastaukset
- 204 Removed.
- 401 invalidKey, keyExpired, keyRevoked.
- 403 missingScope, demoWorkspace.
- 404 notFound.
- 429 rateLimited.
Hylkäykset
invalidKey keyExpired keyRevoked rateLimited missingScope notFound demoWorkspace
Pyyntö
curl -X DELETE "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b" \
-H "Authorization: Bearer $ATTENDBEACON_KEY"const response = await fetch("https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.ATTENDBEACON_KEY}`
}
});
if (!response.ok) throw new Error((await response.json()).detail);using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ATTENDBEACON_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Delete, "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();import os
import requests
response = requests.delete(
"https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b",
headers={
"Authorization": f"Bearer {os.environ['ATTENDBEACON_KEY']}"
}
)
response.raise_for_status()$headers = @{
Authorization = "Bearer $env:ATTENDBEACON_KEY"
}
Invoke-RestMethod -Method Delete -Uri "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b" -Headers $headers401 invalidKey, keyExpired, keyRevoked.
{
"type": "https://attendbeacon.com/developers/errors#invalidKey",
"title": "No working API key",
"status": 401,
"detail": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key.",
"instance": "/api/v1/webhooks/{webhookId}",
"code": "invalidKey",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"error": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key."
}Make a new signing secret Muuttaa tietoja
POST/webhooks/{webhookId}/secret
Replaces an endpoint's signing secret. The old one stops working at once: there is no overlap, because a secret that leaked should not be trusted any longer. No Idempotency-Key: the answer, a secret, is never kept.
- Käyttöoikeudet
- webhooks:write
- Lähetä Idempotency-Key, niin uudelleenyritykset ovat turvallisia. →
Parametrit
polku
webhookIdstring (uuid)pakollinenThe webhook endpoint's id.
Vastaukset
- 200 The new secret, shown this once. WebhookSecret
Kentät
webhookIdstring (uuid)The endpoint's id.
secretstringThe new secret, shown this once.
- 401 invalidKey, keyExpired, keyRevoked.
- 403 missingScope, demoWorkspace.
- 404 notFound.
- 429 rateLimited.
- 503 webhooksUnavailable.
Hylkäykset
invalidKey keyExpired keyRevoked rateLimited missingScope notFound demoWorkspace webhooksUnavailable
Pyyntö
curl -X POST "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/secret" \
-H "Authorization: Bearer $ATTENDBEACON_KEY" \
-H "Idempotency-Key: $(uuidgen)"const response = await fetch("https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/secret", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ATTENDBEACON_KEY}`,
"Idempotency-Key": crypto.randomUUID()
}
});
if (!response.ok) throw new Error((await response.json()).detail);
const data = await response.json();using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ATTENDBEACON_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/secret");
request.Headers.Add("Idempotency-Key", Guid.NewGuid().ToString());
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();import os, uuid
import requests
response = requests.post(
"https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/secret",
headers={
"Authorization": f"Bearer {os.environ['ATTENDBEACON_KEY']}",
"Idempotency-Key": str(uuid.uuid4())
}
)
response.raise_for_status()
data = response.json()$headers = @{
Authorization = "Bearer $env:ATTENDBEACON_KEY"
"Idempotency-Key" = [guid]::NewGuid().ToString()
}
$data = Invoke-RestMethod -Method Post -Uri "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/secret" -Headers $headers401 invalidKey, keyExpired, keyRevoked.
{
"type": "https://attendbeacon.com/developers/errors#invalidKey",
"title": "No working API key",
"status": 401,
"detail": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key.",
"instance": "/api/v1/webhooks/{webhookId}/secret",
"code": "invalidKey",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"error": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key."
}Send a test message Muuttaa tietoja
POST/webhooks/{webhookId}/test
Sends a signed webhook.test message to the endpoint now, while you wait, and says what it answered. A switched-off endpoint can be tested too.
- Käyttöoikeudet
- webhooks:write
- Lähetä Idempotency-Key, niin uudelleenyritykset ovat turvallisia. →
Parametrit
polku
webhookIdstring (uuid)pakollinenThe webhook endpoint's id.
otsake
Idempotency-KeystringA key of your own, such as a UUID, so a retry after a lost connection is answered with the first answer instead of doing it twice. Kept 24 hours.
Vastaukset
- 200 What came of it. WebhookTest
Kentät
okbooleanWhether the endpoint answered 2xx.
statusinteger (int32) tai nullThe status it answered.
errorstring tai nullWhat went wrong.
durationMsinteger (int32) tai nullHow long it took.
deliveryIdstring (uuid)The delivery, in the endpoint's log.
- 400 invalidIdempotencyKey.
- 401 invalidKey, keyExpired, keyRevoked.
- 403 missingScope.
- 404 notFound.
- 409 idempotencyKeyInUse.
- 422 idempotencyKeyReused.
- 429 rateLimited.
Hylkäykset
invalidKey keyExpired keyRevoked rateLimited missingScope notFound idempotencyKeyInUse idempotencyKeyReused invalidIdempotencyKey
Pyyntö
curl -X POST "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/test" \
-H "Authorization: Bearer $ATTENDBEACON_KEY" \
-H "Idempotency-Key: $(uuidgen)"const response = await fetch("https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/test", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ATTENDBEACON_KEY}`,
"Idempotency-Key": crypto.randomUUID()
}
});
if (!response.ok) throw new Error((await response.json()).detail);
const data = await response.json();using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ATTENDBEACON_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/test");
request.Headers.Add("Idempotency-Key", Guid.NewGuid().ToString());
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();import os, uuid
import requests
response = requests.post(
"https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/test",
headers={
"Authorization": f"Bearer {os.environ['ATTENDBEACON_KEY']}",
"Idempotency-Key": str(uuid.uuid4())
}
)
response.raise_for_status()
data = response.json()$headers = @{
Authorization = "Bearer $env:ATTENDBEACON_KEY"
"Idempotency-Key" = [guid]::NewGuid().ToString()
}
$data = Invoke-RestMethod -Method Post -Uri "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/test" -Headers $headers400 invalidIdempotencyKey.
{
"type": "https://attendbeacon.com/developers/errors#invalidIdempotencyKey",
"title": "Idempotency-Key is not valid",
"status": 400,
"detail": "An Idempotency-Key is 1 to 255 visible ASCII characters; a UUID is a good one.",
"instance": "/api/v1/webhooks/{webhookId}/test",
"code": "invalidIdempotencyKey",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"error": "An Idempotency-Key is 1 to 255 visible ASCII characters; a UUID is a good one."
}List deliveries
GET/webhooks/{webhookId}/deliveries
Lists an endpoint's latest deliveries, newest first: what was sent, how many attempts, what the endpoint answered.
- Käyttöoikeudet
- webhooks:read
Parametrit
polku
webhookIdstring (uuid)pakollinenThe webhook endpoint's id.
kysely
limitinteger (int32)How many, up to 200.
Oletus:
50
Vastaukset
- 200 The deliveries. WebhookDeliveryList
Kentät
dataWebhookDelivery[]The deliveries.
Näytä kentät
deliveryIdstring (uuid)The delivery's id.
messageIdstringThe message's webhook-id: msg_ and its id, the same on every attempt.
eventTypestringIts type.
statusstringPending, claimed, succeeded, failed or cancelled.
testbooleanWhether it was a test.
attemptsinteger (int32)Attempts so far.
nextAttemptUtcstring (date-time) tai nullWhen it is tried again, in UTC.
statusCodeinteger (int32) tai nullThe last status the endpoint answered.
errorstring tai nullThe last error.
durationMsinteger (int32) tai nullHow long the last attempt took.
createdUtcstring (date-time)When it was queued, in UTC.
completedUtcstring (date-time) tai nullWhen it ended, in UTC.
- 401 invalidKey, keyExpired, keyRevoked.
- 403 missingScope.
- 404 notFound.
- 429 rateLimited.
Hylkäykset
invalidKey keyExpired keyRevoked rateLimited missingScope notFound
Pyyntö
curl "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/deliveries?limit=2" \
-H "Authorization: Bearer $ATTENDBEACON_KEY"const response = await fetch("https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/deliveries?limit=2", {
headers: {
Authorization: `Bearer ${process.env.ATTENDBEACON_KEY}`
}
});
if (!response.ok) throw new Error((await response.json()).detail);
const data = await response.json();using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ATTENDBEACON_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Get, "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/deliveries?limit=2");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();import os
import requests
response = requests.get(
"https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/deliveries", params={"limit": 2},
headers={
"Authorization": f"Bearer {os.environ['ATTENDBEACON_KEY']}"
}
)
response.raise_for_status()
data = response.json()$headers = @{
Authorization = "Bearer $env:ATTENDBEACON_KEY"
}
$data = Invoke-RestMethod -Method Get -Uri "https://attendbeacon.com/api/v1/webhooks/2c8e4a6f-1b3d-4e5a-9c7b-0d2f4a6c8e1b/deliveries?limit=2" -Headers $headers401 invalidKey, keyExpired, keyRevoked.
{
"type": "https://attendbeacon.com/developers/errors#invalidKey",
"title": "No working API key",
"status": 401,
"detail": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key.",
"instance": "/api/v1/webhooks/{webhookId}/deliveries",
"code": "invalidKey",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"error": "No key was sent, or it is not one this platform made. Send it as Authorization: Bearer abk_... or in X-Api-Key."
}Oppaat ja tämä sivusto ovat omalla kielelläsi. API-viiteoppaan omat kuvaukset ovat englanniksi, kuten itse rajapintakin.