Created
May 26, 2016 14:23
-
-
Save otso/87f7a1b841a6e177280b95187b985cd5 to your computer and use it in GitHub Desktop.
Example testing script for a Facebook Messenger bot running in localhost
This file contains 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
#!/bin/bash | |
URL="http://127.0.0.1:8000/api/1.0/bot/webhook" | |
read -r -d '' MESSAGE_JSON << EOM | |
{ | |
"object": "page", | |
"entry": [ | |
{ | |
"id": <REPLACE_RECIPIENT_ID>, | |
"time": 1460998316941, | |
"messaging": [ | |
{ | |
"sender": { | |
"id": <REPLACE_SENDER_ID> | |
}, | |
"recipient": { | |
"id": <REPLACE_RECIPIENT_ID> | |
}, | |
"timestamp": 1460998316851, | |
"message": { | |
"mid": "mid.1460998316839:534effeb2477100249", | |
"seq": 25, | |
"text": "hi!!!" | |
} | |
} | |
] | |
} | |
] | |
} | |
EOM | |
curl -X POST -H "Content-Type: application/json" -d "$MESSAGE_JSON" "$URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment