Last active
November 1, 2017 23:04
-
-
Save teenoh/bfd43e9a6a6d178b36ed1d44e18050a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def send_text_message(recipient_id, message): | |
data = json.dumps({ | |
"recipient": {"id": recipient_id}, | |
"message": {"text": message} | |
}) | |
params = { | |
"access_token": <PAGE_ACCESS_TOKEN> | |
} | |
headers = { | |
"Content-Type": "application/json" | |
} | |
r = requests.post("https://graph.facebook.com/v2.6/me/messages", | |
params=params, headers=headers, data=data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment