-
Notifications
You must be signed in to change notification settings - Fork 0
/
testWebhook.py
36 lines (31 loc) · 1.7 KB
/
testWebhook.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import requests
import json
# payload = {u'entry': [
# {u'messaging': [
# {u'timestamp': 1480197139793,
# u'message':
# {u'text': u'Arrived',
# u'is_echo': True,
# u'app_id': 628060924045502,
# u'seq': 404,
# u'mid': u'mid.1480197139793:82ecb50989'},
# u'recipient': {u'id': u'1173757599378036'},
# u'sender': {u'id': u'345435105819111'}}],
# u'id': u'345435105819111',
# u'time': 1480197140165}],
# u'object': u'page'}
# payload = {u'entry':
# [{u'messaging': [{u'read': {u'seq': 413, u'watermark': 1480197939810}, u'timestamp': 1480197940174, u'recipient': {u'id': u'345435105819111'}, u'sender': {u'id': u'1173757599378036'}}], u'id': u'345435105819111', u'time': 1480197941320}], u'object': u'page'}
payload = {'body': 'Francisc'}
payload = json.dumps(payload)
# {u'message': {u'app_id': 628060924045502,
# u'is_echo': True,
# u'mid': u'mid.1480197139793:82ecb50989',
# u'seq': 404,
# u'text': u'ol'},
# u'recipient': {u'id': u'1173757599378036'},
# u'sender': {u'id': u'345435105819111'},
# u'timestamp': 1480197139793}
r = requests.post("https://04e27ba9.ngrok.io/chat/hardware/", data=payload)
# response = r.json()
# print response