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.
You can use any Firebase Realtime Database URL as a REST endpoint. All you need to do is append . json to the end of the URL and send a request from your favorite HTTPS client. HTTPS is required.
For authentication, the Cloud Firestore REST API accepts either a Firebase Authentication ID token or a Google Identity OAuth 2.0 token. The token you provide affects your request's authorization: Use Firebase ID tokens to authenticate requests from your application's users.
The Firestore SDK uses gRPC to communicate with the server. This is the same layer that many of Google's other Cloud products use under the hood. It is quite different from the Web Sockets communication layer that the Firebase Realtime Database relied on.
Here is an example of a URL for one of my databases:
https://firestore.googleapis.com/v1beta1/projects/project-8080059325282098184/databases/(default)/documents/52679469/docid
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.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With