如何为使用 REST API 发送的消息格式化文本?
How to format text for messages sent with the REST API?
目前我发送的是纯文本消息,如何设置我发送的文本消息在对话中可见的格式?我是否需要指定不同的内容类型或以某种方式在 REST API 中发送富格式或 html 格式?例如我想发送换行符 (\r\n) 或将响应格式化为来自机器人的列表。
如果可能,请提供一个 curl 工作示例或我可以传输给 Postman 的东西。谢谢!
使用以下 REST API:
“https://circuitsandbox.net/rest/v2/conversations/ConversationID/messages”
正在尝试发送带有换行符的消息
内容:你好\r\n世界”——或者——"content: "你好CRLF世界”
https://circuitsandbox.net/rest/v2/conversations/<ConversationID>/messages"
"accept", 'application/json'
"content-type", 'application/x-www-form-urlencoded'
"Authorization", "Bearer <Token>"
"content= Hello\r\nWorld"
预期:
你好
世界
实际:
你好世界
内容应 HTML 支持一组有限的标签:strong、i、ul、ol、li 和链接。
例如:您可以将内容设置为:
This is a test<br> It can be <strong> formatted</strong> <i>a little</I>
目前我发送的是纯文本消息,如何设置我发送的文本消息在对话中可见的格式?我是否需要指定不同的内容类型或以某种方式在 REST API 中发送富格式或 html 格式?例如我想发送换行符 (\r\n) 或将响应格式化为来自机器人的列表。
如果可能,请提供一个 curl 工作示例或我可以传输给 Postman 的东西。谢谢!
使用以下 REST API: “https://circuitsandbox.net/rest/v2/conversations/ConversationID/messages”
正在尝试发送带有换行符的消息
内容:你好\r\n世界”——或者——"content: "你好CRLF世界”
https://circuitsandbox.net/rest/v2/conversations/<ConversationID>/messages"
"accept", 'application/json'
"content-type", 'application/x-www-form-urlencoded'
"Authorization", "Bearer <Token>"
"content= Hello\r\nWorld"
预期:
你好
世界
实际:
你好世界
内容应 HTML 支持一组有限的标签:strong、i、ul、ol、li 和链接。
例如:您可以将内容设置为:
This is a test<br> It can be <strong> formatted</strong> <i>a little</I>