Question

If I want to build a reseller portal under my reseller account... How can I do? I've try to use the service account to build jwt for Oauth, and I can retrieve a auth token for access api(s). When I pulling a request like:

{ uri: 'https://www.googleapis.com/apps/reseller/v1sandbox/subscriptions',
  method: 'GET',
  headers: { Authorization: 'Bearer ya29.AHES6ZTCYDJH41adclj5AR8....JBQa3lM_ZXpLvdsm2J8' } }

And I always got return like:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "authError",
    "message": "Please make sure you are using a valid Google Apps account",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Please make sure you are using a valid Google Apps account"
 }
}

It likes say my service account is not authorized to access the apps reseller api...(Because it is not google apps account, but... it create by a apps admin... ) But my admin account is already a permitted user, I use the admin to create project and create a service account to build jwt...

I don't know how to setup the permission for a service account. Help @@~

Was it helpful?

Solution 2

The final response from Google is... the Reseller API still not support "Service Account" (that applied from API console). Currently just support real user account, and I need to try other way to access this service... Hope the near feature will implement the related permission to service account! Thanks for help!

OTHER TIPS

Update of the answer:

Service account does work with Reseller API for OAuth 2.0. The reason you are getting this error is because you probably haven't authorize the client ID in the control Panel.

https://developers.google.com/drive/delegation#delegate_domain-wide_authority_to_your_service_account

Follow these steps and run the call again. You should not get this error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top