Objects

Objects are used to group the sources in a project. Most projects don't need more than the default object which is added automatically on project creation.

Methods

List Objects

For pagination support, please consult the "v1" endpoint of the objects API described below.

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

Returns an array of all objects in the project.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
Headers:See Common Headers.
Status Codes:
  • 200 – Array of objects dictionaries is returned.

See also Common Status Codes.

Returns:

Array of objects.

[
   {
      "title": "object1", "id": "09MVue3gRqaTrTlO-aBgMQ", "type": null,
      "seeder": "salesforce"
   },
   {
      "title": "default", "id": "6Wr8nvPhRSaKif-Vah6iRg", "type": "default",
      "seeder": null
   }
]

 

GET https://squirro-endpoint/api/topic/v1/(string: tenant)/projects/(id: project_id)/objects

Returns a paginated list of all objects for the project.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • start – Index of the first object to be returned, useful for pagination (default: 0).
  • count – Number of objects returned (default 100).
Headers:See Common Headers.
Status Codes:
  • 200 – Array of objects dictionaries is returned.

See also Common Status Codes.

Returns:

Array of objects.

{
	'start': 0,
	'count': 100,
	'objects': [
   		{
      		"title": "object1", "id": "09MVue3gRqaTrTlO-aBgMQ", "type": null,
      		"seeder": "salesforce"
   		},
   		{
      		"title": "default", "id": "6Wr8nvPhRSaKif-Vah6iRg", "type": "default",
      		"seeder": null
   		}
	]
}

Please note that the response in the example above has been cut to display only 2 objects out of otherwise 100 objects.

Create Object

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

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
Form Parameters:
  • owner_id – User identifier that owns the object.
  • title – Descriptive title of the object (optional, any string, max. 200 characters).
  • seeder – The seeder that owns this object (optional, any string, max. 20 characters).
Headers:See Common Headers.
Status Codes:
  • 201 – Object was created.

See also Common Status Codes.

Returns:

Object with object and project identifier.

{
   "id": "8aGYz97eT-yVeunA_9Zzmg",
   "project_id": "sDWhzUBBSA2KDltH2u0Yaw"
}

 

POST https://squirro-endpoint/api/topic/v1/(string: tenant)/projects/(id: project_id)/objects

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
Form Parameters:
  • owner_id – User identifier that owns the object.
  • title – Descriptive title of the object (optional, any string, max. 200 characters).
  • seeder – The seeder that owns this object (optional, any string, max. 20 characters).
Headers:See Common Headers.
Status Codes:
  • 201 – Object was created.

See also Common Status Codes.

Returns:

Object with object and project identifier.

{
   "id": "8aGYz97eT-yVeunA_9Zzmg",
   "project_id": "sDWhzUBBSA2KDltH2u0Yaw"
}

Get Object

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

Returns information about a single object.

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

See also Common Status Codes.

Returns:

Object information.

{
   "id": "8aGYz97eT-yVeunA_9Zzmg",
   "title": "Python",
   "weight": 0.0,
   "subscriptions": [
      "wTXdjK6aRBqpqYRV8w9x0A", "NKrPIPewTy-HYN7lZrimGg"
   ],
   "subscriptions_processed": true,
   "paused": false,
   "seeder": null
}
  • subscriptions_processed is set to true when all subscriptions are processed. A subscription is considered processed, when its first batch of items from is available for searching.
  • paused is set to true if and only if all subscriptions on the object are paused.

Update Object

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

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
JSON Data:

Data is passed in as a JSON object.

Valid object keys:

  • title – Descriptive title of this object (max. 200 characters).
  • is_ready (optional, boolean) – Seeders should set this to true as soon as it’s been sourced.
  • subscribed_to (optional, boolean) – Used to mark a object as subscribed.
Headers:See Common Headers.
Status Codes:
  • 200 – Array of objects dictionaries is returned.

See also Common Status Codes.

Example request:

PUT /v0/example/projects/O8Yz-mpLSK-O7FR_aWzvmQ/objects/8aGYz97eT-yVeunA_9Zzmg
Host: topic-api.squirro.com
Accept: application/json
Content-Type: application/json

{"title": "New object title"}

Delete Object

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

Returns an array of all objects in the project.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
Headers:See Common Headers.
Status Codes:
  • 204 – Object was deleted.

See also Common Status Codes.

Pause Object

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

Pauses all subscriptions of an object.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
Headers:See Common Headers.
Status Codes:
  • 200 – No change, all subscriptions in the object were already paused.
  • 204 – All object subscriptions were paused.

See also Common Status Codes.

Resume Object

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

Resumes all existing subscriptions of an object.

Parameters:
  • tenant – User tenant.
  • project_id – Project identifier.
  • object_id – Object identifier.
Headers:See Common Headers.
Status Codes:
  • 200 – No change, all subscriptions in the object were already active.
  • 204 – All object subscriptions were resumed.

See also Common Status Codes.

Pausing an object only affects the existing subscriptions. When adding a new subscription to a paused object, the new subscription will not be paused. As a consequence thereof the object will no longer be in a paused state.