Use Swagger for syncing context items from an SQL database
Attention
The Swagger UI in TrendMiner is provided as is and might be exposed to bugs, incomplete or wrong documentation and might become unavailable in this or future releases.
What is Swagger?
The Swagger interface is a graphical UI to perform API calls to the TrendMiner server in a fast, structured way. It offers the convenience of listing all available API endpoints in one place, with the option to rapidly execute them and retrieve the responses, without any coding or the need for 3rd party tools like Postman involved.
How to use the Swagger UI?
To navigate to the Swagger interface, the first order of business is to find the right service you’re trying to use. For example, to configure Context SQL synchronizations, the service is called context-sql-sync, and the Swagger UI can be found at:
<TM-URL>/context-sql-sync/swagger-ui.html
The next thing is to authorize Swagger to perform API calls. This is done through the Authorize button found near the top of the webpage.

To authenticate in Swagger use “client_credentials”. These can be created in ConfigHub in the Security & Clients menu. Copy-paste the client id and client secret in the text fields and authorize Swagger. If it was successful, the Authorize button below the text fields will change to “Logout”. You can now close the popup and use any API that the client is authorized for.

Now, select the API you want to use and click the “Try it out” button on the right hand side.

Fill out any required inputs and hit execute. Successful responses will typically range in the 200’s and show a server response. Typical errors such as 401 (unauthorized) could indicate you do not have permission to perform the operation.
