Audience

The users of your application whom you want to address.

There are several ways to narrow down on application users whom you want to send a notification. One way is to create a query that filters the users. The other alternative is to upload the user listing as a CSV file.

Audience filter create

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

Creating a new Audience segment to deliver the notification. 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":"UK"}]]

{
  "id" : "3ad61dcf-7ae4-490d-8d51-52428e225aa0",
  "appId" : "bacb37d0-a51f-491b-bd68-489c245b8c16",
  "name" : "UK Users",
  "query" : "[[{\"name\":\"Country\",\"printName\":\"Country\",\"icon\":\"globe\",\"key\":\"\",\"operations\":\"is\",\"options\":\"GB\"}]]",
  "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",
  "query" : "[[{\"name\":\"Country\",\"printName\":\"Country\",\"icon\":\"globe\",\"key\":\"\",\"operations\":\"is\",\"options\":\"UK\"}]]"
}'

Audience CSV upload

POST https://exchange-prod-g.2mee.com/filter/{appId}/csv

An alternative way of creating an audience is to upload CSV File containing names of the users.

Path Parameters

NameTypeDescription

appId

string

Application Id for which the CSV has to be uploaded. can be picked from app/list API.

Request Body

NameTypeDescription

csv

object

CSV File containing Audience names

{
  "created" : 1582613691651,
  "updated" : 1582613691651,
  "id" : "3facf4d4-788d-46f6-bb74-fb4b61914923",
  "name" : "4e1f58a4-e4e6-46c1-8d6c-7d0c70e6a37c_1582613687181",
  "query" : "https://securefilter.s3.eu-geo.objectstorage.softlayer.net/9e908377-a558-4801-9416-55133b1fefe0",
  "creator" : "479cec74-767e-4ecb-9e6d-ee508cadbd75",
  "companyId" : "6c445333-bac9-4ab0-a0b6-cc6838902abb",
  "appId" : "bacb37d0-a51f-491b-bd68-489c245b8c16",
  "type" : "CSV",
  "count" : null,
  "isHidden" : false
}
$ curl 'https://exchange-prod-g.2mee.com/filter/bacb37d0-a51f-491b-bd68-489c245b8c16/csv' 
-i -X POST -H 'Content-Type: multipart/form-data' -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0aW5ndGVhbUAybWVlLmNvbSIsImV4cCI6MTU3OTYyMjQ1NiwiaWF0IjoxNTc5NjA0NDU2fQ.vogap4Na2O8-z4lLowb8zMdyAWsp2iajr_XwIsYAHEDodzejcYgp2m2yF874xjk67OhkScWGXeIp7gongfhKtQ' -F 'csv=@4e1f58a4-e4e6-46c1-8d6c-7d0c70e6a37c;type=multipart/form-data'

GET http://server-v1.2mee.com/filter/find

Returns details about the filter query as created using Audience Filter Create API.

Path Parameters

NameTypeDescription

filter_id

string

Audience segment picked for the delivery of the Message.

{
    "created": 1580023380000,
    "updated": 1588159907000,
    "id": "7fa82a9c-e12a-47bc-b980-0cd916c7060e",
    "name": "",
    "query": "[[{\"name\":\"Country\",\"printName\":\"Country\",\"icon\":\"globe\",\"key\":\"\",\"operations\":\"is\",\"options\":\"GB\"}]]",
    "creator": "479cec74-767e-4ecb-9e6d-ee508cadbd75",
    "companyId": "6c445333-bac9-4ab0-a0b6-cc6838902abb",
    "appId": "bacb37d0-a51f-491b-bd68-489c245b8c16",
    "type": "CUSTOM",
    "count": null,
    "isHidden": false,
    "isDefault": 0
}
$ curl 'https://exchange-prod-g.2mee.com/filter/find?filter_id=7fa82a9c-e12a-47bc-b980-0cd916c7060e' 
-i -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0aW5ndGVhbUAybWVlLmNvbSIsImV4cCI6MTU4OTQ1NTc0OSwiaWF0IjoxNTg5NDM3NzQ5fQ.U2VtugGzqD0s9p0rUXaTxk8F5tHeMf5SB4ZRnYM8TV4QQm6y2FvdFIfD6kjQOhcYuPglSusAjVegzHqDKGgCqA'

Last updated