Get a list of subscriptions

To get data for multiple active subscriptions, send a GET request to the /webhook-subscriptions resource.

Request

GET api/v1/webhook-subscriptions ?
     event_type=<event type>
&  [pool_id=<pool ID>]
&  [id_gt=<subscription ID>]
&  [id_gte=<subscription ID>]
&  [id_lt=<subscription ID>]
&  [id_lte=<subscription ID>]
&  [created_gt=<date>]
&  [created_gte=<date>]
&  [created_lt=<date>]
&  [created_lte=<date>]
&  [sort=<sort fields>]
&  [limit=<maximum number of results in the response>]

Host: https://sandbox.toloka.yandex.ru
Authorization: OAuth <OAuth token>
Request parameters

Parameter

Overview

Data type

Required

event_type

Event type.

Acceptable values:

  • POOL_CLOSED — The pool is closed.
  • DYNAMIC_OVERLAP_COMPLETED — An aggregated result appeared after dynamic overlap.
  • ASSIGNMENT_CREATED — A task was created.
  • ASSIGNMENT_SUBMITTED — A task is completed and waiting for acceptance by the requester.
  • ASSIGNMENT_SKIPPED — A task was taken by the performer who then skipped it and won't return to it.
  • ASSIGNMENT_EXPIRED — A task was taken by the performer who failed to complete it within the time allowed or rejected it before it expired.
  • ASSIGNMENT_APPROVED — A task was completed by the performer and approved by the requester.
  • ASSIGNMENT_REJECTED — A task was completed by the performer but rejected by the requester.
String No

pool_id

ID of the pool that subscription information is requested for.

String

No

id_gt

Subscriptions with an ID greater than the specified value.

String

No

id_gte

Subscriptions with an ID greater than or equal to the specified value.

String

No

id_lt

Subscriptions with an ID less than the specified value.

String

No

id_lte

Subscriptions with an ID less than or equal to the specified value.

String

No

created_gt

Subscriptions created after the specified date. The date is specified in UTC in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

No

created_gte

Subscriptions created after or on the specified date. The date is specified in UTC in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

No

created_lt

Subscriptions created before the specified date. The date is specified in UTC in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

No

created_lte

Subscriptions created before or on the specified date. The date is specified in UTC in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

No

sort

Parameters for sorting in ascending order:

  • id — Subscription ID.

  • created — Subscription creation date in YYYY-MM-DD format, UTC.

You can separate parameters with a comma.

To change the sorting direction to descending, add the minus sign before the parameter. For example, sort=-id.

String

No

limit

Limit on the number of results to return. By default — 50; maximum — 100000.

Number

No

Parameter

Overview

Data type

Required

event_type

Event type.

Acceptable values:

  • POOL_CLOSED — The pool is closed.
  • DYNAMIC_OVERLAP_COMPLETED — An aggregated result appeared after dynamic overlap.
  • ASSIGNMENT_CREATED — A task was created.
  • ASSIGNMENT_SUBMITTED — A task is completed and waiting for acceptance by the requester.
  • ASSIGNMENT_SKIPPED — A task was taken by the performer who then skipped it and won't return to it.
  • ASSIGNMENT_EXPIRED — A task was taken by the performer who failed to complete it within the time allowed or rejected it before it expired.
  • ASSIGNMENT_APPROVED — A task was completed by the performer and approved by the requester.
  • ASSIGNMENT_REJECTED — A task was completed by the performer but rejected by the requester.
String No

pool_id

ID of the pool that subscription information is requested for.

String

No

id_gt

Subscriptions with an ID greater than the specified value.

String

No

id_gte

Subscriptions with an ID greater than or equal to the specified value.

String

No

id_lt

Subscriptions with an ID less than the specified value.

String

No

id_lte

Subscriptions with an ID less than or equal to the specified value.

String

No

created_gt

Subscriptions created after the specified date. The date is specified in UTC in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

No

created_gte

Subscriptions created after or on the specified date. The date is specified in UTC in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

No

created_lt

Subscriptions created before the specified date. The date is specified in UTC in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

No

created_lte

