user16537303
user16537303

Reputation: 1

Why does this command from google's documentation return error 403 despite providing authentication?

I am trying to create a product set for google VisionAI. I copied the command used to create a product set(given here: https://cloud.google.com/vision/product-search/docs/create-product#powershell) into powershell 7.2 after setting application credentials. Here is the logs from the terminal: PS C:\Users[USERNAME]\Desktop\Work\VisionApi> $env:GOOGLE_APPLICATION_CREDENTIALS="C:\Users[USERNAME]\Desktop\Work\VisionApi\machinelearning-285617-9fd5155827e0.json" PS C:\Users[USERNAME]\Desktop\Work\VisionApi> $cred = gcloud auth application-default print-access-token

$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest -Method POST -Headers $headers -ContentType: "application/json; charset=utf-8" -InFile request.json -Uri "https://vision.googleapis.com/v1/projects/[PROJECTID]/locations/europe-west1/products" | Select-Object -Expand Content Invoke-WebRequest: Line | 4 | Invoke-WebRequest | ~~~~~~~~~~~~~~~~~~~ | { "error": { "code": 403, "message": "Permission denied.", "status": "PERMISSION_DENIED" } } Does anybody know what is causing error 403?

Upvotes: 0

Views: 173

Answers (0)

Related Questions