Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

By default we create a new Audience ID (in the above example a5940e473cea659.356693871497425011). You can however also ignore that and return us with your own ID, or forward the ID created in the 3rd party system. We will then use that ID in subsequent "Add to Audience"-calls which reduces the need for maintaining a mapping in your service. In order to do that you need to return a JSON key "id" in your 200 OK response, like 

Code Block
{"id":"12345"}

Add to Audience / Remove from Audience

During creation of a new segment audience change in the system a POST request will be executed with a JSON payload (Content-Type: application/json).

Please be aware of the fact that the Mutation array will likely contain multiple entries for users being added/removed to one or multiple audiences. This micro-batching mechanism is configured to send once it contains 100 users, or when 1 second is past: whatever comes first. This configuration is subject to change at any point in time without prior notification. 

We recommend to process those mutations in parallel to reduce the latency of your endpoint given the response time requirements. In addition it may be advisable to put the received JSON payloads after in a message queue (in Google that would be PubSub, in AWS that may be SQS) and process them asynchronously in the background. That allows you to quickly respond after validating the payload and headers, while still allowing you for enough time to forward the request to the 3rd party system. 

Example Add: POST https://my-endpoint.com/?type=ADD_TO_AUDIENCE

Code Block
{
    "Type": "ADD_TO_AUDIENCE",
    "Mutations": [{
        "Uuid": "ab043529-3e55-4672-52f0-18887ea12345",
        "Audience": "a5940e473cea659.356693871497425011",
        "Customer": 123,
        "Platform": 113,
        "External_user_id": "12478286329"
    }]
}

Example Remove: POST https://my-endpoint.com/?type=REMOVE_FROM_AUDIENCE

Code Block
{
    "Type": "REMOVE_FROM_AUDIENCE",
    "Mutations": [{
        "Uuid": "ab043529-3e55-4672-52f0-18887ea12345",
        "Audience": "a5940e473cea659.356693871497425011",
        "Customer": 123,
        "Platform": 113,
        "External_user_id": "12478286329"
    }]
}

...