Subscriptions

Subscriptions define how data is provided to a Squirro project.Subscriptions are attached to Objects.

Methods

List Subscriptions

GET https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/objects/{id: object_id}/subscriptions

Returns an array of all subscriptions on an object.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
Query Parameters:
  • filter_deleted (optional) – If set to true all deleted subscriptions are filtered out.
Headers:See Common Headers.
Status Codes:
  • 200 – Array of subscriptions is returned.

See also Common Status Codes.

Returns:

Array of subscriptions.

[
    {
        "title": "Squirro",
        "deleted": false,
        "processed": true,
        "modified_at": "2014-06-24T14:44:05",
        "seeder": null,
        "provider": "twitter",
        "source_id": "MrGpdl_3TLmPLm5sj36XPw",
        "paused": false,
        "link": "https://twitter.com/squirro",
        "config": {
            "username": "squirro"
        },
        "id": "v-Jn3eOVQB2fyWRLkQKNvg"
    }
]

Create Subscription

POST https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/objects/{id: object_id}/subscriptions

Adds a new subscription to the object.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
Form Parameters:
  • provider – The data provider that is used for the subscription.
  • config – JSON-encoded dictionary of the subscription configuration. The contents is dependent on the provider.
  • link (optional) – The link to the source in the source system. For example the link to the Twitter profile of a Twitter user. Most providers will calculate this automatically if left empty.
  • private (optional) – Boolean flag indicating whether this is a private subscription. Most subscriptions are de-duplicated across projects for improved usability and decreased storage requirements. Private subscriptions however are not de-duplicated, so setting this makes sure that data is restricted to one project.
Headers:See Common Headers.
Status Codes:
  • 201 – Subscription created.

See also Common Status Codes.

Returns:

The created subscription.

{
    "title": "@squirro",
    "deleted": false,
    "processed": true,
    "modified_at": "2014-12-17T17:13:26",
    "seeder": null,
    "provider": "twitter",
    "source_id": "Ktj-t6ArTRKBmxLqcDXixw",
    "paused": false,
    "link": "https://twitter.com/squirro",
    "config": {
        "username": "squirro"
    },
    "id": "4y6tFv8ZRaOa4FlwxSPzOA"
}
  • processed is set to true as soon as the first batch of items from that source is available for searching.

Get Subscription

GET https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/objects/{id: object_id}/subscriptions/{id: subscription_id}

Return details about an individual subscription.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
  • subscription_id – Subscription identifier.
Headers:See Common Headers.
Status Codes:
  • 200 – Subscription returned.

See also Common Status Codes.

Returns:

The subscription.

{
    "title": "@squirro",
    "deleted": false,
    "processed": true,
    "modified_at": "2014-12-17T17:13:26",
    "seeder": null,
    "provider": "twitter",
    "source_id": "Ktj-t6ArTRKBmxLqcDXixw",
    "paused": false,
    "link": "https://twitter.com/squirro",
    "config": {
        "username": "squirro"
    },
    "id": "4y6tFv8ZRaOa4FlwxSPzOA"
}

Update Subscription

PUT https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/objects/{id: object_id}/subscriptions/{id: subscription_id}

Updates a subscription. The provider of the subscription can not be modified after creation, just the configuration is editable.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
  • subscription_id – Subscription identifier.
Form Parameters:
  • config – JSON-encoded dictionary of the subscription configuration. The contents is dependent on the provider.
Headers:See Common Headers.
Status Codes:
  • 200 – Subscription updated.

See also Common Status Codes.

Returns:

The modified subscription.

{
    "title": "@mymemonic",
    "deleted": false,
    "processed": true,
    "modified_at": "2014-12-17T17:19:05",
    "seeder": null,
    "provider": "twitter",
    "source_id": "OEt5xjs4TlmnyNMiMpnSXQ",
    "link": "https://twitter.com/mymemonic",
    "paused": false,
    "config": {
        "username": "mymemonic"
    },
    "id": "4y6tFv8ZRaOa4FlwxSPzOA"
}

Delete Subscription

DELETE https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/objects/{id: object_id}/subscriptions/{id: subscription_id}

Delete a subscription.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
  • subscription_id – Subscription identifier.
Form Parameters:
  • config – JSON-encoded dictionary of the subscription configuration. The contents is dependent on the provider.
Headers:See Common Headers.
Status Codes:
  • 204 – Subscription deleted.

See also Common Status Codes.

Pause Subscription

POST https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/objects/{id: object_id}/subscriptions/{id: subscription_id}/pause

Pauses a subscription.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
  • subscription_id Subscription identifier.
Headers:See Common Headers.
Status Codes:
  • 200 – No change, subscription was already paused.
  • 204 – Subscription is paused.

See also Common Status Codes. 

Resume Subscription

POST https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/objects/{id: object_id}/subscriptions/{id: subscription_id}/resume

Resumes a paused subscription.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
  • subscription_id – Subscription identifier.
Headers:See Common Headers.
Status Codes:
  • 200 – No change, subscription was already active.
  • 204 – Subscription is resumed.

See also Common Status Codes.