🚨Info 🚨: Project is deprecated and archived. Please fork archived repository to continue development on your own.
Python client for Crossengage's API
Library supports next methods:
User profile management
get_user(self, user)
| v2update_user(self, user)
| v1update_user_async(self, user)
| v2delete_user(self, user)
| v1delete_user_async(self, user)
| v2delete_user_by_xng_id(self, user)
| v1track_user_task(self, tracking_id)
| v2
User attributes management
add_user_attribute(self, attribute_name, attribute_type, nested_type)
| v1add_nested_user_attribute(self, parent_name, attribute_name, attribute_type)
| v1list_user_attributes(self, offset, limit)
| v1delete_user_attribute(self, attribute_id)
| v1
Bulk user management
batch_process(self, delete_list=[], update_list=[])
| v1batch_process_async(self, delete_list=[], update_list=[])
| v2
Events management
send_events(self, events, email=None, user_id=None, business_unit=None)
| v1
Opt-Out Management
get_user_opt_out_status(self, user_id)
| v1update_user_opt_out_status(self, user_id, channel_name)
| v1update_user_opt_in_status(self, user_id, channel_name)
| v1
Make sure you have Python 2.7.11+ or Python 3.4+ installed and run:
$ git clone git@github.com:hellofresh/crossengage-python-client.git
$ cd crossengage-python-client
$ python setup.py install
from crossengage.client import CrossengageClient
client = CrossengageClient(client_token='YOUR_TOKEN')
# 1. Create / update new user and send
response = client.update_user(user={
'id': '2',
'email': 'test@example.com',
'firstName': 'First name',
'lastName': 'Last name',
'birthday': '1982-08-30',
'createdAt': '2015-10-02T08:23:53Z',
'gender': 'male',
})
if response['success']:
print('Create / Update Successful!')
else:
print(response['errors'])
For more examples, check examples.py
.
To run the unit tests, make sure you have the nose module instaled and run the following from the repository root directory:
$ make setup && make test