![]() | Insomnia is a free cross-platform desktop application that takes the pain out of interacting with HTTP-based APIs. Insomnia combines an easy-to-use interface with advanced functionality like authentication helpers, code generation, and environment variables It can be downloaded from www.insomnia.rest. |
This tutorial describes how to use the Connect API with Insomnia.
Before making an API call to Connect, create an API key in Connect. Follow the instructions in Creating API Tokens to create a token with type “Custom” and copy the token by using the Copy icon on the Tokens screen.
Note the API endpoint value on the Extensions > General screen:
Insomnia has the following two concepts of organizing the data:
{{ base_url }}
placeholder.GET {{ base_url }}/assets
call will retrieve all AssetsFirst, download the API specification from our OpenAPI specification page. After that, open Insomnia and click on the arrow next to Insomnia name. Then, select “Import/Export“:
In the opened dialog click “Import Data” > “From File“:
In the File Open dialog window, navigate to the .yml file with the API specification, click Import
After the workspace import is complete, click “No environment” > “Manage Environments“
In the “Manage Environments” window set the content of “OpenAPI env” to the following: TODO check once API public
{
"apiKey": "<API key from previous section>",
"base_path": "/public/v1",
"host": "api.connect.cloudblue.com",
"scheme": "https"
}
And click “Done“.
To make the first API call, in the main Insomnia screen expand the Assets folder on the left and click on “
GET /assets
“. Then, click “Send“
The result of the API call will appear at the right side of the Insomnia window.
For more information, please refer to the Getting Started with Insomnia.