且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Google API错误400:“未找到客户项目”

更新时间:2022-11-06 14:02:48

嗯,解决了它!

对于新的Google API,您需要在开发者控制台中启用API。



转至: https://console.developers.google.com



在列表中找到您要使用的API(对于我来说,它是Sheets API) ,点击它并启用它。



它现在像一个魅力: - )


This is my first time diving into Google API's. I'm trying to get a simple test working following the Google instructions. At this point, I've created the project and set up credentials. Following Google's instructions here, I have created a test page and copied the page code exactly as stated on the above link.

When I run the page, I initially see an authorize button, which asks me to log into my account. Everything up to this point is fine. However, once I log in to Google, I receive the following error:

"{"error": {"code": 400,
            "message": "Client project not found. Please pass a valid project.",
            "status": "INVALID_ARGUMENT",
            "details": [{"@type": "type.googleapis.com/google.rpc.Help",
                         "links": [{"description": "Google developers console",
                                    "url": "https://console.developers.google.com"
                                  }]
                       }]
 }}"

I've read what little I can find, and nothing mentions this specific error.

Anyone encounter this error, or have any ideas?

Thanks!

Ah, solved it!

For the new Google API's, you need to enable the API in the developer console.

Go to: https://console.developers.google.com

In the list, find the API you want to use (for me it was Sheets API), click on it and Enable it.

It now works like a charm :-)