Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Vision API "PERMISSION_DENIED"

I am trying Google Cloud Vision API (beta) and it is returning "Permission Denied" message. But the "Cloud Vision API" is enabled for the project. Any help is appreciated.

Error Details from Google APIs Explorer

403 OK

- Show headers -

{
 "error": {
  "code": 403,
  "message": "Project has not activated the vision.googleapis.com API. Please enable the API for project google.com:apisexplorerconsole (#292824132082).",
  "status": "PERMISSION_DENIED",
  "details": [
   {
    "@type": "type.googleapis.com/google.rpc.Help",
    "links": [
     {
      "description": "Google developers console API activation",
      "url": "https://console.developers.google.com/project/292824132082/apiui/api"
     }
    ]
   }
  ]
 }
}
like image 243
Binoy Mathew Avatar asked Feb 21 '16 05:02

Binoy Mathew


1 Answers

You should start by using a CURL request instead of the API explorer or instead of your favorite programming language :

curl -v -k -s -H "Content-Type: application/json" https://vision.googleapis.com/v1/images:annotate?key=put_your_browser_secret_key_here --data-binary @put_your_req.json > result.json

{
"requests":[
{
  "image":{
    "content":"put_your_encoded_base64_image_content"
  },
  "features":[
    {
      "type":"LABEL_DETECTION",
      "maxResults":4
    }
  ]
}
]
}

as you may already know :

base64 your_image > your_encoded_base64_image_content

Hope that helps, I don't know why from API explorer there is a limitation.

like image 108
Simon Micollier Avatar answered Sep 30 '22 14:09

Simon Micollier