From API I get JSON that has a string fields with multiple lines and different escape characters. I try to both output this JSON and get one of it's values.
I tried different combinations like this:
response=$(curl -s -X 'POST' \
".../api/generated_message/action/generate" \
-H 'accept: application/json' | jq -r .)
echo $response
generated_message_id=$(echo $response | jq -r '.generated_message_id')
However, I always get parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 17, column 96
. Seems like I need somehow to get an escaped answer from CURL.