I'm facing an issue with ManyChat and Instagram Direct messages and could use some help.
When I receive a message from Instagram Direct in ManyChat, I store it in a variable called message
and then send it to a server using an external request. Everything works fine except when the user uses the enter key to go to the next line in their message. Because the message goes to the next line, using this variable in the JSON body causes an error.
For example:
Message:
Hello
How are you?
External request JSON body:
{
"message": "message"
}
This causes a problem because the JSON body ends up looking like this:
{
"message": "Hello
How are you?"
}
The problem is that \n
is not being used for multi-line messages, which breaks the JSON structure.
Does anyone know how I can resolve this issue? I would greatly appreciate any guidance or suggestions.
Thank you!