Subscriptions created before or on the specified date. The date is specified in UTC in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

No

sort

Parameters for sorting in ascending order:

  • id — Subscription ID.

  • created — Subscription creation date in YYYY-MM-DD format, UTC.

You can separate parameters with a comma.

To change the sorting direction to descending, add the minus sign before the parameter. For example, sort=-id.

String

No

limit

Limit on the number of results to return. By default — 50; maximum — 100000.

Number

No

To get a full list of subscriptions in parts (for example, 10 subscriptions at a time), use a combination of parameters in requests:

GET /api/v1/webhook-subscriptions?sort=id&limit=10
Host: https://sandbox.toloka.yandex.ru
Authorization: OAuth <OAuth token>
GET /api/v1/webhook-subscriptions?sort=id&limit=10&id_gt=<ID of the last subscription from the previous response>
Host: https://sandbox.toloka.yandex.ru
Authorization: OAuth <OAuth token>

Response

Contains a list of subscriptions with information about each of them in JSON format.

{
  items:
  [
    {  
       "webhook_url": "https://awesome-requester.com/toloka-webhook",
       "event_type": "ASSIGNMENT_CREATED",
       "pool_id": "121212",
       "id": "webhook-subscription-1",
       "created": "2020-02-03T15:00:00"
    },
    {
       "webhook_url": "https://awesome-requester.com/toloka-webhook",
       "event_type": "POOL_CLOSED",
       "pool_id": "121212",
       "id":"webhook-subscription-2",
       "created": "2020-02-03T15:00:00" 
    },
  ],
  has_more: false  
}
Key descriptions
Key Value Data type

items

An object with information about the requested subscriptions.

Array

webhook_url

The URL that notifications will be sent to.

String

event_type

Event type.

Acceptable values:

  • POOL_CLOSED — The pool is closed.
  • DYNAMIC_OVERLAP_COMPLETED — An aggregated result appeared after dynamic overlap.
  • ASSIGNMENT_CREATED — A task was created.
  • ASSIGNMENT_SUBMITTED — A task is completed and waiting for acceptance by the requester.
  • ASSIGNMENT_SKIPPED — A task was taken by the performer who then skipped it and won't return to it.
  • ASSIGNMENT_EXPIRED — A task was taken by the performer who failed to complete it within the time allowed or rejected it before it expired.
  • ASSIGNMENT_APPROVED — A task was completed by the performer and approved by the requester.
  • ASSIGNMENT_REJECTED — A task was completed by the performer but rejected by the requester.

String

pool_id

ID of the pool that the subscription was created for.

String

id

ID of the subscription.

String

created

The date and time when the subscription was created (UTC). It uses ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

has_more

Shows whether the list is complete.

Acceptable values:

  • true — Not all elements are included in the output due to restrictions in the limit parameter.

  • false — The output lists all the items.

Boolean

Key Value Data type

items

An object with information about the requested subscriptions.

Array

webhook_url

The URL that notifications will be sent to.

String

event_type

Event type.

Acceptable values:

  • POOL_CLOSED — The pool is closed.
  • DYNAMIC_OVERLAP_COMPLETED — An aggregated result appeared after dynamic overlap.
  • ASSIGNMENT_CREATED — A task was created.
  • ASSIGNMENT_SUBMITTED — A task is completed and waiting for acceptance by the requester.
  • ASSIGNMENT_SKIPPED — A task was taken by the performer who then skipped it and won't return to it.
  • ASSIGNMENT_EXPIRED — A task was taken by the performer who failed to complete it within the time allowed or rejected it before it expired.
  • ASSIGNMENT_APPROVED — A task was completed by the performer and approved by the requester.
  • ASSIGNMENT_REJECTED — A task was completed by the performer but rejected by the requester.

String

pool_id

ID of the pool that the subscription was created for.

String

id

ID of the subscription.

String

created

The date and time when the subscription was created (UTC). It uses ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

has_more

Shows whether the list is complete.

Acceptable values:

  • true — Not all elements are included in the output due to restrictions in the limit parameter.

  • false — The output lists all the items.

Boolean