-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathCreateInstanceAsync.py
More file actions
33 lines (29 loc) · 1013 Bytes
/
CreateInstanceAsync.py
File metadata and controls
33 lines (29 loc) · 1013 Bytes
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
import asyncio
from whatsapp_api_client_python import API
greenAPI = API.GreenApiPartner(
"gac.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst"
)
async def main():
settings = {
"name": "Created by Python SDK",
"webhookUrl": "https://webhook.url",
"webhookUrlToken": "auth_token",
"delaySendMessagesMilliseconds": 5000,
"markIncomingMessagesReaded": "yes",
"markIncomingMessagesReadedOnReply": "yes",
"outgoingWebhook": "yes",
"outgoingMessageWebhook": "yes",
"outgoingAPIMessageWebhook": "yes",
"stateWebhook": "yes",
"incomingWebhook": "yes",
"keepOnlineStatus": "yes",
"pollMessageWebhook": "yes",
"incomingCallWebhook": "yes",
"editedMessageWebhook": "yes",
"deletedMessageWebhook": "yes"
}
response = await greenAPI.partner.createInstanceAsync(settings)
if response.code == 200:
print(response.data)
if __name__ == '__main__':
asyncio.run(main())