Audience

Audience filter create with GeofenceQuery

POST https://exchange-prod-g.2mee.com/filter/add

Creating a new Audience segment with Geo Location to deliver notification to choosen location. Filters can be chosen from the filter/wrapper API.

Request Body

NameTypeDescription

appId

string

Application Id for which the audience segment has to be created. (Prerequisite)

name

string

Name for the Audience

query

string

Audience query, it refers to the filter that narrows down on the application users as per your requirement . An example query: [[{"name":"Country","printName":"Country","icon": "globe","key":"","operations":"is","options":"IN"}]] GeoFence can be added in the below format.GeoFenceOptions consists of 4 parameters latitude,longitude,radius,metric. Metric can be "km" or "mile". [[{"name":"GeoLocation","printName":"Location", "icon":"segment_location","operations":"location","options":"[17.406350887405512,78.51008001163942,0.2,"km"]"}]]

{
  "id" : "3ad61dcf-7ae4-490d-8d51-52428e225aa0",
  "appId" : "bacb37d0-a51f-491b-bd68-489c245b8c16",
  "name" : "UK Users with Geo Location",
  "query" : "[[{\"name\":\"Country\",\"printName\":\"Country\",\"icon\":\"globe\",\"key\":\"\",\"operations\":\"is\",\"options\":\"GB\"}],[{\"name\":\"GeoLocation\",\"printName\":\"Location\",\"icon\":\"segment_location\",\"operations\":\"location\",\"options\":\"[ -73.9667,40.82302903,1000,km]\"}]]",
  "type" : "CUSTOM",
  "desc": [
        [
            {
                "icon": null,
                "desc": null
            }
        ]
    ],
  "is_default": 0,
  "hidden" : false
}
$ curl 'https://exchange-prod-g.2mee.com/filter/add' -i -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0aW5ndGVhbUAybWVlLmNvbSIsImV4cCI6MTU3OTYyMjQ1NiwiaWF0IjoxNTc5NjA0NDU2fQ.vogap4Na2O8-z4lLowb8zMdyAWsp2iajr_XwIsYAHEDodzejcYgp2m2yF874xjk67OhkScWGXeIp7gongfhKtQ' -d '{
  "appId" : "bacb37d0-a51f-491b-bd68-489c245b8c16",
  "name" : "UK Users with Geo Location",
  "query" : "[[{\"name\":\"Country\",\"printName\":\"Country\",\"icon\":\"globe\",\"key\":\"\",\"operations\":\"is\",\"options\":\"GB\"}],[{\"name\":\"GeoLocation\",\"printName\":\"Location\",\"icon\":\"segment_location\",\"operations\":\"location\",\"options\":\"[ -73.9667,40.82302903,1000,km]\"}]]"
}'

Audience device and user count

GET https://exchange-prod-g.2mee.com/filter/count/{id}

Returns number of devices and the user count that satisfies the filter criteria at the time of retrieving the information.

Path Parameters

NameTypeDescription

id

string

Audience segment picked for the delivery of the message.

{
  "devices" : {
    "deviceCount" : 13,
    "fallbackCount" : 0,
    "faceeCount" : 13,
    "optOut" : 0,
    "effectiveDeviceCount" : 13
  },
  "userCount" : 10
}
$ curl 'https://exchange-prod-g.2mee.com/filter/count/7fa82a9c-e12a-47bc-b980-0cd916c7060e'
 -i -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0aW5ndGVhbUAybWVlLmNvbSIsImV4cCI6MTU4OTQ1NTc0OSwiaWF0IjoxNTg5NDM3NzQ5fQ.U2VtugGzqD0s9p0rUXaTxk8F5tHeMf5SB4ZRnYM8TV4QQm6y2FvdFIfD6kjQOhcYuPglSusAjVegzHqDKGgCqA'

Audience segment wrapper

GET https://exchange-prod-g.2mee.com/filter/wrapper

Listing all the criteria that can be used to form a segment of the audience later picked up for the delivery of the notification.

