google-cloud-platformgoogle-oauthgoogle-cloud-visiongoogle-visiongoogle-cloud-automl

Error connecting Google AutoML API with API KEY


I am trying to connect in the API using the link below by Postman

POST https://automl.googleapis.com/v1/projects/*****/locations/us-central1/models/*****:predict?key=*****

But I am getting the message below:

{
  "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"
  }
}

KEY is authorized to use the API.


Solution

  • Only a limited number of Google APIs can be used via an API key, look here. I don't think AutoML APIs support key-based access.

    For Postman, you can generate an access token using the OAuth2 playground, but if you are going to develop an integration, service account credentials is the way to go :)