I am trying to fetch stackdriver log entries using this REST API: https://logging.googleapis.com/v2/entries:list?key={MY_API_KEY}
I have created an API Key as per the steps mentioned here and set API restrictions to Stackdriver API, Stackdriver Logging API and Stackdriver Monitoring API.
Request Body
"resourceNames": [
"projects/{MY_PROJECT}"
]
}
Response
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}
What am I missing here? What do I need to modify to make this work? The same API call works via the OAuth2.0 authentication mechanism, but not with the API Key mechanism.
Note: My use-case requires me to use the REST APIs, and I cannot use the Service Account + SDK flow.