WebhookApi
extends AbstractApi
in package
Webhooks allow you to collect information about events that happen in your Crowdin projects.
You can select the request type, content type, and add a custom payload, which allows you to create integrations with other systems on your own.
Table of Contents
Methods
- create() : Webhook|null
- Add Webhook
- delete() : mixed
- Delete Webhook
- get() : Webhook
- Get Webhook Info
- getDelivery() : WebhookDelivery|null
- Get Webhook Delivery
- list() : ModelCollection
- List Webhooks
- listAllDeliveries() : ModelCollection
- List All Webhook Deliveries
- listDeliveries() : ModelCollection
- List Webhook Deliveries
- resendDelivery() : WebhookDelivery|null
- Resend Webhook Delivery
- test() : WebhookTestResult|null
- Test Webhook
- update() : Webhook|null
- Edit Webhook
Methods
create()
Add Webhook
public
create(int $projectId, array<string|int, mixed> $data) : Webhook|null
Parameters
- $projectId : int
- $data : array<string|int, mixed>
-
string $data[name] required
string $data[url] required
array $data[events] required
string $data[requestType] required
boolean $data[isActive]
string $data[contentType]
array $data[headers]
array $data[payload]
boolean $data[batchingEnabled]
Tags
Return values
Webhook|nulldelete()
Delete Webhook
public
delete(int $projectId, int $webhookId) : mixed
Parameters
- $projectId : int
- $webhookId : int
Tags
get()
Get Webhook Info
public
get(int $projectId, int $webhookId) : Webhook
Parameters
- $projectId : int
- $webhookId : int
Tags
Return values
WebhookgetDelivery()
Get Webhook Delivery
public
getDelivery(int $projectId, int $webhookId, int $deliveryId) : WebhookDelivery|null
Parameters
- $projectId : int
- $webhookId : int
- $deliveryId : int
Tags
Return values
WebhookDelivery|nulllist()
List Webhooks
public
list(int $projectId[, array<string|int, mixed> $params = [] ]) : ModelCollection
Parameters
- $projectId : int
- $params : array<string|int, mixed> = []
Tags
Return values
ModelCollectionlistAllDeliveries()
List All Webhook Deliveries
public
listAllDeliveries(int $projectId[, array<string|int, mixed> $params = [] ]) : ModelCollection
Parameters
- $projectId : int
- $params : array<string|int, mixed> = []
-
string $params[webhookIds] One ID or comma-separated list, deleted webhooks included
string $params[status] success or failed
string $params[events] One event or comma-separated list
string $params[createdAfter] ISO 8601 date
string $params[createdBefore] ISO 8601 date
integer $params[limit]
integer $params[offset]
Tags
Return values
ModelCollectionlistDeliveries()
List Webhook Deliveries
public
listDeliveries(int $projectId, int $webhookId[, array<string|int, mixed> $params = [] ]) : ModelCollection
Parameters
- $projectId : int
- $webhookId : int
- $params : array<string|int, mixed> = []
-
string $params[status] success or failed
string $params[events] One event or comma-separated list
string $params[createdAfter] ISO 8601 date
string $params[createdBefore] ISO 8601 date
integer $params[limit]
integer $params[offset]
Tags
Return values
ModelCollectionresendDelivery()
Resend Webhook Delivery
public
resendDelivery(int $projectId, int $webhookId, int $deliveryId) : WebhookDelivery|null
Parameters
- $projectId : int
- $webhookId : int
- $deliveryId : int
Tags
Return values
WebhookDelivery|null —The new delivery
test()
Test Webhook
public
test(int $projectId, int $webhookId[, array<string|int, mixed> $data = [] ]) : WebhookTestResult|null
Parameters
- $projectId : int
- $webhookId : int
- $data : array<string|int, mixed> = []
-
string $data[event] One of the webhook events. Default is the first event of the webhook
Tags
Return values
WebhookTestResult|nullupdate()
Edit Webhook
public
update(Webhook $webhook) : Webhook|null
Parameters
- $webhook : Webhook