Get a webhook
const url = 'https://api.sendtruss.com/v1/webhooks/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.sendtruss.com/v1/webhooks/example \ --header 'Authorization: Bearer <token>'With the body as we would send it now.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”WebhookResource
object
object
Where the change came from: recipient when the person did it, such as leaving marketing or marking an email as spam; sendtruss when our sending or our own rules recorded it.
object
pending until your endpoint answers 2xx (delivered) or we give up (failed).
The HTTP status your endpoint last answered with, or null when it gave none.
What went wrong on the last attempt, or null.
Examplegenerated
{ "data": { "id": "example", "type": "example", "source": "example", "endpoint_id": "example", "workspace": { "id": "example", "reference": "example" }, "state": "example", "attempts": 1, "last_attempt_at": "example", "last_status": 1, "last_error": "example", "delivered_at": "example", "created_at": "example", "body": "example" }}Headers
Section titled “Headers”This request’s id. Quote it when you ask us about the request.
The API key is missing, malformed, revoked or expired.
object
What went wrong, for a person to read. It may change, so branch on code.
What went wrong, for your code to branch on. A new code is not a breaking change.
The entry on our errors page that explains this code.
This request’s id, the same as its Request-Id header. Quote it when you ask us about the request.
Example
{ "code": "unauthenticated"}Headers
Section titled “Headers”This request’s id. Quote it when you ask us about the request.
Nothing is at this path for your key. Another platform’s or another workspace’s resource answers the same as one that doesn’t exist.
object
What went wrong, for a person to read. It may change, so branch on code.
What went wrong, for your code to branch on. A new code is not a breaking change.
The entry on our errors page that explains this code.
This request’s id, the same as its Request-Id header. Quote it when you ask us about the request.
Example
{ "code": "not_found"}Headers
Section titled “Headers”This request’s id. Quote it when you ask us about the request.
Too many requests. Wait for the seconds in Retry-After.
object
What went wrong, for a person to read. It may change, so branch on code.
What went wrong, for your code to branch on. A new code is not a breaking change.
The entry on our errors page that explains this code.
This request’s id, the same as its Request-Id header. Quote it when you ask us about the request.
Example
{ "code": "rate_limited"}Headers
Section titled “Headers”This request’s id. Quote it when you ask us about the request.
Seconds to wait before trying again.