'Insufficient authentication scopes

From Google Cloud Shell, I'm trying to call a Google API whose access scope is specified as "dataplansharing" here.

curl
-X POST
-H "Authorization: Bearer $(/home/kannanj/.local/bin/oauth2l fetch dataplansharing)"
-H "Content-Type: application/json"
-l https://mobiledataplansharing.googleapis.com/v1/operators/11344/planStatuses?userKey=Xfqom7Xm1rAJVabp0Gv7wTZ186ia37L29Cefehfu
-d '{"request": "echo"}' { "error": { "code": 403, "message": "Request had insufficient authentication scopes.", "status": "PERMISSION_DENIED", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT", "domain": "googleapis.com", "metadata": { "service": "mobiledataplansharing.googleapis.com", "method": "google.mobile.dataplansharing.v1.MobileDataPlanSharingService.CreatePlanStatus" } } ] } }

It prompted for the grant and I accepted it. But the call fails as above. Any idea why? Note that in this usage I'm directly using the Shell, there is no Service Account impersontation involved which would be if I'm running from a VM instance. Is the method I'm trying unsupported?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source