Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find the immutable id of my Google Apps account?

Many of the Directory API calls require a customer parameter referred to as the "Immutable id of the Google Apps account. (string)".

e.g. GET https://www.googleapis.com/admin/directory/v1/customer/customer/domains

I have no idea how to find/generate this for my Google Apps account. I am an admin.

Can someone point me in the right direction please?

like image 748
Gary Prendergast Avatar asked Nov 03 '15 07:11

Gary Prendergast


2 Answers

The easiest way I found was to use the APIs Explorer at the bottom of the documentation for the Customers: get method on the Directory API (Admin SDK). Enter 'my_customer' for the customerKey on the form and hit the 'Authorize and Execute' button.

The response will include the CustomerId (e.g. Cxxxxxxxx) as the "id". The entire response will look something like this:

{
  "kind": "admin#directory#customer",
  "id": string,
  "etag": etag,
  "customerDomain": string,
  "alternateEmail": string,
  "postalAddress": {
    "organizationName": string,
    "countryCode": string,
  },
  "language": string,
  "customerCreationTime": datetime
}
like image 128
g . Avatar answered Oct 05 '22 09:10

g .


I was able to find the customerId as follows

  1. Go to admin.google.com
  2. Security -> Set up single sign-on (SSO)

You will see URLs like this:

https://accounts.google.com/o/saml2/idp?idpid=Cxxxxxxxx

That Cxxxxxxxx is your customerId

like image 24
rsmoorthy Avatar answered Oct 05 '22 09:10

rsmoorthy