Sending multi-line notifications through the API

To send multi-line notifications with line-breaks, send regular newline ("\n", ASCII 10) characters in your message. Your library or programming language may not interpret "\n" characters properly inside strings and may send them as a literal backslash and "n". In those cases, you may need to use your language's chr() or similar function to represent a single character with ASCII value 10.

When using curl in shell scripts, you may find it easiest to just insert literal line breaks in your file:

curl -s \
  --form-string "token=APP_TOKEN" \
  --form-string "user=USER_KEY" \
  --form-string "message=this is a

message with a line break" \
  https://api.pushover.net/1/messages.json
Was this article helpful?
1 out of 1 found this helpful