Skip to content

Instantly share code, notes, and snippets.

@maxgutman
Last active September 26, 2018 21:07
Show Gist options
  • Save maxgutman/ac6f21e6085b61782a121e7fc84cbb73 to your computer and use it in GitHub Desktop.
Save maxgutman/ac6f21e6085b61782a121e7fc84cbb73 to your computer and use it in GitHub Desktop.
mparticle-cmb
configuration = mparticle.Configuration()
configuration = mparticle.Configuration()
configuration.api_key = settings.MPARTICLE_API_KEY
configuration.api_secret = settings.MPARTICLE_API_SECRET
batch = mparticle.Batch()
batch.environment = 'production'
batch.user_identities = mparticle.UserIdentities(customerid=profile_id)
batch.events = [mparticle.AppEvent(
event_name='Connection Summary',
custom_attributes={
'New Connections': total_new_connections,
'Expired Connections': total_expired_connections,
}
)]
batches.append(batch)
mparticle_api = mparticle.EventsApi(configuration)
mparticle_api.bulk_upload_events(batches)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment