Last active
August 6, 2018 09:13
-
-
Save artemgordinskiy/e71c67b8cbc5a2eef7dfebbf44b302e7 to your computer and use it in GitHub Desktop.
Trigger Customer.io event with attachments in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import requests | |
from customerio import CustomerIO | |
file_content = requests.get(file_url).content | |
file_base64 = base64.b64encode(file_content) | |
customer_io = CustomerIO(site_id, api_key) | |
customer_io.track( | |
customer_id=1, | |
name='send_diz_shit', | |
attachments={'some.pdf': file_base64} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment