Get a list of subscriptions

  1. Request
  2. Headers
  3. Query parameters
  4. Query example
  5. Response

Gets data for multiple active subscriptions.

Request

GET https://toloka.yandex.com/api/v1/webhook-subscriptions
Authorization: OAuth <OAuth token>

Headers

Title Overview
authorization A token for account authorization. Add OAuth as a prefix.
Title Overview
authorization A token for account authorization. Add OAuth as a prefix.

Query parameters

Specified in the link after the question mark; separated by &.

Parameter Overview

event_type

string

Event type.

Acceptable values:

  • POOL_CLOSED — The pool is closed.
  • DYNAMIC_OVERLAP_COMPLETED — An aggregated result appeared after dynamic overlap.
  • ASSIGNMENT_CREATED — A task is 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.

pool_id

string

ID of the pool that subscription information is requested for.

sort

string

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.

Standard query parameters limit, id_gt, id_gte, id_lt, id_lte, created_gt, created_gte, created_lt, created_lte
Parameter Overview

event_type

string

Event type.

Acceptable values:

  • POOL_CLOSED — The pool is closed.
  • DYNAMIC_OVERLAP_COMPLETED — An aggregated result appeared after dynamic overlap.
  • ASSIGNMENT_CREATED — A task is 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.

pool_id

string

ID of the pool that subscription information is requested for.

sort

string

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.

Standard query parameters limit, id_gt, id_gte, id_lt, id_lte, created_gt, created_gte, created_lt, created_lte

Query example

You can set up the display of the list of subscriptions in parts (for example, 10 subscriptions at a time):
  1. Show the first 10 subscriptions, starting with the one with the lowest ID.
  2. Show the remaining subscriptions (10 at a time) in ascending order.
Show the first 10 subscriptions
GET https://toloka.yandex.com/api/v1/webhook-subscriptions?sort=id&limit=10
Authorization: OAuth <OAuth token>
Show the remaining responses sorted by ascending ID
GET https://toloka.yandex.com/api/v1/webhook-subscriptions?sort=id&limit=10&id_gt=<ID of the last subsciption from the previous response>
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  
}
Parameter Overview

items[]

array of objects

An array of objects with information about the requested subscriptions.

webhook_url

string

The URL that notifications will be sent to.

event_type

string

Event type.

Acceptable values:

  • POOL_CLOSED — The pool is closed.
  • DYNAMIC_OVERLAP_COMPLETED — An aggregated result appeared after dynamic overlap.
  • ASSIGNMENT_CREATED — A task is 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.

pool_id

string

ID of the pool that the subscription was created for.

id

string

ID of the subscription.

created

string

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

has_more

boolean

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.

Parameter Overview

items[]

array of objects

An array of objects with information about the requested subscriptions.

webhook_url

string

The URL that notifications will be sent to.

event_type

string

Event type.

Acceptable values:

  • POOL_CLOSED — The pool is closed.
  • DYNAMIC_OVERLAP_COMPLETED — An aggregated result appeared after dynamic overlap.
  • ASSIGNMENT_CREATED — A task is 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.

pool_id

string

ID of the pool that the subscription was created for.

id

string

ID of the subscription.

created

string

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

has_more

boolean

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.