getting started with google directory API and device management

448 views Asked by At

Heyy, I was looking into Google apps for business and playing with the API explorer ... I have a reseller account with google let's say [email protected] and this works for creating users, org units, subscriptions and so. I want to start with the device management and investigating on these things:

1) How do I know my customerId from google cpanel ... I am looking to know how to see the info required for these requests in CPanel.

2) I am getting the below error:

400 Bad Request

- Show headers -

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "badRequest",
    "message": "Bad Request"
   }
  ],
  "code": 400,
  "message": "Bad Request"
 }
}

In my request, I entered "goteam.com" as customerId..... Isn't this correct? any good posts on getting started with device management.... Please help

2

There are 2 answers

0
Jay Lee On
  1. there are 2 basic ways to determine what customerId you need to use:
    • Just use my_customer, this will use the customerId of the user you authenticated as. This works perfect when working with your own domain but will not work when when you are a reseller trying to access one of your customer's domain data.
    • Use the users.list() API call to determine the customerId. Specify the domain, a maxResult of 1 and that the only field you want back is customerId. Here's what it'd look like in the API Explorer.
  2. The customerId is not your domain, it's a unique ID that looks like random characters.

Lastly, you should be aware that resellers currently can't make device management requests for customers (see note near top).

1
Richie Foreman On

I agree with Jay. Currently resellers cannot utilize the Directory API on behalf of their customers. The Provisioning API does however, work.