Create Audience Filter

Create Audience Filter API is used to Add Audience filter.

Here are the steps and API endpoints to Create Audience Filter in the Accelevents platform.

📘

Required

  • User should have Log In with Admin/Super Admin Role or needs host side access.

Calling these following API sequence will help you to create Audience Filter in our platform

StepDescriptionAPI Reference
Get Master Json to set Form FieldsGet Available Fields and their value options.

This API will provide you JSON data in which there will be field such as type field
Get Master JSON
Get Reference Value For a specific Field.Get value for a specific field and specific type for build a filter.Get Reference Field values for a particular attribute of a Organizer
Create Audience FilterThis API will be used to Create an Audience Filter.
In Response, the Long value of created filter id will be returned.
Create Audience Filter

1. Get Master JSON

This API Used to get Configure Json that include filter type, field, value type.
API used at host side, event admin, and super admin can access this API. It will return data in JSON.

2. Get Reference Value For a Specific Field.

This API is used to get available values of a specific field and type to create a filter.

3. Create Audience Filter

This API used to create an Audience Filter.
In Response, there will be an ID of that created filter.

Here is a sample for Request Body of filter JSON which will send to API.

{
  "filterJson": {
    "date": {
      "startDate": "",
      "endDate": "",
      "format": "MM-DD-YYYY"
    },
    "conditionalOperator": "all",
    "conditions": [
      {
        "type": "single",
        "condition": {
          "isInstance": false,
          "columnName": "firstName",
          "columnValue": "Test",
          "operator": "CONTAINS",
          "dataType": "string"
        },
        "filterName": "profile"
      },
      {
        "type": "single",
        "condition": {
          "isInstance": false,
          "dataType": "string",
          "operator": "CONTAINS",
          "columnName": "lastName",
          "columnValue": "Test"
        },
        "filterName": "profile"
      }
    ]
  }
}
{
  "filterJson": {
    "date": {
      "startDate": "",
      "endDate": "",
      "format": "MM-DD-YYYY"
    },
    "conditionalOperator": "all",
    "conditions": [
      {
        "type": "single",
        "condition": {
          "isInstance": true,
          "columnName": "firstName",
          "columnValue": "Test",
          "operator": "CONTAINS",
          "dataType": "string",
          "instanceName": "purchaser"
        },
        "filterName": "register"
      },
      {
        "type": "single",
        "condition": {
          "isInstance": true,
          "dataType": "string",
          "operator": "CONTAINS",
          "columnName": "firstName",
          "columnValue": "Test",
          "instanceName": "ticketHolder"
        },
        "filterName": "register"
      }
    ]
  }
}
{
  "filterJson": {
    "date": {
      "startDate": "",
      "endDate": "",
      "format": "MM-DD-YYYY"
    },
    "conditionalOperator": "all",
    "conditions": [
      {
        "type": "single",
        "condition": {
          "isInstance": false,
          "columnName": "sessionid",
          "columnValue": "11257",
          "operator": "IS",
          "dataType": "number",
          "mappedValue": "new test session (second-audience-org )",
          "attribute": [
            {
              "columnName": "eventid",
              "isInstance": false,
              "operator": "IS",
              "dataType": "number",
              "columnValue": "5309",
              "mappedValue": "first-event-audience",
              "mappingKey": "eventName",
              "mappingDataType": "string"
            }
          ],
          "mappingKey": "joinedsession",
          "mappingDataType": "string"
        },
        "filterName": "engagement"
      },
      {
        "type": "single",
        "condition": {
          "isInstance": false,
          "dataType": "string",
          "operator": "CONTAINS",
          "columnName": "likepost",
          "columnValue": "aa"
        },
        "filterName": "engagement"
      }
    ]
  }
}
{
  "filterJson": {
    "date": {
      "startDate": "",
      "endDate": "",
      "format": "MM-DD-YYYY"
    },
    "conditionalOperator": "all",
    "conditions": [
      {
        "type": "group",
        "conditionalOperator": "all",
        "conditions": [
          {
            "type": "single",
            "condition": {
              "isInstance": false,
              "columnName": "firstName",
              "columnValue": "Test",
              "operator": "CONTAINS",
              "dataType": "string"
            },
            "filterName": "profile"
          },
          {
            "type": "single",
            "condition": {
              "isInstance": false,
              "dataType": "string",
              "operator": "CONTAINS",
              "columnName": "lastName",
              "columnValue": "Test"
            },
            "filterName": "profile"
          },
          {
            "type": "single",
            "condition": {
              "isInstance": true,
              "columnName": "firstName",
              "columnValue": "Test",
              "operator": "CONTAINS",
              "dataType": "string",
              "attribute": [
                {
                  "columnName": "eventid",
                  "isInstance": false,
                  "operator": "IS",
                  "dataType": "number",
                  "columnValue": "5309",
                  "mappedValue": "first-event-audience",
                  "mappingKey": "eventName",
                  "mappingDataType": "string"
                }
              ],
              "instanceName": "purchaser"
            },
            "filterName": "register"
          }
        ]
      }
    ]
  }
}
{
  "filterJson": {
    "date": {
      "startDate": "",
      "endDate": "",
      "format": "MM-DD-YYYY"
    },
    "conditionalOperator": "all",
    "conditions": [
      {
        "type": "single",
        "condition": {
          "isInstance": false,
          "columnName": "firstName",
          "columnValue": "Test",
          "operator": "CONTAINS",
          "dataType": "string"
        },
        "filterName": "profile"
      },
      {
        "type": "single",
        "condition": {
          "isInstance": true,
          "columnName": "firstName",
          "columnValue": "Test",
          "operator": "CONTAINS",
          "dataType": "string",
          "instanceName": "purchaser"
        },
        "filterName": "register"
      },
      {
        "type": "single",
        "condition": {
          "isInstance": true,
          "dataType": "string",
          "operator": "CONTAINS",
          "columnName": "firstName",
          "columnValue": "Test",
          "instanceName": "ticketHolder"
        },
        "filterName": "register"
      },
      {
        "type": "single",
        "condition": {
          "isInstance": false,
          "columnName": "sessionid",
          "columnValue": "11257",
          "operator": "IS",
          "dataType": "number",
          "mappedValue": "new test session (second-audience-org )",
          "mappingKey": "joinedsession",
          "mappingDataType": "string"
        },
        "filterName": "engagement"
      }
    ]
  }
}