Skip to main content

Overview

Does Technolutions Slate have an API? ๐Ÿค”

We get this question all the time, and the answer is...it's complicated. Slate doesn't offer a pre-defined, monolithic API. Instead, it has tools that allow you to define your own REST-like API's.

  • Slate Endpoints โšก
    • HTTP GET: use Query Builder to define a web service to extract data from Slate
    • HTTP POST: use Source Formats to push data to Slate
  • External Endpoints โŒš
    • HTTP GET: use Source Formats to pull data from a third-party API
    • HTTP POST: use Query Builder to push data to a third-party AP

โšก These option are initiated outside of Slate and execute immediately.
โŒš These options are initiated by a Slate cron job.

The Query Builder is a powerful tool for building SQL queries with a graphical interface. Custom SQL is allowed but strongly discouraged.

Source Formats are a little less user-friendly; you can define the structure of your import with XML or provide a sample Excel file to be automatically parsed. Then you map each source field to its destination, potentially with value mappings.

Both tools default to exporting and importing Excel files but can become web services with a few clicks. Queries can be authenticated or anonymous, but Source Formats require authentication.

Even more information can be found in Slate's officialย documentation.

In June 2023, Technolutions announced the Slate Open API, a โ€œrealโ€ API with endpoints for all objects accessible via Configurable Joins. The API will be self-documenting and include machine-readable definitions.

Initially, it will be read-only.

Queuing

How can I get only new rows?

When using Query Builder, you can choose to export all data each time or to export only new data. What's considered "new data" is controlled by the primary key for the particular query. When this option is enabled, each query internally tracks which primary keys have already been returned in a previous query run.

Defining a secondary key will return each unique combination of Row X + Row Y only once, which has many clever uses.

How can I get only changed rows?

There's a system-wide queue for major tables (people, applications) that tracks when each row was last updated. You can set your query to only return rows that have been updated since the last query run. Note that any change to a person or application will cause them to enter the queue - not just the fields on your particular query. For this reason, this option is a little crude.

What happens when I push data to Slate?

Data isn't instantly imported. Rather, it enters an upload queue that processes about every 10 minutes. ๐Ÿ•’ Once imported, the new record you created or existing record you updated (optionally) enters the aforementioned person/application update queue. As part of this queue, the automation rules will re-evaluate the person/application and potentially make changes. In this way, you can set up rules to do stuff based on your data push.

Are there limits on web services?

There is a per-instance web service rate limit of 300 seconds of CPU time in a rolling, 5-minute window. We don't know how precisely this is enforced.

Theoretically, you can run a 5-minute query every five minutes or a 1-second query every second, but you cannot run a 10-second query every 5 seconds indefinitely, as you will hit the rate limit on the 31st execution.

The most common performance issues are waiting for a Source Format to ingest data or waiting for a poorly-written query to run.

More Esoteric Options

You can also:

  • Enable JSONP with Query web services.
  • Receive a confirmation webhook from Slate when data is imported.
  • Configure a Query to POST to a remote endpoint on a schedule.
  • Configure a Query as a Materialized View (SQL table) and refresh it on a schedule. Useful for very large, slow queries.
  • Use certificate-based authentication and PGP.
  • Configure a Query to export to a Source Format (i.e. round trip within Slate). When combined with custom SQL, this allows automation beyond what's possible with the built-in Rules.
  • POST data to a Slate Portal custom SQL method and instantly write to the database (Danger, Will Robinson!). ๐Ÿค–
  • Import and export SFTP (ick!)
  • Import and export PDF's and DIP formats, which is a whole different ball of wax. ๐Ÿ
  • Nested dicts in JSON or XML are possible but are beyond the scope of this article.