Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud Firestore request from Postman [closed]

I have created a Cloud Firestore database, with a collection and some documents. I want to make some requests to it with Postman, but I am not able to authenticate. I have created a service credentials and tried to get the token for the authentication, with no success. Any idea about how to get it?

Which is the endpoint to get the token?

Thanks in advance.

like image 889
lauramc Avatar asked Oct 16 '25 11:10

lauramc


1 Answers

Assuming you are trying to use Firestore REST API you can obtain token with the following steps:

  1. Create a key for service account that you configured to access Firestore.
  2. Open Cloud Shell, copy json with key info into it, and activate service account with gcloud auth activate-service-account --key-file=<path_to_json>
  3. Print and copy its access token with gcloud auth print-access-token
  4. Add Authorization header with value Bearer <copied_token> to your request or add it as a request parameter to url with ?access_token=<copied_token>

Keep in mind that these tokens are short-lived and are valid maximum for an hour.

like image 97
Emil Gi Avatar answered Oct 19 '25 11:10

Emil Gi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!