Add custom events to contact timeline via API

Modified on Sat, 13 Nov 2021 at 09:10 PM

You can add custom events to your contact’s timeline and activity log using the addNewActivity API call. This is beneficial if you would like to log data from your own platform to your Brainstorm Automation account, such as support tickets and more.

To add a custom event, use the function below using CURL or PHP and replace the data with your own API KEY  as well as the contact’s id:

<?php 
    require_once('../PATH/TO/services/EmailMarketingWS.php');

    // Replace {YOUR_API_KEY} with the API KEY provided from the link above.
    $user_key = array('api_key' => '{YOUR_API_KEY}');
    
    $app = new EmailMarketingWS($user_key);
    $parms = array(
        'id' => 'xxxxx',                              // Replace with the Contact ID
        'description' => 'this is my first activity', // Replace the Description with your Activity's description.
        'datetime' => '2018-08-23 18:00',             // Replace with the Date and Time the Activity is recorded
    );

    $results = $app->addNewActivity($parms);

    print_r($results);
?>

The end result will look like this:

 

Note that you can use the activity filter to preview the custom events within the contact’s timeline.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article