Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update insights API programmatic access document #595

Merged
merged 3 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed en/docs/assets/img/insights/generate-test-token.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions en/docs/insights/programmatic-access-choreo-insights-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,23 @@ To create an application and generate keys, follow the steps below:

![Generate-Credentials](../assets/img/insights/generate-credentials.png){.cInlineImage-full}

5. Specify a suitable token expiry time and generate a token by clicking **Generate Test Token**.
5. Specify a suitable token expiry time and click **Update**.

![Generate-Test-Token](../assets/img/insights/generate-test-token.png){.cInlineImage-full}
![Generate-Test-Token](../assets/img/insights/update-token-expirary-time.png){.cInlineImage-full}

6. Execute the following curl command to generate an access token.
RAVEENSR marked this conversation as resolved.
Show resolved Hide resolved

```bash
curl --location --request POST 'https://sts.choreo.dev/oauth2/token' \
--header 'Authorization: Basic <BASE64_ENCODED_CONSUMER_KEY_AND_CONSUMER_SECRET_OF_YOUR_APP_HERE>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'orgHandle=<YOUR_ORG_HANDLE_HERE>' \
--data-urlencode 'scope=apim:api_manage'
```

!!! info
You can find your handle name of your organization by sign in to [https://console.choreo.dev](https://console.choreo.dev), go to **Settings** and click on the **Copy Handle**.
RAVEENSR marked this conversation as resolved.
Show resolved Hide resolved

This token can then be used to access the Insights API exposed via [https://choreocontrolplane.choreo.dev/93tu/insights/1.0.0/query-api](https://choreocontrolplane.choreo.dev/93tu/insights/1.0.0/query-api).

Expand Down