Adding Cloud Accounts via Cloudaware API
Cloudaware uses OAuth standard to identify users who send requests to Cloudaware API. A current user should get a specific token to be able to add or see accounts (depending on their permissions).
Get OAuth Token
1. Log in to your Cloudaware account → Admin.
![](../__attachments/1346174978/admin.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
2. Select OAuth on the left → +Create New Token → Create Token.
![](../__attachments/1346174978/worddav683cf8b2ef3fa5191cca1426f4d8c816.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
3. Click Copy To Clipboard to copy and save the token.
![](../__attachments/1346174978/worddav8c1fd2d76790ba5f50412b3855876c76.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
4. Click Got It, Сlose Window to proceed.
![](../__attachments/1346174978/worddav9764615f8faad3dde70f72795e24a99c.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
5. Check the list of tokens provided.
You can have only 4 active tokens at time! The column 'Use Count' shows the number of times the token has been in use.
6. Note that if a token has been compromised, it must be revoked. For that, click triple dots → Revoke → Yes, Revoke.
![](../__attachments/1346174978/worddav954e445e54a983f8507a5bee06e952f7.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
7. Click +Create New Token to get a new token if necessary.
![](../__attachments/1346174978/worddav54d9498fd619b6e3770fe14dae4d179e.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
8. In case you have IP restrictions enabled in your environment, check your OAuth policies settings as below:
8.1 Log in to your Cloudaware account → Setup → Manage Apps → Connected Apps → Cloudaware OAuth2 → Edit Policies.
![](../__attachments/1346174978/worddavd4f7936650c94d5b9fb86494876a145a.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
8.2. Select 'Relax IP restrictions' in 'IP Relaxation' → Save.
![](../__attachments/1346174978/7d97fa56-7b13-49ba-b398-cc0cc9530424.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
Get API Key
The API key is required for performing requests to Cloudaware API.
1. Create a Google Cloud Project account.
2. Submit an access request to support@cloudaware.com providing the full e-mail of the associated Google Cloud Project account.
3. Activate access to Cloudaware API using API Manager: go to https://console.cloud.google.com → APIs & Services → Library → filter by Private.
![](../__attachments/1346174978/Screen%20Shot%202020-02-26%20at%2020.12.59.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
4. Select external.endpoints.cloudaware-vm.cloud.goog → Enable.
![](../__attachments/1346174978/Screen%20Shot%202020-02-26%20at%2020.22.32.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
![](../__attachments/1346174978/Screen%20Shot%202020-02-26%20at%2020.23.51.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
5. Go back to APIs & Services → Credentials → Create credentials → API Key.
![](../__attachments/1346174978/5-1.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
![](../__attachments/1346174978/5-2.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
6. Copy the API Key to the clipboard
![](../__attachments/1346174978/6.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
Add Cloud Account Using API
The Google APIs Explorer is a tool allowing to explore and test APIs.
1. Go to Google APIs Explorer using this link.
2. Select Set API key / OAuth 2.0 Client ID. Click Save.
![](../__attachments/1346174978/worddavf68f9f6a73fe79c88896fbe655082d9e.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
![](../__attachments/1346174978/worddav4aa5149220005ef96f452c4b203da8e6.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
3. Go to Services → External API v1 → select external.amazon.account.create
![](../__attachments/1346174978/worddav408b69a82d656474da06612772168f14.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
4. Insert the OAuth token generated before (see p.3) and fill out the request body as below:
![](../__attachments/1346174978/c5750cf4-0f80-4c90-81e4-86c8a801ed42.png?inst-v=8769d247-2be0-4385-8cc6-1903406f6e29)
5. Click Authorize And Execute.