HTTP / cURL API

While usage of the CloudTables API with cURL doesn't count as am API library, it can be instructive to demonstrate the basic HTTP REST requests to better understand the calls, particularly if you are looking to use CloudTables with a server-side environment that we don't yet have a published library for yet. If that is the case please get in touch so we can prioritize libraries for the most requested frameworks.

Embedding data sets

To embed a data set into an HTML page, you need an access token. This can be requested from the API using:

curl \
	-d 'key={apiKey}' \
	-d 'clientId=Unique client id' \
	-d 'clientName=Name' \
	https://sub-domain.cloudtables.io/api/1/access

Where:

  • {apiKey} should be replaced by the API key) that you want to use for the access.
  • The clientId and clientName parameters are optional, but we strongly recommend they are used when integrating with your own login system as it allows the identification of each client's actions in CloudTables' auditing features. Typically the clientId would be set to your login system's user id and clientName the user's username or full name.

This will return a JSON string with a token parameter. Use jq or similar to parse the JSON on the command line.

<script
	src="https://sub-domain.cloudtables.io/loader/DATASET-ID/table/d"
	data-token="{token}"
></script>

API Reference

Access

curl \
	-d 'key={apiKey}' \
	-d 'clientId=Unique client id' \
	-d 'clientName=Name' \
	https://sub-domain.cloudtables.io/api/1/access

Get an access token that can be used to securely embed a CloudTable into an HTML page. Please see the API reference documentation for a full description of the parameters available and expected return JSON string.

Data set data

curl \
	https://sub-domain.cloudtables.io/api/1/dataset/{id}/data?key={apiKey}

Get the data for a specified data set where {id} in the URL is the data set id, per the /datasets API. The data set ID can also be found in the Data set inspector of the Data tab for the data set. Please see the API reference documentation for a full description of the parameters available and expected return JSON string.

Data sets

curl \
	https://sub-domain.cloudtables.io/api/1/datasets?key={apiKey}

Get a list of all data sets which can be accessed by the role(s) available to this API key and summary information about each data set. Please see the API reference documentation for a full description of the parameters available and expected return JSON string.