[ {
  "name" : {
    "key" : "Country",
    "value" : "Country"
  },
  "printName" : null,
  "operations" : [ {
    "key" : "is",
    "value" : "is"
  }, {
    "key" : "is_not",
    "value" : "is not"
  } ],
  "options" : [ {
    "key" : "AU",
    "value" : "Australia"
  }, {
    "key" : "AT",
    "value" : "Austria"
  }, {
    "key" : "AZ",
    "value" : "Azerbaijan"
  }, {
    "key" : "BS",
    "value" : "Bahamas"
  }, {
    "key" : "BH",
    "value" : "Bahrain"
  }, {
    "key" : "BD",
    "value" : "Bangladesh"
  }, {
    "key" : "BB",
    "value" : "Barbados"
  }, {
    "key" : "BY",
    "value" : "Belarus"
  }, {
    "key" : "BE",
    "value" : "Belgium"
  }, {
    "key" : "BZ",
    "value" : "Belize"
  }, {
    "key" : "BJ",
    "value" : "Benin"
  }, {
    "key" : "BM",
    "value" : "Bermuda"
  },  {
    "key" : "DE",
    "value" : "Germany"
  }, {
    "key" : "GH",
    "value" : "Ghana"
  }, {
    "key" : "GI",
    "value" : "Gibraltar"
  }, {
    "key" : "GR",
    "value" : "Greece"
  }, {
    "key" : "GL",
    "value" : "Greenland"
  }, {
    "key" : "GD",
    "value" : "Grenada"
  }, {
    "key" : "GP",
    "value" : "Guadeloupe"
  }, {
    "key" : "GU",
    "value" : "Guam"
  }, {
    "key" : "GT",
    "value" : "Guatemala"
  }, {
    "key" : "GG",
    "value" : "Guernsey"
  }, {
    "key" : "GN",
    "value" : "Guinea"
  }, {
    "key" : "GW",
    "value" : "Guinea-Bissau"
  }, {
    "key" : "GY",
    "value" : "Guyana"
  }, {
    "key" : "HT",
    "value" : "Haiti"
  }, {
    "key" : "HM",
    "value" : "Heard Island And McDonald Islands"
  }, {
    "key" : "HN",
    "value" : "Honduras"
  }, {
    "key" : "HK",
    "value" : "Hong Kong"
  }, {
    "key" : "HU",
    "value" : "Hungary"
  }, {
    "key" : "IS",
    "value" : "Iceland"
  }, {
    "key" : "IN",
    "value" : "India"
  }, {
    "key" : "ID",
    "value" : "Indonesia"
  }, {
    "key" : "IR",
    "value" : "Iran"
  }, {
    "key" : "IQ",
    "value" : "Iraq"
  }, {
    "key" : "IE",
    "value" : "Ireland"
  }, {
    "key" : "IM",
    "value" : "Isle Of Man"
  }, {
    "key" : "IL",
    "value" : "Israel"
  }, {
    "key" : "IT",
    "value" : "Italy"
  }, {
    "key" : "JM",
    "value" : "Jamaica"
  }, {
    "key" : "JP",
    "value" : "Japan"
  }, {
    "key" : "SE",
    "value" : "Sweden"
  }, {
    "key" : "CH",
    "value" : "Switzerland"
  }, {
    "key" : "US",
    "value" : "United States"
  }, {
    "key" : "UM",
    "value" : "United States Minor Outlying Islands"
  }, {
    "key" : "UY",
    "value" : "Uruguay"
  }, {
    "key" : "UZ",
    "value" : "Uzbekistan"
  }, {
    "key" : "VU",
    "value" : "Vanuatu"
  }, {
    "key" : "VA",
    "value" : "Vatican"
  }, {
    "key" : "VE",
    "value" : "Venezuela"
  }, {
    "key" : "VN",
    "value" : "Vietnam"
  }, {
    "key" : "WF",
    "value" : "Wallis And Futuna"
  }, {
    "key" : "EH",
    "value" : "Western Sahara"
  }, {
    "key" : "YE",
    "value" : "Yemen"
  }, {
    "key" : "ZM",
    "value" : "Zambia"
  }, {
    "key" : "ZW",
    "value" : "Zimbabwe"
  }, {
    "key" : "AX",
    "value" : "Åland Islands"
  } ],
  "note" : "Country that device was last located in",
  "inputType" : "dropdown",
  "icon" : "globe",
  "enabled" : true
}, {
  "name" : {
    "key" : "Devicetype",
    "value" : "Device Type"
  },
  "printName" : null,
  "operations" : [ {
    "key" : "is",
    "value" : "is"
  } ],
  "options" : [ {
    "key" : "android",
    "value" : "android"
  }, {
    "key" : "ios",
    "value" : "ios"
  } ],
  "note" : "Device Operating System",
  "inputType" : "dropdown",
  "icon" : "phone-portrait",
  "enabled" : true
}, {
  "name" : {
    "key" : "UserId",
    "value" : "userID"
  },
  "printName" : null,
  "operations" : [ {
    "key" : "is",
    "value" : "is"
  } ],
  "options" : null,
  "note" : "User ID, used for device matching",
  "inputType" : "text",
  "icon" : "person",
  "enabled" : true
}, {
  "name" : {
    "key" : "Language",
    "value" : "Language"
  },
  "printName" : null,
  "operations" : [ {
    "key" : "is",
    "value" : "is"
  }, {
    "key" : "is_not",
    "value" : "is not"
  } ],
  "options" : [ {
    "key" : "hy",
    "value" : "Armenian"
  }, {
    "key" : "hz",
    "value" : "Herero"
  }, {
    "key" : "ia",
    "value" : "Interlingua"
  }, {
    "key" : "id",
    "value" : "Indonesian"
  }, {
    "key" : "ie",
    "value" : "Interlingue"
  }, {
    "key" : "ig",
    "value" : "Igbo"
  }, {
    "key" : "ii",
    "value" : "Sichuan Yi"
  }, {
    "key" : "ik",
    "value" : "Inupiaq"
  }, {
    "key" : "in",
    "value" : "Indonesian"
  }, {
    "key" : "io",
    "value" : "Ido"
  }, {
    "key" : "is",
    "value" : "Icelandic"
  }, {
    "key" : "it",
    "value" : "Italian"
  }, {
    "key" : "iu",
    "value" : "Inuktitut"
  }, {
    "key" : "iw",
    "value" : "Hebrew"
  }, {
    "key" : "ja",
    "value" : "Japanese"
  }, {
    "key" : "ko",
    "value" : "Korean"
  },  {
    "key" : "lo",
    "value" : "Lao"
  }, {
    "key" : "lt",
    "value" : "Lithuanian"
  }, {
    "key" : "lu",
    "value" : "Luba-Katanga"
  }, {
    "key" : "lv",
    "value" : "Latvian"
  }, {
    "key" : "mg",
    "value" : "Malagasy"
  }, {
    "key" : "mh",
    "value" : "Marshallese"
  }, {
    "key" : "mi",
    "value" : "Maori"
  }, {
    "key" : "mk",
    "value" : "Macedonian"
  }, {
    "key" : "ml",
    "value" : "Malayalam"
  }, {
    "key" : "mn",
    "value" : "Mongolian"
  }, {
    "key" : "mo",
    "value" : "Moldavian"
  }, {
    "key" : "mr",
    "value" : "Marathi"
  }, {
    "key" : "ms",
    "value" : "Malay"
  }, {
    "key" : "mt",
    "value" : "Maltese"
  }, {
    "key" : "my",
    "value" : "Burmese"
  }, {
    "key" : "na",
    "value" : "Nauru"
  }, {
    "key" : "nb",
    "value" : "Norwegian Bokmål"
  }, {
    "key" : "nd",
    "value" : "North Ndebele"
  }, {
    "key" : "ru",
    "value" : "Russian"
  }, {
    "key" : "rw",
    "value" : "Kinyarwanda"
  }, {
    "key" : "sd",
    "value" : "Sindhi"
  },{
    "key" : "zh",
    "value" : "Chinese"
  }, {
    "key" : "zu",
    "value" : "Zulu"
  } ],
  "note" : "Language used on user's device",
  "inputType" : "dropdown",
  "icon" : "megaphone",
  "enabled" : true
}, {
  "name" : {
    "key" : "Tags",
    "value" : "tags"
  },
  "printName" : null,
  "operations" : [ {
    "key" : "is",
    "value" : "is"
  }, {
    "key" : "is_not",
    "value" : "is not"
  }, {
    "key" : "greater",
    "value" : "greater than"
  }, {
    "key" : "less",
    "value" : "less than"
  }, {
    "key" : "exists",
    "value" : "exists"
  }, {
    "key" : "not_exists",
    "value" : "does not exist"
  }, {
    "key" : "geo_within",
    "value" : "geo within"
  }, {
    "key" : "near",
    "value" : "near"
  }, {
    "key" : "geo_intersects",
    "value" : "geo intersects"
  } ],
  "options" : null,
  "note" : "Tags attached to users",
  "inputType" : "tag",
  "icon" : "pricetag",
  "key" : null,
  "enabled" : true
}, {
  "name" : {
    "key" : "Created",
    "value" : "First Install"
  },
  "printName" : null,
  "operations" : [ {
    "key" : "greater",
    "value" : "greater than"
  }, {
    "key" : "less",
    "value" : "less than"
  } ],
  "options" : null,
  "note" : "Indicates the time when a device was registered for notifications for the first time.",
  "inputType" : "datetime",
  "icon" : "checkmark-circle-outline",
  "enabled" : true
}, {
  "name" : {
    "key" : "LastApplicationOpen",
    "value" : "Last Application Open"
  },
  "printName" : null,
  "operations" : [ {
    "key" : "greater",
    "value" : "greater than"
  }, {
    "key" : "less",
    "value" : "less than"
  } ],
  "options" : null,
  "note" : "The time of the most recent application launch on a device.",
  "inputType" : "datetime",
  "icon" : "redo",
  "enabled" : true
}, {
  "name" : {
    "key" : "SDK_VERSION_IOS",
    "value" : "SDK Version For iOS"
  },
  "printName" : null,
  "operations" : [ {
    "key" : "is",
    "value" : "is"
  }, {
    "key" : "is_not",
    "value" : "is not"
  }, {
    "key" : "greater",
    "value" : "greater than"
  }, {
    "key" : "less",
    "value" : "less than"
  } ],
  "options" : [ {
    "key" : "000000030010",
    "value" : "0.3.10"
  }, {
    "key" : "000100000000",
    "value" : "V1.0.0"
  }, {
    "key" : "000100000001",
    "value" : "V1.0.1"
  }, {
    "key" : "000100000002",
    "value" : "V1.0.2"
  }, {
    "key" : "000100000003",
    "value" : "V1.0.3"
  }, {
    "key" : "000100000004",
    "value" : "V1.0.4"
  }, {
    "key" : "000100000005",
    "value" : "V1.0.5"
  }, {
    "key" : "000100000006",
    "value" : "V1.0.6c"
  }, {
    "key" : "000100000007",
    "value" : "V1.0.7"
  }, {
    "key" : "000100000008",
    "value" : "V1.0.8"
  }, {
    "key" : "000100000010",
    "value" : "V1.0.10"
  }, {
    "key" : "000100000011",
    "value" : "V1.0.11"
  }, {
    "key" : "000100000012",
    "value" : "V1.0.12"
  }, {
    "key" : "000200000000",
    "value" : "V2.0.0"
  }, {
    "key" : "000300070003",
    "value" : "3.7.3"
  }, {
    "key" : "000300070004",
    "value" : "3.7.4"
  }, {
    "key" : "000300080003",
    "value" : "3.8.3"
  }, {
    "key" : "000300080004",
    "value" : "3.8.4"
  }, {
    "key" : "000300090000",
    "value" : "3.9.0"
  } ],
  "note" : "Version of SDK for iOS",
  "inputType" : "dropdown",
  "icon" : "logo-apple",
  "enabled" : true
}, {
  "name" : {
    "key" : "SDK_VERSION_ANDROID",
    "value" : "SDK Version For Android"
  },
  "printName" : null,
  "operations" : [ {
    "key" : "is",
    "value" : "is"
  }, {
    "key" : "is_not",
    "value" : "is not"
  }, {
    "key" : "greater",
    "value" : "greater than"
  }, {
    "key" : "less",
    "value" : "less than"
  } ],
  "options" : [ {
    "key" : "000100000013",
    "value" : "V1.0.13"
  }, {
    "key" : "000100000014",
    "value" : "V1.0.14"
  }, {
    "key" : "000100010000",
    "value" : "1.1.0"
  } ],
  "note" : "Version of SDK for Android",
  "inputType" : "dropdown",
  "icon" : "logo-android",
  "enabled" : true
}, {
  "name" : {
    "key" : "Point",
    "value" : "Point"
  },
  "printName" : null,
  "operations" : [ {
    "key" : "geo_within",
    "value" : "geo within"
  } ],
  "options" : null,
  "note" : "geo location of user",
  "inputType" : "dropdown",
  "icon" : "person",
  "enabled" : true
} ]
$ curl 'https://exchange-prod-g.2mee.com/filter/wrapper' 
-i -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0aW5ndGVhbUAybWVlLmN

Last updated