This is the API for Apollo. Apollo's API are JSON only.
Use HTTP verbs (GET/POST/PUT/DELETE) to manipulate resources.
Authentication is managed using HTTP Basic authentication. Every request must include the Authorization HTTP header. Use your API token as the username, and "X" (or some otherwise bogus text) as the password (only the API token is used for authenticating API requests). Example with Curl:
curl 'Content-Type: application/json' \
-u 1kdye8r743kdjks9302848582ks00wjabgcvgs22:X -d '... ' https://url
Apollo API's are accessible only under HTTPS. So HTTPS is 100% supported with valid certificate for all API methods.
Some operations, like creating messages or comments, or updating existing messages or comments, allow you to attach a file to the record. To do this via the API, you need to send a POST request to the "/upload" URI, with the HTTP Accept header set to 'application/xml'. The body of the request should be the content of the file you want to attach:
POST /upload HTTP/1.0
Content-Type: application/octet-stream
Content-Length: 23123
... (file contents go here)
If the upload succeeds, you'll get a JSON response back, telling you the ID of your upload. (Your upload is not yet associated with any record, and if you do not do anything with it, it will be deleted sometime within the next 30 minutes.)
{
"attachment-id":"1948745"
}
Armed with the ID, your next step is to attach the file to a record. Using the "create message" action, for instance, you pass an array of attachment data in. Assuming you had two files you wanted to attach (which you had previously uploaded, as described), your attachment data would look something like this (formatted as JSON):
{
"message":{
"title":"Updated message",
"attachments":["1948745", "1948746"]
}
}