Requests
All requests to the Trail API must be made over SSL (https, not http).
Our API supports UTF-8 for character encoding. Unless stated otherwise, all of the Trail APIs will expect to receive a JSON request body. Ensure you have added the Content-Type HTTP header to your request: Content-Type: application/json
Each endpoint is controlled by HTTP verbs, the different verbs will determine how the API handles the resources:
| Method | Description |
|---|---|
GET | Used for retrieving resources |
POST | Used for creating resources |
PATCH | Used for updating some parts of a resource |
URL naming
Our API uses a straightforward URL naming convention.
Base Url: https://api.gettrail.com/api/v1
Each request must be made to the API endpoint , followed by the type of object in a plural form, for example,
https://api.gettrail.com/api/v1/assetsWhen one item is being asked, and such a method exists, the ID of the item must be appended to the URL, for example
https://api.gettrail.com/api/v1/assets/2