Quantcast
Channel: Mattermost Discussion Forums - Latest posts
Viewing all articles
Browse latest Browse all 25517

JSON order matters for parsing?

$
0
0

Hi all,

I'm trying to write a short python service based on flask, to work with a custom command.

So far it works fine - it sends the custom command fine, the program then spits out the following json:

{"attachments": 
[{"color": "#000000", 
"fields": [
{"title": "Time since created", "value": "06:22:07.452919"}, 
{"title": "Completed", "value": "20.48"}
], 
"pretext": "Run progress", 
"title": "1725"}, 
{"color": "#888888", "fields": [
{"title": "Sources Processed", "value": "24088509.000000"}, 
{"title": "Total Sources", "value": "117603945.000000"}, 
{"title": "Sources per minute", "value": 63058.924083769634}, 
{"title": "Estimated Completion", "value": "24:42:59.09759"}
], 
"pretext": "Detailed statistics", 
"title": "1725"}
], 
"response_type": "in_channel", 
"text": "Run status on dpac_c2"}

The trouble I have is that, I only get the "text" to show up in the channel, I don't see any of the goodies in that attachments. Is that because the parser needs the json to be formatted in a specific order to function?

Any pointers is appreciated! I've not found anything in the documentation or the logs making it clear to me why it wouldn't work... (And I'm only fiddling with python because I started off copying the work done on the Jira webhook integration... Maybe I'm missing something there too)
Jon

EDIT: I have also managed to send the JSON payload through curl to an incoming webhook and again - only the text aspect is parsed... Any clue?


Viewing all articles
Browse latest Browse all 25517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>