Using two Google APIs with the same application

RekaK :

I have an application which connects to Google Drive API. Now I have to add another function which requires the Google Directory API. I granted the necessary permissions and enabled the new API in my project.

However I'm still getting this error:

"message" : "Access Not Configured. Admin Directory API has not been used in project 594418282793 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/admin.googleapis.com/overview?project=594418282793 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."

The problem is that the URL in the message gives me an error; apparently the project ID is invalid. This is the error:

There was an error while loading /apis/dashboard?project=594418282793. You are missing at least one of the following required permissions:

Project

resourcemanager.projects.get

Check that the project ID is valid and you have permissions to access it.

I have no idea what is the cause of this mismatch, why the project ID provided in the error message doesn't seem to exist, and where else should I enable the second API in my application. Any ideas would be much appreciated.

DaImTo :

I think you have miss understood how the credentials.json works.

Access Not Configured.

Means that the credentials you have loaded for this client has not been setup for the api you are trying to connect to.

When you create a project on Google developer console this is to give google information about your application as a whole and what it is designed to do. You should enable both apis in the single project.

Once that is done create your Oauth credentials as you did before this credential file will then be able to connect to both apis .

googel developer console

Left hand menu click credentials then button on the top says create credentials

enter image description here

Once you have created it click the arrow to download you can download the file anytime

enter image description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=360172&siteId=1