I want to use the Dynatrace API to query logs. Following the documentation requirements, I created an Access Token and granted it the ‘logs.read’ scope.
However, when calling the API, the following error occurred:
Did you find a solution? I have the exact same issue. I’m using a freshly created token with only log.read access.
On a side note, with your request in the example, you don’t need to set the content-type header on a GET request. You’re not sending any data for which you need to specify the type of content. However, you do need to specify your query parameters.
I guess there aren’t that many of us using this API.
A bit late to the party, but found that you need to use a token from an OAuth client with the permissions storage:buckets:read and storage:logs:read.
You first need to create a client on the UI, then obtain a bearer token with the right scopes and use that to authenticate with the logs API (note you’ll need to pass a header Authorization: Bearer <token> as opposed to the old Authorization: Api-token <token>).
This docs page should help guide you even though it’s for biz events/DQL queries. The process is the same, the only thing that changes are the scopes you need.