efaraneda's picture
Upload 2 files
dabad6b verified
Raw History Blame Contribute Delete
612 Bytes
import requests
import json
def enviar_evento(email, evento):
headers = {
'Content-Type': 'application/json',
'Accept': '*/*'
}
data = {
"api_key": "f80efefa371aab8b7cde391020d33ed1",
"events": [{
"device_id": email,
"event_type": evento
}]
}
response = requests.post('https://api2.amplitude.com/2/httpapi',
headers=headers, data=json.dumps(data))
if response.status_code == 200:
print("Success:", response.json())
else:
print("Error:", response.text)