Slackbot
08/22/2023, 4:53 PMOleg Nenashev
08/22/2023, 5:29 PMLee Turner
08/22/2023, 5:47 PMjsonBody
element to define the response payload, the "
need to be there for it to be valid json. This means your integer will always go back as a string. If I change the jsonBody
to use the body
element instead I don’t have to worry about it being valid json so can remove those quotes. The downside is that you have to escape the json but it seems to work:
"response": {
"status": 202,
"headers": {
"Content-Type": "application/json"
},
"body": "{\"number\": {{math 1 '*' 3}} }",
"transformers": ["response-template"]
}
Results in:
{
"number": 3
}
Roger Williams
08/22/2023, 7:07 PM