Hi,
I’m trying to use a snippet code i got from your developer party, to search conversations between two epochs. The codes runs without a problem on your platform, but when I use it in google scripts I get the response:
{"code":"invalid_query","message":"Query body must contain a query hash"}
I guess it is related to the JSON payload, though the string seems to be ok.
I was able to work with the API without any problem, when I don’t send a body, but I always get the error whenever I include a body.
Any clue?
const str = JSON.stringify({
query: {
value: v
{field: 'created_at', operator: '>', value: '1690081199'},
{field: 'created_at', operator: '<', value: '1690167601'}
],
operator: 'AND'
}
});
const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json',
authorization: 'Bearer XXXXXXXXXXXXXXXXXXXXXX'
},
body: str
};
const response = UrlFetchApp.fetch('https://api.intercom.io/conversations/search', options );