0

The LicenseAssignments.get api returns 200 OK

Request:

GET https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/sku/Google-Apps-For-Business/user/<email>

Response:

200 OK

- Show headers -

{
    "kind": "licensing#licenseAssignment",
    "selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/sku/Google-Apps-For-Business/user/<email>",
    "userId": "<email>",
    "productId": "Google-Apps",
    "skuId": "Google-Apps-For-Business"
}

However LicenseAssignments.listForProduct returns "403 Forbidden"

Request:

GET https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/users?customerId=my_customer

Response:

403 Forbidden

- Show headers -

{
    "error": {
    "errors": [
    {
    "domain": "global",
    "reason": "forbidden",
    "message": "Unauthorized operation for the given domain."
    }
    ],
    "code": 403,
    "message": "Unauthorized operation for the given domain."
    }
}

Any idea why I get 403 forbidden for the second request?

Srik
  • 2,341
  • 2
  • 21
  • 35
  • 1
    are you able to reproduce this behavior in the API Explorer? https://developers.google.com/admin-sdk/licensing/v1/reference/licenseAssignments/listForProduct. Are both the customerID and productId set? – Gerardo Nov 21 '14 at 00:54
  • This was resolved when I used my domain name as 'customerId'. It's different from behavior of other APIs where customerId is 'my_customer'. – Srik Nov 24 '14 at 15:30

1 Answers1

2

This issue got resolved when I used 'domain name' (e.g. something.com) as 'customerId'. This is different from the usual behavior of other Google APIs where 'customerId' is 'my_customer'.

https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/users?customerId=<domain name>
Srik
  • 2,341
  • 2
  • 21
  • 35