Hi,
Recently, I had an issue with making an API call in platform version 2.3
But now, it is resolved and I can able to make requests in 2.3.
But after publishing the application the request templates throw an error stating that there’s an error in the request.
But if I replicate the scenario in the local it works fine.
Any advice on this?
Thank you.
Hey @Bene_Immanuel, DMing you for some details.
Hey @Bene_Immanuel,
We have released a new version of FDK. Please update to the latest version and try this.
@zach_jones_noel,
Greetings!
I have updated to the latest version of the fdk (9.0.4).
But still, this issue persists.
Could you please check on this?
Thank you.
Hey @Bene_Immanuel,
Can you share the request template and also the query fields how they are passed while invoking?
Hi @zach_jones_noel,
Sure! please find the data below.
"getTickets": {
"schema": {
"method": "GET",
"host": "<%= iparam. freshdeskSubdomain %>.freshdesk.com",
"path": "/api/v2/search/tickets",
"query": {
"query": "\"<%= context.query %>\""
},
"headers": {
"Authorization": "Basic <%= iparam.freshdeskEncodedApikey %>",
"Content-Type": "application/json"
}
}
}
@Bene_Immanuel,
Also can you please share the invoking snippet as to how the query parameter is passed?
CC @Nadeem_Bhati
Hi @zach_jones_noel,
const getFilter = (status) =>{
let statusExpression = [];
status.map((s, index)=>{
if(index === 0){
statusExpression.push(`status:${s}`);
}else{
statusExpression.push(` OR status:${s}`);
}
});
return statusExpression.join("");
}
const filterDate = new Date();
filterDate.setMonth(filterDate.getMonth() - 5); // 5 bcs month starts at 0
if(!filterDate.getMonth()) filterDate.setMonth(1)
const filter = `${filterDate.getFullYear()}-${filterDate.getMonth().toString().padStart(2, "0")}-${filterDate.getDate().toString().padStart(2, "0")}`;
const queryString = `updated_at:<'${filter}' AND (${getFilter(ticketStatusField)}) AND ${flagField}:null`
Hope this help!
Thank you.
Hey @Bene_Immanuel,
I’m suspecting something with getFilter(ticketStatusField)
, can you share the CURL command with multiple status values and also log the context value before request.invokeTemplate
.