I ran the code below directly using Apps Script and the output is as expected. The HTTP request returns array with 2 items.
function getConv() {
try
{
var url = “https://firestore.googleapis.com/v1beta1/projects/valley-chat/databases/(default)/documents:batchGet”;
var params = {
method: “POST”,
contentType: ‘application/json’,
headers: {
Authorization: “Bearer <TOKEN_ID>”,
},
payload: JSON.stringify({
documents: [
“projects/PROJECT_ID/databases/(default)/documents/COLLECTION_ID/DOCUMENT_ID1”,
“projects/PROJECT_ID/databases/(default)/documents/COLLECTION_ID/DOCUMENT_ID2”
]
})
};
var res = UrlFetchApp.fetch(url, params);
Logger.log(res.getContentText());
return JSON.parse(res.getContentText());
}
catch(e)
{
Logger.log(e);
return;
}
}
However, when I integrate this to a data resource, I did not get the expected output.