Unable to use optimize REST API's and dashboard is not listing all processes

Hi community,

I’m trying to use the optimize API (REST) provided in the documentation

I’m getting unauthorized 401 in postman as shown below (optimize is assigned to port 8803)

camunda optimize is not listing dashboard for all the processes that are visible in operate where I have more than 10 processes

@Helene can you please help me here

image

Hi @Praveen_Kumar_Reddy ,

I think you might be mixing up the token retrieval with the public API request.
To use the public API, you first have to request a token and then you can use this token in your authorization header for the public API request:

  1. Set up your client, make sure to include Optimize in the scope
  2. Take a note of the displayed client details
  3. Take a note of your auth url, you can find this by going to the API tab in your cluster, clicking on your client and copying the oAuth URL from the “connection information”
  4. Use your API client details to retrieve a token, like so:
curl --location '<your-auth-url>' \
--header 'content-type: application/json' \
--data '{
  "client_id": "<your-client-id>",
  "client_secret": "<your-client-secret>",
  "audience": "optimize.ultrawombat.com",
  "grant_type": "client_credentials"
}'
  1. You receive a response like this:
{
    "access_token": "ey..",
    "scope": "12345-...",
    "expires_in": 86400,
    "token_type": "Bearer"
}

Now you can use the Optimize API with the returned access_token in your auth header like so:

curl --location --request POST '.../api/public/share/enable' \
--header 'Authorization: Bearer ey...' \
--data '...'

I noticed our docs aren’t clear enough on the above steps and have opened a ticket for us to improve the description.

Hope that helps, let me know if you encounter any other issues
Please open a separate topic for your other question regarding dashboards.

Hi @Helene , thanks for your reply

I have tried the same in the postman with the optimize client id and secret with bearer token in header
still it is giving me 401(unauthorized)