Why can't I get Google API Devices to work

243 Views Asked by At

I am trying to get started with using Google API specifically in regards to obtaining a listing of Chrome devices in our organization. We have a current list of Chrome Devices in Google Admin. When I go to "API Explorer" here:

  https://cloud.google.com/identity/docs/reference/rest/v1/devices/list

And enter the request parameters I can't get it to work.

First of all I do not know how to obtain an access token other than using the "OAUTH 2.0 Playground". That link is

          https://developers.google.com/oauthplayground/

I have tried that but apparently I need to somehow enable one of the following OAuth scopes:

      https://www.googleapis.com/auth/cloud-identity.devices.readonly
      https://www.googleapis.com/auth/cloud-identity.devices
      https://www.googleapis.com/auth/cloud-identity

Which I don't seem to be able to find in the OAuth playground.

In any case, I did obtain a token through the OAUTH 2.0 Playground to use in the "API Explorer". I am pretty sure I didn't use the correct OAuth scope either. In any case, maybe I can try using an API Device List in OAUTH 2.0 Playground but haven't figured it out yet.

Seems to be easier to find and use in "API Explorer". But when I use the Auth Token in API Explorer, devices.list in

            GET https://cloudidentity.googleapis.com/v1/devices,

which I acquired through OAUTH 2.0 Playground, I get the error:

"Request had insufficient authentication scopes"

I get the same error in OAUTH 2.0 Playground if I try to use that same API request in OAUTH 2.0 Playground. But simply cannot find the following OAuth scopes, which the API explorer says is required for this particular API request of

        "GET https://cloudidentity.googleapis.com/v1/devices"

I am just looking to try this out (obtaining a list of chrome devices through the Google Cloud API), which I know our organization has in our admin console.

I have not activated a Google Cloud Trial yet, so maybe that is the problem. I don't really know if the API Explorer or OAUTH 2.0 Playground requires that.

Maybe there is a different API request to accomplish what I am looking to do.

Maybe there is a different way to obtain an access token. I have gone in the google cloud console,

                  https://console.cloud.google.com 

created a project, and created an API Key, and an OAUTH 2.0 client.

Any help would be appreciated.

Thank you.

0

There are 0 best solutions below