Links
Comment on page

Requests and filters

All requests to the Dashdoc API must be made over SSL (https, not http).
We recommend using JSON body format when performing API requests. In order to do a proper JSON-formatted request, make sure you provide Content-Type: application/json in HTTP request headers. XML data is also supported, see Sending XML data.
Our API uses the HTTP verbs for each action:\
Method
Description
GET
Used for retrieving resources.
POST
Used for creating resources.
PUT
Used for replacing resources or collections.
PATCH
Used for partially updating resources or collections.
DELETE
Used for deleting resources.

URL Naming

Our API uses a straight-forward URL naming convention.
Always specify the API version in your calls ; /api/ automatically redirects to the latest available version of the API.
  • Each request must be made to the API endpoint https://www.dashdoc.com/api/v3/, followed by the type of object in a plural form, for example https://www.dashdoc.com/api/v3/transports/
  • When one item is being asked and such method exists, the UID of the item must be appended to the URL, for examplehttps://www.dashdoc.eu/api/v3/transports/51d1a23d-79de-4280-8e10-1a0309f3fc54/
  • The API token must be provided as part of the http header for all requests using the Authorization field:
Example of curl authenticated request
curl -X GET -H "Authorization: Token 5a4d02fad3975c169e9f538d8e733ead4069703x" "https://www.dashdoc.eu/public-api/v2/"

Filters

You can pass in filters to indicate which data you would like to fetch when asking for a collection/list of objects. When provided, you can add comparison filters that are separated from the field a double underscore:
Filter
Description
__gt
Greater than
__gte
Greater than or equal
__lt
Lower than
__lte
Lower than or equal
__in
Filter among multiple values, separated by commas
__exclude
Exclude multiple value, separated by commas
__not
Exclude single value
Most endpoints in our API support this.
For example, you may only want to fetch transports that were updated after a given date. We'll use the __gte to do that. This can be done using the following syntax:
get
https://www.dashdoc.eu/api
/v3/transports/?updated__gte=2018-12-31T00:00:00Z
Filtering transports on updated date