cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
213
Views
0
Helpful
1
Replies
Highlighted
Beginner

Sending newlines in markdown via API doesn't seem to work

I've tried all manner of escaping '\n'. Either the post fails with an error, or the '\n' is printed verbatim in the Teams window. I really need to have code blocks that respect newlines in these API posts. How?

curl -H "Authorization: Bearer tokenhere" https://api.ciscospark.com/v1/messages --form "roomId=roomidhere" --form 'markdown="```\nline 1\nline2\n```"'

I've tried "markdown=..." as well without single quotes. I've tried spaces around the newlines. I've tried actual newlines. Wjhat's the magic combo?

Everyone's tags (2)
1 REPLY 1
Highlighted
Beginner

Re: Sending newlines in markdown via API doesn't seem to work

Try 2 blanks before "  \n". 

 

"markdown":"  \nLine 1  \nLine2  \n"
CreatePlease to create content