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.

Revisions

  1. maxgutman revised this gist Sep 26, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.py
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@

    configuration = mparticle.Configuration()
    configuration = mparticle.Configuration()
    configuration.api_key = settings.MPARTICLE_API_KEY
    configuration.api_secret = settings.MPARTICLE_API_SECRET
  2. maxgutman revised this gist Sep 26, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.py
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@

    configuration = mparticle.Configuration()
    configuration.api_key = settings.MPARTICLE_API_KEY
    configuration.api_secret = settings.MPARTICLE_API_SECRET
  3. maxgutman renamed this gist Sep 26, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. maxgutman created this gist Sep 26, 2018.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    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)