How to Connect To Your Octopus Deploy Cloud API
To start setting up your Octopus Deploy API connection you will need an API Key. First, you need to connect to your Octopus Deploy cloud instance and log into your app https://<yourapp>.octopus.app to create an API key.
Once you have logged in, click on your 'Name' at the top right of the window.
Next, click 'Profile'.
Next, click 'My API Keys'.
Next, click 'New API Key'.
'Type in your 'Purpose', I put in 'PowerBI Reporting', then click 'Generate New'.
After the key is generated, be sure to copy it and keep it in a safe place. Then click 'Close'.
You should now see your application listed in your 'API Keys'.
Now that you have your API key, you will be able to connect to your cloud instance API.
There are several ways of testing your API key. If you are familiar with the program called 'PostMan', you can use that, or if you want to, you can use the built-in 'swagger' component in your API. Navigate to https://<yourapp>.octopus.app/swaggerui/.
Once you navigate, you should see a list of all APIs available to you. Click on the 'Authorize' button.
Take the API key saved from earlier, and paste it into each of the three 'Value' text boxes, and then click 'Authorize' on each.
Once you have completed all three, you should see 'Logout' buttons appear where the 'Authorize' buttons were. Now you click the 'X'. To close the pop-up.
Now search in your browser for 'Reporting' (or scroll down near the bottom), and you will see the various reporting API's available. Go ahead and click on the '/api/reporting/deployments/xml' API.
Once it has expanded, click on the button 'Try it out'.
Next, click 'Execute'.
If the execution is successful, you will see the returned code '200', and you will see in the response body XML data with your deployment history.
Now, in the green highlighted area on my screenshot below, you will notice the URL and API key. This is what you will need later for PowerBI, so be sure and copy that and save that.