Closed derekritchison closed 6 months ago
I figured this out. The API does not want the roleId sent in an array, but rather just a string. Somewhat confusing given the first call requires the array but whatever.
$roleName = $service->roles->get($customerID, $roleAssignment['roleId']);
Glad you figured it out.
We don't have samples for all API calls, so sometimes the only way to be sure is to see the signature of the method call.
Often IDEs/editors help with that.
Thanks.
Hey there- Not a bug, just a question. I feel like I am using the roles.get method (example below) properly according to Google's docs (also below). However, I am getting a 400. I've tried passing the role's ID as
roleId
and asresource_id
but always get the same response. Has anyone used this method with the PHP client before? Am I missing something obvious?My code:
Response:
HTTP Status Code: 400 Errors: [ { "message": "Invalid data: RolesGetRequest.resource_id", "domain": "global", "reason": "invalid" } ]
Google's docs:
https://developers.google.com/admin-sdk/directory/reference/rest/v1/roles/get