Why can't I get Google API Devices to work - google-apis-explorer

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.

Related

Service to service authentication is not allowed using forge Autodesk

In 'Autodesk Construction Cloud APIs' I try to use GET method for projects/{projectId}/issues.
This is the documentation for the API: Get issues API Link
I am using Postman and for other API's it works without problems, but for some reason for this API I got the following error:
image of the error:
I know my ProjectId and Token are fine. I am wondering if it has to do with some access the admin must to give me.
best regards,
It looks like your access token is 2-legged. Instead, you will need to use a 3-legged one since its Authentication Context is user context required.
See:
https://forge.autodesk.com/en/docs/oauth/v2/developers_guide/basics/
https://forge.autodesk.com/en/docs/oauth/v2/tutorials/get-3-legged-token/
https://forge.autodesk.com/en/docs/oauth/v2/tutorials/get-3-legged-token-implicit/

I cannot create OAuth 2.0 client ID on google cloud platform

I am trying to create OAuth 2.0 client ID for Apps Script API and getting the following message:
"The request failed because one of the fields of the resource is invalid"
I have tried to solve with many permission trials with no success.
I am the owner of the project, so theoretically shouldn't have an issue.
Any idea how to solve that?
I don't think that the issue is specific to my project. I asked another developer to check it with a different project and the same error message was fired. I think that this is a Google issue.
I created Desktop app OAUTH 2.0 and was able to use it with apps script with no issues.
I am using the following API with these credentials:
SCOPES = (
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/drive.appdata',
'https://www.googleapis.com/auth/drive.activity', # Allows read and write access to the Drive Activity API.
'https://www.googleapis.com/auth/drive.scripts', # access to apps script
'https://www.googleapis.com/auth/script.projects',
'https://www.googleapis.com/auth/userinfo.email',
)

404 error when deploying a Google Apps script via the REST API

I'm trying to deploy a Google Apps script via the Google REST API, and I'm using the API Explorer to perform that.
This is the method I am testing:
https://developers.google.com/apps-script/api/reference/rest/v1/projects.deployments/create
Executing the method via the API Explorer returns a 404 error. I have verified that the scriptId in question does exist, and have tried several other scriptIds, to no avail. I have also made sure the permission scopes are properly set.
This is what the API Explorer gives me.
Worth mentioning that the same scriptId works when calling another method such as projects.get.
Is there anything I am missing, or is this an issue on Google's end?
In case of the latter, what are the steps to contact Google Apps Script's team and inform them of this issue?
Your versionNumber is incorrect. The Requested entity here refers to the version of your script. You need to go to File>Manage Versions>Save New version to create a new version(or create one with the api1) and use that version number in the request body.
Check your authorization scopes. You need to have the following scope enabled:
https://www.googleapis.com/auth/script.deployments
If its not in the list of available scopes in API Explorer then you'll need to add it manually (there is an area at the bottom of the authorization dialog where you can add scopes).
Google's API Explorer uses API keys to authorize requests. In some cases an API key is not sufficient and an OAuth2 (bearer) access token is required. As an alternative you can create an Apps Script project and add the appropriate scopes via the manifest file(appsscript.json). Then you can use UrlFetchApp.fetch() to test the API directly.

Autodesk API Forge Authentication Bearer

I'm the administrator of a Bim360 Docs Hub,and i'm trying to retrieve some data from the forge API. I've already created a test app, and i get a Bim 360 Account Id.
I'm not able to get an authentication bearear token (OAuth), to make simple get requests towards projects.
Where do i get the auth token ?
Thanks
See tutorial here to aquire OAuth tokens and note that you will need different permutations of OAuth scopes (esp. data:read data:write etc.) for different operations, as is specified in the docs of each and every API, see an example here.
You may use a RESTful client like Postman to talk to our APIs and manage the authentication flow and operate on response data with JavaScript as you like so as to build workflows such as to create a new project.
Last but not least before you can access BIM360 APIs make sure you provision access to your app.

OAuth lib for Chrome Extensions and Salesforce API

I'm try to authorize to Salesforce APIs using the Chrome Extension OAuth Library, but I get the following response from Salesforce when I send a signed request using oauth.sendSignedRequest() method:
<response><error>LOGIN_OAUTH_INVALID_DSIG</error><message>Failed: Signature Invalid</message></response>
Any thoughts on what could be causing this?
Can you post your oauth object here.
I bet you are using 'consumer_key': 'anonymous',
'consumer_secret': 'anonymous',. You need to check weather Salesforce accepts consumer key and secret as anonymous or not.
I ended up creating my OAuth 2.0 Library for Chrome Extension that works fine with Salesforce. Ping me if you would like to get a copy of the library.