-
Notifications
You must be signed in to change notification settings - Fork 33
Web API
Autotune has a Web API built for the front-end javascript app. It can be used by other applications to do anything you're able to do with the Web UI.
The API endpoints exactly map to the application URLs you see when navigating the application. The API is entirely JSON-based. All data is returned as JSON, all request data must be JSON-formatted.
All requests must set the Accept header:
Accept: application/json
All POST, PUT, PATCH requests must set the Content-Type header:
Content-Type: application/json
Autotune requires a simple bearer token in your HTTP headers for API access:
Authorization: API-KEY auth=ABC123
You can create a machine account for accessing the API with the create_superuser
rake task:
$ rake create_superuser[[email protected]]
You can grab the API key of an existing user with the get_api_key
rake task:
$ rake get_api_key[[email protected]]
The API will emit appropriate HTTP status codes if there are errors: 4xx errors if the problem is with the request, 500 if there is an error on the server, 2xx for success.
Errors that result from a bad request (4xx) will include a JSON payload with an errors
attribute:
{ "error": "Some message" }
These error messages are intended to be presented directly to the user.
TK
TK