Python Example
Continuing from the example in Your First Message Template, you can send your transactional message in python with the following.
1
import requests
2
from requests.structures import CaseInsensitiveDict
3
​
4
url = "https://txnhog.co/txn/api/your_message_key"
5
​
6
headers = CaseInsensitiveDict()
7
headers["Content-Type"] = "application/x-www-form-urlencoded"
8
​
9
data = "apiKey=sdkrjwhaldkgh3pwdfohawp4lyu&name=Shawn%20Spencer&phone=2085559988"
10
​
11
​
12
resp = requests.post(url, headers=headers, data=data)
13
​
14
print(resp.status_code)
Copied!
Last modified 6mo ago
Copy link