Skip to content

Instantly share code, notes, and snippets.

@tandevmode
Last active January 16, 2020 06:33
Show Gist options
  • Save tandevmode/1936472f81a0f837979583af30d3e197 to your computer and use it in GitHub Desktop.
Save tandevmode/1936472f81a0f837979583af30d3e197 to your computer and use it in GitHub Desktop.
curl -v -X POST https://api.line.me/v2/bot/message/narrowcast \
-H 'Authorization: Bearer {channel access token}' \
-H 'Content-Type: application/json' \
-d '{
"messages": [
{
"type": "text",
"text": "Hello from Narrowcast API na ja"
}
],
"recipient": {
"type": "operator",
"and": [
{
"type": "audience",
"audienceGroupId": "1111111111111"
},
{
"type": "operator",
"not": {
"type": "audience",
"audienceGroupId": "2222222222222"
}
}
]
},
"filter": {
"demographic": {
"type": "operator",
"or": [
{
"type": "operator",
"and": [
{
"type": "gender",
"oneOf": [
"male",
"female"
]
},
{
"type": "age",
"gte": "age_20",
"lt": "age_25"
},
{
"type": "appType",
"oneOf": [
"android",
"ios"
]
},
{
"type": "area",
"oneOf": [
"th_01",
"th_02"
]
},
{
"type": "subscriptionPeriod",
"gte": "day_7",
"lt": "day_30"
}
]
},
{
"type": "operator",
"and": [
{
"type": "age",
"gte": "age_35",
"lt": "age_40"
},
{
"type": "operator",
"not": {
"type": "gender",
"oneOf": [
"male"
]
}
}
]
}
]
}
},
"limit": {
"max": 1000
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment