REST API

Introduction

The Timespace platform has a REST API that enables creating and finding records, as well as listening to changes.

Authentication

All requests must include a valid Cookie for a user or robot user.

Robot Users

To create a Robot user and obtain a cookie:

  1. Navigate to a cloud that will own the robot user
  2. Switch to the feed view
  3. Add a new robot user
  4. Give the robot user at least read permissions to the cloud that contains it
  5. Give the robot user permissions as needed to clouds (e.g. if you want it to be able to find or create records)
  6. Use the robot user's "Get API Key" action to obtain a cookie

Single Records

CRUD Operations

POST /template_id/language/rest

  • create a new record based on a template

GET /record_id/language/rest

  • returns all fields

PATCH /record_id/language/rest (upcoming)

  • create new version of record, include fields to modify

DELETE /record_id/language/rest (upcoming)

  • marks a record deleted

Schema

GET /record_id/language/rest?schema=editable

  • list the editable field schema in a format compatible with Zapier

List Records

By Type

GET /type_id/language/rest?limit=n&offset=m&freetext=x&all_clouds=bool

  • lists records of type type_id
  • use the record type to include all types of records
  • up to limit (required) with optional offset
  • specify search keywords with `freetext``
  • by default will search the user's clouds or where they are explicitly mentioned, but all_clouds=true enables you to remove this restriction

My clouds

GET /0/language/rest?my_clouds=true

  • lists clouds in my clouds (for normal users)
  • lists clouds that explicitly grant permissions (for robot users)

REST Hooks

REST hooks enable you to listen to changes by submitting an url that will be called when a record is created or modified matching certain conditions.

Subscribe

POST /type_id/language/rest_hooks

  • type_id: listen to changes for this type of records (use the Record type for all)
  • hook_url: A unique URL to make a POST with all fields when a matching record changes
  • cloud (optional): limit listening to a specific cloud

Unsubscribe

DELETE /0/language/rest_hooks

  • include a json body with:
  • hook_url: A previously registered unique URL