Freshdesk - Request API - Issues with variables

Hello :slight_smile:

Trying out the “new” request template - got it working after a tad of testing.
I have an issue with getting the variables in the body - hopping someone could easy spot my misstake.

This is the body for a Note in Freshdesk on a specifik Ticket.

Works. without variable
body: JSON.stringify({“body”:“Agent has pressed the button.”,“incoming”: false})

Does not work
body: JSON.stringify({“body”:“${agent_name} has pressed the button.”,“incoming”: false})

The variable ${agent_name} works verified via a alertbox, but not sent like this in the body in a request.

Hi @Octopus,

The variable in JavaScript will not work in double quotes string. Template string must be used to insert variables in the string dynamically.

Could you change it to a template string like the following code?

body: JSON.stringify({“body”:`${agent_name} has pressed the button.`,“incoming”: false})
1 Like

That tells me, coding at night is not a good idea, missed that. - Thank you!

@Raviraj, may I ask if you know if there are any Request template that shows how to catch the respons of an api call using the Request method v9 and above.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.