Set up Insomnia
Insomnia by Kong provides some excellent guides for you to follow to get started.
Install
Follow this guide to install Insomnia.
Once the installation process have been completed you should see a "start page" where you can choose to create a New Collection or a New document. Click on New collection and give it a name.
Setup
Once you have a collection created, you should have Base Environment in the left pane. Click on the cog on the right and you should have a new window, Manage Environments open up. Create a new private Sub Environment with a name. Copy the JSON below to the new environment and update with your URL to Easit GO and your apikey.
1 2 3 4 |
|
You can read more about Environment Variables here.
First request
Now that we have the collection and environment set up we can create our first query.
- Either click on New HTTP Request in the middle pane or use CTRL + N.
- Change the method for the query to POST (next to the URL field almost at the top).
- In the URL field, enter _., and our variables should pop up, choose _.url.
- Just below POST, next to Body it probably says Auth. Click on it, choose Bearer Token. On the Token row, enter _.apikey.
- Just next to Bearer (previously Auth) it probably says Body, click on it and then click on it again and choose GraphQL Query.
- Now, copy and paste the example below and press Send.
Your response may vary from the example below but what you should get back is a list of available modules in Easit GO.
1 2 3 4 5 6 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
You can find the official guide from Insomnia here