frombraze.clientimportBrazeClientclient=BrazeClient(api_key='YOUR_API_KEY',use_auth_header=True)r=client.user_track(attributes=[{'external_id':'1','first_name':'First name','last_name':'Last name','email':'email@example.com','status':'Active',# And other fields ...}],events=None,purchases=None,)ifr['success']:# do our magic hereprint('Success!')print(r)else:print(r['client_error'])print(r['errors'])
For more examples, check examples.py.
How to test
To run the unit tests, make sure you have the tox module installed
and run the following from the repository root directory: