Space v1: get started tutorial
Number of APIs: 3
Super Cool Space Collection
This is a sample collection and environment for the tutorial outlined in Not your Grandma's Qodex. Read the collection documentation here.
Retrieve the Astronomy Pic of the Day from NASA, get an Imgur auth token, and then post the picture to Imgur.
If you haven't already, click the Run in Qodex button to get the collection and environment into your Qodex app. In the Qodex app, you should now see this collection in the sidebar to the left, and this environment selected in the dropdown in the top right.
To get started:
- Register an Imgur app:
Head to Imgur and register a new application. Select OAuth 2 authorization with a callback URL, and add the following Authorization callback URL - https://www.getQodex.com/oauth2/callback
.
Make a note of your Imgur app's Client ID
and Client secret
.
- Add your Imgur credentials to Qodex:
In the Qodex app, head to the Quick Look icon in the top right to view your variables. Click the Edit link.
Update the imgurClientId
and imgurClientSecret
values with your own, and hit Update.
- Get an auth token from Imgur:
We will use Imgur's OAuth 2.0 process to get a refresh token.
In the Qodex app, under a new request, click on the Authorization tab, select OAuth 2.0, click on the Get New Access Token button, and fill in these values:
- Token Name: can be anything
- Auth URL: https://api.imgur.com/oauth2/authorize
- Access Token URL: https://api.imgur.com/oauth2/token
- Client ID: {{imgurClientId}}
- Client Secret: {{imgurClientSecret}}
- Grant Type: Authorization Code
- Request access token locally: checked
Click on Request Token to initiate the OAuth 2.0 flow authorizing the Qodex app to connect to your Imgur account.
Once that is completed, add the refresh_token
value to your environment under the imgurRefreshToken
key, the same way you added your Imgur credentials to Qodex in Step 2.
- Run the collection:
Click on the right angle bracket (>) next to the collection to open the collection details flyout, and click the blue Run button.
This will open the collection runner in a separate window. Verify that the correct collection and environment is selected in the respective dropdowns, and then click the Start Run button.
In the collection runner, watch your tests running (and hopefully passing). If all goes well, your picture has been posted privately to Imgur under your account.