Search Promotion Code(s)
Search for a list of promotion code(s) in the CDP based on conditions.
An access token of scope item
is required to call this API.
POST
https://api.ants.tech/access/api/item/search
Headers
Content-Type
String
application/json
Authorization*
String
Bearer <ACCESS_TOKEN>
Request Body
itemTypeId*
Hard-coded value
-100
itemTypeName*
Hard-coded value
promotion_code
attrs*
Array of Strings
An array of retrieving attributes. For example:
[
"id",
"name",
"pool_id",
"date_created",
"allocated_time",
"allocated_audience",
"audience_type",
"code_status",
"last_used_source",
"last_used_time",
"channel_id"
]
filters*
JSON
Your multi-condition filter criteria.
For example:
{
"OR": [
{
"AND": [
{
"type": 2,
"column": "audience_type",
"data_type": "number",
"operator": "matches",
"value": [ -1003 ]
},
{
"type": 2,
"column": "allocated_audience",
"data_type": "string",
"operator": "matches",
"extendValue": [],
"value": [
"0003da4bccf6cec103a97e7a5c8485af",
"00088d37411f4d90ea80de8d1bdb4175",
"000a04dd2bd60fdd22209a296105519b",
"000a1ad1eb9adc97483c1da44d969f3f",
"000cf2ef7fd2506a06942bb523917a22"
]
},
{
"type": 2,
"column": "code_status",
"data_type": "number",
"operator": "matches",
"extendValue": [],
"value": [ 1, 3, 4 ]
},
{
"type": 2,
"column": "allocated_time",
"data_type": "datetime",
"operator": "before_date",
"value": 1724605200000,
"time_unit": "DAY"
}
]
}
]
}
filters.OR[]*
Array of JSON
An array of your one...of
conditions. For this API scope, it always has 1 items.
filters.OR[].AND[]*
Array of JSON
An array of your all...of
conditions. For this API scope, there will be 4 items, each of which is a condition, you can either omit it (except the last item is required), or change its operators/value.
filters.OR[].AND[0]
JSON
First condition item. Your promotion code audience type (customers or visitors).
Possible value
s are:
- -1003
: customer
- -1007
: visitor
For example:
{
"type": 2,
"column": "audience_type",
"data_type": "number",
"operator": "matches",
"value": [ -1003, -1007 ]
}
filters.OR[].AND[1]
JSON
Second condition item. Your promotion code audience IDs (required if the first condition item is presented, otherwise empty response will be returned).
For example:
{
"type": 2,
"column": "allocated_audience",
"data_type": "string",
"operator": "matches",
"extendValue": [],
"value": [
"0003da4bccf6cec103a97e7a5c8485af",
"00088d37411f4d90ea80de8d1bdb4175",
"000a04dd2bd60fdd22209a296105519b",
"000a1ad1eb9adc97483c1da44d969f3f",
"000cf2ef7fd2506a06942bb523917a22"
]
}
filters.OR[].AND[2]
JSON
Third condition item. Your promotion code status.
Possible value
s are:
- 1
: Available
- 3
: Sent
- 4
: Used
For example:
{
"type": 2,
"column": "code_status",
"data_type": "number",
"operator": "matches",
"extendValue": [],
"value": [ 1, 3, 4 ]
}
filters.OR[].AND[3]*
JSON
Fourth condition item (This one is required). Your promotion code allocated time.
Value is the date in Unix timestamp format.
Possible operator
s are:
- before_date
- equals
- after_date
For example:
{
"type": 2,
"column": "allocated_time",
"data_type": "datetime",
"operator": "before_date",
"value": 1724605200000,
"time_unit": "DAY"
}
An example cURL
Last updated