How to Send Past Events

If you have migrated from another service or just created an eSputnik account, and you have a history of

  • offline orders,
  • contact activity,
  • subscriptions,
  • or other events you want to use for advanced segmentation,

you can transfer the available data from your CRM or other data store to the eSputnik system via the API resource v1/past_events.

To assign events to contacts, pre-import the contact database to your eSputnik account.

The resource v1/past_events allows you to transfer all the necessary events and to specify their time.

Let's consdier a typical purchase event that is transferred to an account using v1/event to notify the customer that their order has been accepted, or to report that the order has been processed and handed over to the postal service for delivery. In short, send a transactional notification to any of the available media channels (or those that the client considers preferable).

{

     "eventTypeKey": "orderCreated",

     "keyValue": "buyer.contact@email.com",

     "params": [{

     "name": "email",

     "value": "buyer.contact@email.com"

  },{

     "name": "product_name",

     "value": "Apple iPhone 11 256Gb Black"

  },{

     "name": "image_url",

     "value": "https://example.com/iphone11.png"

  },{

     "name": "product_url",

     "value": "https://example.com/iphone11"

  },{

     "name": "cost",

     "value": "999"

  }]

}

For example, you have a certain number of orders over the past year, and you want to build a segment with customers interested in a certain type of products or services, get statistics on the average check, or segment contacts by geodata (if applicable).

Convert these orders into a JSON format supported for API according to the specification, and send them to the eSputnik system. You can send an array of up to 500 such events within one request. Specify the time of each event in the field occurred. Format of date: YYYY-MM-DD; format of date with the time: YYYY-MM-DDTHH:mm.

For example, you send an order of two mobile devices bought at one-year interval:

{

  "events": [

  {

     "eventTypeKey": "orderCreated",

     "keyValue": "buyer.contact@email.com",

     "params": [

  {

     "name": "product_name",

     "value": "Apple iPhone 11 256Gb Black"

  },{

     "name": "image_url",

     "value": "https://example.com/iphone11.png"

  },{

     "name": "product_url",

     "value": "https://example.com/iphone11"

  },{

     "name": "cost",

     "value": "999"

  }],

     "occurred": "2020-06-04T13:43"

  },{

     "eventTypeKey": "orderCreated",

     "keyValue": "buyer.contact@email.com",

     "params": [

  {

     "name": "product_name",

     "value": "Apple iPhone Xs Max 256Gb Space Gray"

  },{

     "name": "image_url",

     "value": "https://example.com/iphoneXs.png"

  },{

     "name": "product_url",

     "value": "https://example.com/iphoneXs"

  },{

     "name": "cost",

     "value": "899"

  }],

     "occurred": "2019-05-04T14:17"

  }]

}

Apart from basic fields with the name, price and link to the product, you can send any related data that will be available to build segments. For example, you can send the country and city of the buyer to use for segmentation by geolocation.

{

    "name": "city",

    "value": "Los Angeles"

 },{

    "name": "country",

    "value": "USA"

}

Segments

You can also delete old or irrelevant events. To do this, send a request to the same resource v1/past_events, but using the method type DELETE. Specify the time range to remove in the request body:

{

    "from" : "2019-06-04T10:47",

    "to" : "2020-01-04T13:33"

}

The method DELETE is inactive by default. To activate it, please contact our support at support@esputnik.com.

Any Questions?
We’re always happy to help!
Request a Callback
Fill in the form, and our specialists will call you back as soon as possible.
Request a Callback
Chat Support
We’re waiting for your questions!
Send a Chat Message
Email
Contact the eSputnik support team
Send an Email