User Authentication
To use the API you will first need an API Key and API Secret. Most requests require a signature in order to validate the request.
Signing GET Requests
-
Sort your parameters alphabetically by name. For example, if you are trying to retrieve a list of files in a particular location and use the following parameters:
- path: “%2F” (the url-encoded version of "/")
- sort_by: “date_asc”
- api_key: “key”
You would form your URL as such:
https://<your subdomain>.<your domain>/api/file_list?api_key=key&path=%2F&sort_by=date_asc×tamp=<current time> -
Using the URL, create a signature using HMAC-SHA256, using the SHA1 hash of your API secret as the key. An example in PHP would look like this:
$signature = hash_hmac(‘sha256’, <URL from above>, sha1(<your API secret>)); -
Add this signature as a parameter to the end of your URL like this:
https://<your subdomain>.<your domain>/api/file_list?api_key=key&path=%2F&sort_by=date_asc×tamp=<current time>&signature=<signature>
Signing POST/PUT/DELETE Requests
-
Simply pass the URL of the API method into your HMAC-SHA256 signature creator. An example in PHP:
$signature = hash_hmac(‘sha256’, ‘https://<your subdomain>.<your domain>/api/file_upload’, sha1(<your API secret>)); - Pass the signature as a parameter in your POST/PUT/DELETE body along with your other parameters.