Python
Prerequisites
- ezePing API Key, available instantly after creating an account. You can copy it from here (opens in a new tab).
- Event Category Name is the category to which you want to send this event. If you haven't created an event category yet, you can create a new category here (opens in a new tab).
Payload
You can send any payload, as long as it is in a valid JSON format.
json
'fields': {
'amount': 50,
'plan': 'PRO',
'email': 'user@email.com'
}
Installation
Python
import requests
import json
url = 'https://www.ezeping.com/api/v1/events'
headers = {
'Authorization': 'Bearer <YOUR_API_KEY>',
'Content-Type': 'application/json'
}
data = {
'category': '<YOUR_CATEGORY_NAME>',
'fields': {
'field1': 'value1', # for example: user id
'field2': 'value2' # for example: user email
}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
# Check if the request was successful
if response.status_code == 200:
print("Request was successful:", response.json())
else:
print("Request failed with status:", response.json())