Firestore REST API batchGet returns status 400

349 Views Asked by At

I am trying to get data from Firestore in a batch using the batchGet method. But i get an error as below :

Error: JSON error response from server: [{"error":{"code":400,"message":"Document name "["projects/MYPROJECT/databases/(default)/documents/MYCOLLECTION/DOCUMENTID"]" lacks "projects" at index 0.","status":"INVALID_ARGUMENT"}}].status: 400

I have searched for any questions regarding this, I found this. They are trying t add documents and not using batchGet, however I have followed the solution. Still no luck.

Note: I am integrating Firebase to AppGyver.

I am new to Firebase and still learning. I need all the help I can get. Thank you in advance.

1

There are 1 best solutions below

0
On BEST ANSWER

I have found what I did wrong.

In AppGyver you can only set your parameters as text or number only. While the documents parameter needs to be in array. Hence, I convert the array to string using ENCODE_JSON. But that was wrong.

The correct way is just send the documents in array without converting it. Use the formula :

AppGyver binding

Just hit "Save" even there is an error telling you that it is not a text.