Hi, I created an endpoint where I’d like my user to get a JSON as the following
{
"status": "success",
"response": {
"status": "success",
"message_for_user": "Exemplary message for user",
"vouchers": [
{"voucher_id":"GJXCM","amount":"20"},
{"voucher_id":"L5PTM","amount":"5"},
{"voucher_id":"I5AQH","amount":"10"}
]
}
}
After several attempts, the best I could do is the following.
- In case “vouchers” is set to a list of texts
{
"status": "success",
"response": {
"status": "success",
"message_for_user": "Exemplary message for user",
"vouchers": [
"{\"voucher_id\":\"GJXCM\",\"amount\":\"20\"}",
"{\"voucher_id\":\"L5PTM\",\"amount\":\"5\"}",
"{\"voucher_id\":\"I5AQH\",\"amount\":\"10\"}"
]
}
}
- In case “vouchers” is set to a unique text
{
"status": "success",
"response": {
"status": "success",
"message_for_user": "Exemplary message for user",
"vouchers": "{\"voucher_id\":\"GJXCM\";\"amount\":\"20\"},{\"voucher_id\":\"L5PTM\";\"amount\":\"5\"},{\"voucher_id\":\"I5AQH\";\"amount\":\"10\"}"
}
}
Bubble is adding some unwanted backslashes. I tried to use “find and replace” to get rid of them but it doesn’t work. I also checked several posts in the forum but I couldn’t find anything.
I can have full control of the returned body in case I set content-type = plain text
but I need my users to get a Json.
Thanks in advance for your help!
P.S. I’m not a developer