Using Postman with ThoughtSpot APIs

ThoughtSpot provides a rich suite of APIs for search, user controls, and platform metadata. These APIs can be especially useful for sharing data with partners via webhooks, building native mobile apps, providing results in json format for third-party charting libraries like D3, or scripting ThoughtSpot configuration to support devops and continuous integration toolchains. 

When learning or testing APIs, I often like to start with a tool like Postman. Postman allows me to set up my API endpoints and get request headers and parameters correct before I start adding commands to any sort of larger process. This way, I know my API calls are correct and always have a way of testing independently of other systems. I’ve created a quick collection of ThoughtSpot endpoints to get you started.

This collection contains a number of common API endpoints you are likely to encounter when beginning with ThoughtSpot APIs. Most importantly, it contains the login and authentication calls you will need for every single project. Using this resource as a starting point, you’ll be able to quickly duplicate and add more endpoints as needed by looking at the API reference docs

Download ThoughtSpot Postman Collection

Global environment variables

domain The url of the cloud instance you are connecting to. For a trial instance, it is https://try.thoughtspot.cloud/callosum/v1
username

The username of your ThoughtSpot account

password

The password of your ThoughtSpot account

<br>Collections and variable substitution

Now that you have your environment variables configured, you can import the ThoughtSpot collection by navigating to Collections > Import, and selecting the file you downloaded earlier. 

<br>To keep things neat, I try to adopt a naming convention that begins with a prefix which identifies the category and ends with what the function does. This makes it easy for me to find the function I need and aligns well with how the API docs are categorized. In the example below, I am using the Connection API to list all CDW connections I have in my ThoughtSpot instance. You can also see in the URL field the use of the {{domain}} variable we created. In order to ensure you are using the correct values, don’t forget to select the environment from the dropdown on the top right of the workspace. 

<br>With your collections ready to go, all you have to do is set the variables for each request and tap send. Postman gives you a great response window to interrogate payloads, complete with color coded response codes and support for json formatting. 

Get started in the Developer Playground today

We only scratched the surface of what you can do with Postman and the ThoughtSpot APIs. This collection of common API endpoints should help you get started quickly. Over time, more endpoints will be added to the collection as needed. To ensure you always get notified of any additions, make sure you watch or star the repo. And, of course, if you  add other ThoughtSpot APIs to the collection, please create a pull request to help other developers.

Happy coding!