Skip to content

Instantly share code, notes, and snippets.

@otso
Created May 26, 2016 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otso/87f7a1b841a6e177280b95187b985cd5 to your computer and use it in GitHub Desktop.
Save otso/87f7a1b841a6e177280b95187b985cd5 to your computer and use it in GitHub Desktop.
Example testing script for a Facebook Messenger bot running in localhost
#!/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