Call Total API over HTTP
Call any service from any language with a POST request, your token and a JSON body.
On this page
Every service is a POST request to its own address. Any language or tool that sends HTTP requests can use Total API.
The request
| Part | Value |
|---|---|
| Method | POST |
| Address | https://api.totaljs.com/{service}/, for example https://api.totaljs.com/weather/ |
Header Content-Type | application/json |
Header X-Token | Your token |
| Body | The data of the service as JSON |
curl -X POST https://api.totaljs.com/weather/ \
-H "Content-Type: application/json" \
-H "X-Token: YOUR_TOKEN" \
-d '{ "value": "Bratislava" }'The answer
- Success: status
200and the result: JSON, or the file itself for the services that create files (print and convert). - Error: status
400and a JSON array with the message:
[{ "error": "Invalid token" }]