# Incoming Webhooks : Payload and Attachment Documentation

**URL:** <https://forum.mattermost.com/t/incoming-webhooks-payload-and-attachment-documentation/1300>\
**Category:** Troubleshooting\
**Created:** [April 12, 2016, 2:29pm UTC](https://forum.mattermost.com/t/incoming-webhooks-payload-and-attachment-documentation/1300 "2016-04-12T14:29:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Humbert](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@Humbert](https://forum.mattermost.com/u/Humbert)\
**Post date:** [April 12, 2016, 2:29pm UTC](https://forum.mattermost.com/t/incoming-webhooks-payload-and-attachment-documentation/1300/1 "2016-04-12T14:29:29Z")

</div>

Hi everybody,

I try to find some information, documentation about payload to use for Incoming Webhooks.  
It’s easy to use basics values.  
For example : payload={“username”: “robot”, “text”: “Hello, this is some text.”}

But I don’t find other information about how to use the value **“attachment”** or where I can find alls values available.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![hmhealey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/hmhealey/32/1915_2.png) [@hmhealey](https://forum.mattermost.com/u/hmhealey)\
**Post date:** [April 13, 2016, 3:03pm UTC](https://forum.mattermost.com/t/incoming-webhooks-payload-and-attachment-documentation/1300/2 "2016-04-13T15:03:17Z")

</div>

Hi Humbert,

We don’t have documentation for the webhook attachment feature yet, but it would certainly be helpful. I’ve created [a ticket](https://mattermost.atlassian.net/browse/PLT-2575) to get some created.

In the meantime, does anyone in the community have any guidance or an example integration that shows how to use it?

---

<div class="post-metadata">

**Author:** ![johncoleman83](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/johncoleman83/32/1611_2.png) [@johncoleman83](https://forum.mattermost.com/u/johncoleman83)\
**Post date:** [August 26, 2018, 3:01am UTC](https://forum.mattermost.com/t/incoming-webhooks-payload-and-attachment-documentation/1300/3 "2018-08-26T03:01:26Z")

</div>

Although I cannot yet successfully create a webhook post with `attachments` as a data attribute, there currently is updated documentation for this now here:

Message Attachments: [https://docs.mattermost.com/developer/message-attachments.html](https://docs.mattermost.com/developer/message-attachments.html)  
And in the developers, incoming webhooks: [https://developers.mattermost.com/integrate/incoming-webhooks/](https://developers.mattermost.com/integrate/incoming-webhooks/)

---

<div class="post-metadata">

**Author:** ![spankywetfish](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@spankywetfish](https://forum.mattermost.com/u/spankywetfish)\
**Post date:** [February 6, 2019, 10:42pm UTC](https://forum.mattermost.com/t/incoming-webhooks-payload-and-attachment-documentation/1300/4 "2019-02-06T22:42:11Z")

</div>

I know this is old, but for anyone wanting to do this in python3, this is the inelegant way I’ve been posting IWH attachments.

```auto
#!/usr/bin/python3
import urllib3
import json
import certifi

mmURL = 'https://<yourwebhookURLhere>'

output_data = {}
output_data['text'] = 'text)'
output_data['username'] = 'username'
output_data['icon'] = 'icon URL'
output_data['title'] = 'title'
output_data['pretext'] = 'pretext'

attachment_data = {}
attachment_data['attachments'] = [output_data]
output_data_json=json.dumps(attachment_data)

def SendToMM(output_data):
	http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED',ca_certs=certifi.where())
	req = http.request("POST", mmURL, body=output_data_json, headers={'Content-Type': 'application/json'})
	print (req.data.decode("utf-8"))
	return

SendToMM(output_data)

```

Hopefully it’ll be of use to someone.
