Skip to content

Instantly share code, notes, and snippets.

@tejastank
Created August 6, 2022 05:12
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 tejastank/c7099f22bca11b7117521b9c8d8e8daa to your computer and use it in GitHub Desktop.
Save tejastank/c7099f22bca11b7117521b9c8d8e8daa to your computer and use it in GitHub Desktop.
Well tested and implemented software via official whtsapp API
import requests
import json
url = "https://graph.facebook.com/v13.0/101878115921874/messages"
payload = json.dumps({
"messaging_product": "whatsapp",
"to": "918733067278",
"type": "template",
"template": {
"name": "hello_world",
"language": {
"code": "en_US"
}
}
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer EAAIcDJEZC4KMBAGRZAz9rokLqP3sRHgC24BuyWVi8ZBwLVt1jnC4cZCbkJQudMzNCE9iYL2fmjGGxG9BIcJwrhXdbYDaCb2gGIfZCZBiVfKLtkX4fChTayg9C9ZCgq07RLgoBC0kahdOQ9M0WOYaj6U5xQZA2tdttjLUgWZBH43pkRJSP3kH6AkvtQ22PKYpEGfOTQ8XZASer0ZAwZDZD'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment