POST Agents/Webhook/GetAllWebhooks
Some tooltip text!
• 4 minutes to read
• 4 minutes to read
POST /api/v1/Agents/Webhook/GetAllWebhooks
Returns all webhooks, according to filter criteria
NsApiSlow threshold: 2000 ms.
Online Restricted: ## The Webhook agent is not available in Online by default. Access must be requested specifically when app is registered.
Query String Parameters
| Parameter Name | Type | Description |
|---|---|---|
| $select | string | Optional comma separated list of properties to include in the result. Other fields are then nulled out to reduce payload size: "Name,department,category". Default = show all fields. |
POST /api/v1/Agents/Webhook/GetAllWebhooks?$select=name,department,category/id
Request Headers
| Parameter Name | Description |
|---|---|
| Authorization | Supports 'Basic', 'SoTicket' and 'Bearer' schemes, depending on installation type. |
| X-XSRF-TOKEN | If not using Authorization header, you must provide XSRF value from cookie or hidden input field |
| Content-Type | Content-type of the request body: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded, application/json-patch+json, application/merge-patch+json |
| Accept | Content-type(s) you would like the response in: application/json, text/json, application/xml, text/xml, application/json-patch+json, application/merge-patch+json |
| Accept-Language | Convert string references and multi-language values into a specified language (iso2) code. |
| SO-Language | Convert string references and multi-language values into a specified language (iso2) code. Overrides Accept-Language value. |
| SO-Culture | Number, date formatting in a specified culture (iso2 language) code. Partially overrides SO-Language/Accept-Language value. Ignored if no Language set. |
| SO-TimeZone | Specify the timezone code that you would like date/time responses converted to. |
| SO-AppToken | The application token that identifies the partner app. Used when calling Online WebAPI from a server. |
Request Body: request
NameFilter, EventFilter, StatusFilter
| Property Name | Type | Description |
|---|---|---|
| NameFilter | String | |
| EventFilter | String | |
| StatusFilter | String |
Response:array
OK
| Response | Description |
|---|---|
| 200 | OK |
Response body: array
| Property Name | Type | Description |
|---|---|---|
| WebhookId | int32 | Primary Key. Unique id for this webhook. |
| Name | string | Name to identify this webhook. Does not have to be unique. |
| Events | array | Array of event names that trigger this webhook: ['contact.created', 'sale.changed'] |
| TargetUrl | string | Destination to POST event info to. URL for webhooks. Id for CRM scripts |
| Secret | string | Shared secret key used for generating SHA256 HMAC signature, so that receiver can verify that call came from this server |
| State | string | Webhook status - should we post events to the URL? 1=Active, 2=Stopped or 3=TooManyErrors |
| Type | string | Name of plugin that handles this webhook. 'webhook' for HTTP POST notifications, 'crmscript' for script invocations. |
| Headers | object | Custom HTTP Headers to add to webhook requests. |
| Properties | object | Custom values to inject into JSON body of webhook call. |
| Registered | date-time | Registered when in UTC. |
| RegisteredAssociate | Associate | The user that created the webhook. |
| Updated | date-time | Last updated when in UTC. |
| UpdatedAssociate | Associate | The user that last updated the webhook. |
| ErrorsEmail | string | Email address to send error message to when this webhook state changes to too-many errors. |
Sample request
POST /api/v1/Agents/Webhook/GetAllWebhooks
Authorization: Basic dGplMDpUamUw
Accept: application/json; charset=utf-8
Accept-Language: sv
Content-Type: application/json; charset=utf-8
{
"NameFilter": "Johns Inc and Sons",
"EventFilter": "qui",
"StatusFilter": "Active"
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"WebhookId": 3,
"Name": "Ticket System Integration",
"Events": [
"ticket.created",
"ticket.changed"
],
"TargetUrl": "https://support.example.com/api/webhooks/tickets",
"Secret": "sk_live_a1b2c3d4e5f6g7h8i9j0",
"State": "Active",
"Type": "webhook",
"Headers": {
"X-Service-Key": "support_integration_v2",
"X-Webhook-Version": "1.0"
},
"Properties": {
"fieldName": {}
},
"Registered": "2024-06-10T08:30:00+02:00",
"RegisteredAssociate": null,
"Updated": "2024-11-28T09:45:00+01:00",
"UpdatedAssociate": null,
"ErrorsEmail": "support-admin@example.com"
}
]