cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
There are various ways to send API call commands in Sisense, the two basic common ways we use today are:
  1. Admin UI Swagger interface
  2. 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: 

image2016-11-10_16-16-9.png

Choosing the cURL will display the code:

image2016-11-10_16-17-53.png

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:
image2016-11-10_16-23-37.png
 
 
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.
Rate this article:
Version history
Last update:
‎02-09-2024 09:21 AM
Updated by: