toloka.client.TolokaClient.upsert_webhook_subscriptions
| Source code
upsert_webhook_subscriptions(self, subscriptions: List[WebhookSubscription])
Creates subscriptions.
You can create a subscription and receive notifications about events. For example, when a pool is closed or a task's status changes, Toloka can send you a notification.
Parameters | Type | Description |
---|---|---|
subscriptions | List[WebhookSubscription] | A list of subscriptions to be created. |
Returns:
The result of the operation.
Return type:
Examples:
result = toloka_client.upsert_webhook_subscriptions([ { 'webhook_url': 'https://awesome-requester.com/toloka-webhook', 'event_type': toloka.client.webhook_subscription.WebhookSubscription.EventType.ASSIGNMENT_CREATED, 'pool_id': '121212' }, { 'webhook_url': 'https://awesome-requester.com/toloka-webhook', 'event_type': toloka.client.webhook_subscription.WebhookSubscription.EventType.POOL_CLOSED, 'pool_id': '121212' }])print(len(result.items))
Last updated: August 28, 2023