Bento

Events

Events are the connecting superpower of Bento. Events are that micro-data that empowers you to make informed decisions based on the micro, not the macro. They can store incredibly detailed and granular information, offering insights that might otherwise be overlooked. Beyond just data storage, these events can trigger sophisticated automations and workflows, ensuring seamless and intelligent responses to user actions. By leveraging these micro-events, you can fine-tune your strategies and operations.

Available Endpoints

MethodEndpointName
POST/batch/eventsCreate Events

The Events Model

The events model requires you pass an event, an email of the user fields, details and the date are all optional fields to record meta data of the event or the visitor.

Properties

  • Name
    type
    Type
    string
    Description

    The name of the event

  • Name
    email
    Type
    string
    Description

    Email of the event user

  • Name
    fields
    Type
    object
    Description

    Key value array of fields for the event should not be nested

  • Name
    details
    Type
    object
    Description

    Key value array of fields for the event can be nested


POST/v1/batch/events

Create Events

This endpoint is used to send events to your site. Events will create new users if they do not already exist in your account.

Required Attributes

  • Name
    type
    Type
    string
    Description

    The name of the event

  • Name
    email
    Type
    string
    Description

    Email of the event user

Optional Attributes

  • Name
    fields
    Type
    object
    Description

    Key value array of fields for the event should not be nested

  • Name
    details
    Type
    object
    Description

    Key value array of fields for the event can be nested

Request

POST
/v1/batch/events
curl -L -X POST 'https://app.bentonow.com/api/v1/batch/events?site_uuid=ExampleID1234' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic BASE64ENCODE(USERNAME+PASSWORD)' \
--data-raw '{
      "events": [
        {
          "type": "$completed_onboarding",
          "email": "[email protected]"
        },
        {
          "type": "$completed_onboarding",
          "email": "[email protected]",
          "fields": {
            "first_name": "Jesse",
            "last_name": "Pinkman"
          }
        },
        {
          "email": "[email protected]",
          "type": "$purchase",
          "fields": {
            "first_name": "Jesse"
          },
          "details": {
            "unique": {
              "key": "test123"
            },
          "value": {
            "currency": "USD",
            "amount": 8000
          },
          "cart": {
            "items": [
              {
                "product_sku": "SKU123",
                "product_name": "Test",
                "quantity": 100
              }
            ],
            "abandoned_checkout_url": "https://test.com"
          }
        }
      }
      ]
}'


Response

Returns the count of events recorded.

JSON Response

{
  "results":1,
  "failed":0
}

Was this page helpful?