I am using the form parser of google document ai. The only way to authenticate that I have found is through gcloud command interface ("Authorization: Bearer "$(gcloud auth application-default print-access-token)).
Our application uses Google Vision too and just needs an api key (https://vision.googleapis.com/v1/images:annotate?key=)
How can I use this way google document AI?
I have tried with the api key in /apis/credentials and I have tried to restrict the key to ip too and to document ai api, but all with the same result:
curl -v -X POST -H "Content-Type: application/json; charset=utf-8" -d @request.json https://eu-documentai.googleapis.com/v1beta3/projects/<project id>/locations/eu/processors/<processor id>:process?key=<api key>
{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
}
}
What am I missing?