Reputation: 3027
I've created an cloud firebase type database in firebase. Plz have a look at the image below. But How to access the datas from API(get)? If I use real time database, simply 'https://[PROJECT_ID].firebaseio.com/users/jack/name.json' this url gives the json data. But using cloud firebase database, I'm unable to get json data. I've tried to use "https://firestore.googleapis.com/v1beta1/EmployeeApp/name=employeeapp-66646/newsFeed/" but it doesn't work.
Upvotes: 9
Views: 7567
Reputation: 598708
Here is an example of a URL for one of my databases:
An explanation of the variable parts in here:
project-8080059325282098184
is my project ID.(default)
is the name of the database. At the moment you can't specify a name for your database, so yours will be (default)
too.52679469
is the name of my collection.docid
is the name of my documentThe JSON I get back:
{
"name": "projects/project-8080059325282098184/databases/(default)/documents/52679469/docid",
"fields": {
"field1": {
"stringValue": "value1"
}
},
"createTime": "2018-10-06T14:16:24.090837Z",
"updateTime": "2018-10-06T14:16:24.090837Z"
}
In this response:
name
is the full path of this document.fields
is the data of the document.createTime
and updateTime
are the metadata for the document.Upvotes: 22
Reputation: 83058
The following URL will do the trick:
Have a look at the doc here, for detail on how to build the URL.
Upvotes: 8