Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sendMessage(spaceId, messageTitle, messageText):
- urlToPostMessageBack = "/teams/" + spaceId + "/messages"
- jsonRaw ={
- "type": "appMessage",
- "version": 1,
- "annotations": [
- {
- "type": "generic",
- "version": 1,
- "text": "<enter your text here>"
- }
- ]
- }
- headers = {'Authorization': "Bearer " + getToken(), "Content-Type" : "application/json"}
- resp = requests.post("https://api.watsonwork.ibm.com" + urlToPostMessageBack, data={"body": json.dumps(jsonRaw, ensure_ascii=False)}, headers = headers)
- print resp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement