narenarya

Slack Webhook tips

Jan 19th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. import json
  2. import requests
  3.  
  4. #This works
  5. requests.post(web_hook_url , data = json.dumps({"text":any_string}))
  6.  
  7. #But not this
  8. requests.post(web_hook_url , data = {"text":any_string})
  9.  
  10. #Because you need to submit json string not python string to Slack API
Advertisement
Add Comment
Please, Sign In to add comment