cURL API usage
There are various ways to send API call commands in Sisense, the two basic common ways we use today are:
- Admin UI Swagger interface
- Postman
Another common way we could encounter, is the need of assistance in using cURL commands.
How to extract Curl from PostMan:
Here I ran a successful API call using PostMan, so I know I have open communication, the syntax is working as expected and my authorization key is correct. This is how to extract the Curl equivalent:
Choosing the cURL will display the code:
Note - There are a few parameters which are specific for PostMan and we do not require and should be removed: Cache control, Postman-token and content-type.
Result:
After beautifying the code, this is a final example of a successful cURL build command:
curl -X POST -H "Accept: application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiNTY4YmY2NWNkNmU3MWYyMGM4MzAxOTU4IiwiYXBpU2VjcmV0IjoiODgyYjRiY2MtZmNiYy05YmM0LWUwNWUtNTFiMjhjYjgxYTVlIiwiaWF0IjoxNDc4NzY3MzU4fQ.gpPEM61R-Oeqip0pr6qkjeo4TvpSLtBbgxYpnzYAhTs" -d ' ' "http://localhost:8081/api/elasticubes/localhost/Latet/startBuild?type=Entire"
A bit on cURL logic:
curl - required to identify the call format
-X - Defines the call, POST / GET / PATCH / DELETE
-H - Inserts the values to the Header
-d - Inserts the body content, if there is no body it's still essential to have empty ' ' set up per the example above.
Once all the parameters are configured, the actual URL command is inserted.
If you're not sure which URL the request is being sent to, you can either check the web network, or review the URL from our Swagger UI:

Note that also Curl is available in the UI, but it does not contain the authentication key and -d parameters so it will not work straight forward when being copied from our web.
Updated 02-09-2024
intapiuser
Admin
Joined December 15, 2022