Search code examples
google-cloud-firestoregoogle-apis-explorer

Why does the Firebase API call for projects.databases.get return an error 404 - Project does not exist, for a project that does exist?


I'm new to all of this so I probably missed something really obvious. When trying to run a simple test using the following API call : https://firebase.google.com/docs/firestore/reference/rest/v1/projects.databases/get

the response that I get back is:

{
  "error": {
    "code": 404,
    "message": "Project 'some-projectname' does not exist.",
    "status": "NOT_FOUND"
  }
}

But the project does exist (though the name actually used isn't what is shown here I removed that for privacy reasons). But none the less the actual project is visible in both the Google Cloud Platform UI and the Firebase UI.

To try and add more color and hopefully supply as much detail as possible. I use the following format for the parameter: projects/some-projectname/databases/some-databasename

and for Credentials, leave both boxes checked: "Google OAuth 2.0" and "API key".

The project is under the Blaze plan and was set up with Firestore in Native Mode.

Please let me know if there is any more detail I can supply or something I should try and thanks kindly for your time.


Solution

  • You need to use (default) as the database name as that's the name of the only database that is currently allowed for each project.

    I.e. projects/PROJECT_NAME/databases/(default)