0

I am trying to figure out how to send a table to a mattermost channel using a cURL command.

The command from the instructions of mattermost does not work with windows . This is how my code currently looks like. I followed the instructions in the manual. in this manual is the command for linux/mac

curl -i -X POST -H "Content-Type: application/json" -d "{
  \"text\": \"#### Test results for July 27th, 2017\n bitte folgende Fehler pruefen\n
  ^| Datum      ^| Uhrzeit     ^| Meldung                                        ^|
  ^|:-----------^|:-----------:^|:-----------------------------------------------^|
  ^| Server     ^| 948         ^| :white_check_mark: 0                           ^|
  ^| Web Client ^| 123         ^| :warning: 2 [(see details)]                    ^|
  ^| iOS Client ^| 78          ^| :warning: 3 [(see details)]                    ^|
  \"}" https://mysecret.com/abcdefg

But the command is not converted into a table - is displayed as a normal message

ajl31701
  • 79
  • 1
  • 5

1 Answers1

0

I have tested the unescaped text directly in Mattermost, not with the cURL command, however I still noticed there must be a double newline character before the table definition, like so:

#### Test results for July 27th, 2017
bitte folgende Fehler pruefen


| Datum      | Uhrzeit    | Meldung                                        |
| :------------ | :---------------: | -----: |
| Server     | 948         | :white_check_mark: 0                          |
| Web Client | 123         | :warning: 2 [(see details)]                   |
| iOS Client | 78          | :warning: 3 [(see details)]   |

Notice the empty line, between the text and the table. This empty line is not shown when the message is displayed.

cmousset
  • 625
  • 7
  • 21