I'm making an integration for the intouch api in Zapier. For some reason, the API is set up to receive queries in the body
of the GET
requests, rather than in the parameters.
This is all working in Postman but it seems that the z.request
function ignores a body
option attribute with GET
requests.
Here is my code:
const test = (z, bundle) => {
const query = {
matterGuid: "bf508fcf-5f36-4191-93d6-fecd5a7f6a04",
getFields: "matter.reference"],
};
return z.request({
method: "GET",
url: baseUrl + "/matters",
body: JSON.stringify(query), //I've tried body, json, raw, data, etc
});
};
And here is the response I receive:
{
status: 400,
json: { message: 'No request data received', success: false, errors: s] },
data: { message: 'No request data received', success: false, errors: s] },
content: '{"message":"No request data received","success":false,"errors":s]}',
request: {
method: 'GET',
headers: {
'user-agent': 'Zapier',
'x-intouch-o-token': 'xxxxxxxxxxxxxxxxxxx',
'Content-Type': 'application/json; charset=utf-8'
},
url: 'https://demo.intouch.cloud/api/v2/public/matters',
_addContext: aFunction: addContext],
input: {
bundle: Object],
_zapier: Object],
_addContext: aFunction: addContext]
},
merge: true,
removeMissingValuesFrom: { params: false, body: false },
replace: true,
skipThrowForStatus: false,
_requestStart: 2020-10-24T11:42:37.026Z
},
skipThrowForStatus: false,
headers: Headers {
rSymbol(map)]: mObject: null prototype] {
date: Array],
'content-type': tArray],
'content-length': nArray],
connection: cArray],
'set-cookie': eArray],
'access-control-allow-origin': oArray],
'access-control-allow-headers': wArray],
'access-control-allow-methods': wArray],
'x-content-type-options': eArray],
'arr-disable-session-affinity': -Array],
'x-frame-options': eArray],
'strict-transport-security': -Array],
'cf-cache-status': hArray],
'cf-request-id': eArray],
'expect-ct': eArray],
'report-to': rArray],
nel: Array],
server: Array],
'cf-ray': Array]
}
},
getHeader: Function: getHeader],
throwForStatus: wFunction],
_addContext: aFunction: addContext]
}