Common: Generate filter

Generate filter

{action} = generate-filter

Required params

key:

App Mobactions Key

filter:

JSON array with all filter options until now

Optional params 

save:

name to save this filter as a segment

update:

id of a the segment to update with this filter

attendees:

param without value to request number of attendees

Response 

options:

next options for each row of JSON filter sent

save:

if save requested, message with the result

attendees:

users targeted

total:

total users targeted

active:

active for push send

Detailed example

You can use the attached example for testing.

First request: (requesting intial options)

  • url: https://in.emma.io/API/generate-filter
  • key=MobactionsKey
  • filter=[[]]

Response: 

{
“options”:
[
[
“User type”,
“Users who rated”,
“Users with OS”,
“Users with device”,

]
]
}

Second request: (choosing “User type”)

  • url: https://in.emma.io/API/generate-filter
  • key=MobactionsKey
  • filter=[[“User type”]]

Response:

{
“options”:
[
[
“Anonymous”,
“Leads”,
“Web Users”,

]
]
}

Third request: (choosing “Leads”)

  • url: https://in.emma.io/API/generate-filter
  • key=MobactionsKey
  • filter=[[“User type”,”Leads”]]

Response: 

{
“options”:
[
[ ]
]
}

(No more options for this filter)

Fourth request: (requesting attendees)

  • url: https://in.emma.io/API/generate-filter
  • key=MobactionsKey
  • filter=[[“User type”,”Leads”]]
  • attendees

Response: 

{
“options”:
[
[]
],
“attendees”:
“{\”total\”:\”30256\”,\”active\”:\”20128\”}”
}

Fifth request: (saving as segment “segment1”)

  • url: https://in.emma.io/API/generate-filter
  • key=MobactionsKey
  • filter=[[“User type”,”Leads”]]
  • save=segment1

Response: 

{
“options”:
[
[]
],
“save”: “Segment saved!”
}

Extended example 

With more than one row at the same time.

First request: (requesting initial options with 2 rows)

  • url: https://in.emma.io/API/generate-filter
  • key=MobactionsKey
  • filter=[[],[]]

Response: 

{
“options”:
[
[
“User type”,
“Users who rated”,
“Users with OS”,
“Users with device”,

],
[
“User type”,
“Users who rated”,
“Users with OS”,
“Users with device”,

]
]
}

Second request: (choosing “User type” and “Users with OS”)

  • url: https://in.emma.io/API/generate-filter
  • key=MobactionsKey
  • filter=[[“User type”],[“Users with OS”]]

Response: 

{
“options”:
[
[
“Anonymous”,
“Leads”,
“Web Users”,

],
[
“iOS”,
“Android”,

]
]
}

Third request: (choosing “Leads” and “iOS”)

  • url: https://in.emma.io/API/generate-filter
  • key=MobactionsKey
  • filter=[[“User type”,”Leads”],[“Users with OS”,”iOS”]]

Response: 

{
“options”:
[
[ ],
[ ]
]
}

(No more options for this filter)

Fourth request: (requesting initial options for a 3rd row)

  • url: https://in.emma.io/API/generate-filter
  • key=MobactionsKey
  • filter=[[“User type”,”Leads”],[“Users with OS”,”iOS”],[]]

Response: 

{
“options”:
[
[ ],
[ ],
[
“User type”,
“Users who rated”,
“Users with OS”,
“Users with device”,

]
]
}
Etc…

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.