cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1369
Views
0
Helpful
1
Replies

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

CamRunr
Level 1
Level 1

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?

1 Reply 1

Robert Ecke
Level 1
Level 1

Try 2 blanks before "  \n". 

 

"markdown":"  \nLine 1  \nLine2  \n"
Getting Started

Welcome to the Webex Community. This is your home to ask questions, share knowledge, and attend live webinars.