Campaign Registration
Prerequisites¶
To sync with the API for registering campaign, make sure to issue an authorization token (API KEY). If you already have the key, request the additional permissions. Refer to Hive Server API > Notification > Push v4 > Authentication to check how to request and issue the authorization token.
API for registering campaign¶
Basic Data and Request Variables¶
Method | POST | ||||||
URL | /push/campaigns | ||||||
Division | Field Name | Description | Type | Required | |||
---|---|---|---|---|---|---|---|
sound | Header | Content-Type | application/json;charset=utf-8 | ||||
Authorization | bearer {{API KEY}} | - | |||||
Body | id | Essential field for editing campaign | Integer | △ | |||
status | Essential field for editing campaign | Integer | △ | ||||
company | Company
| String | O | ||||
companyIndex | Company code (the company number registered on AppCenter) | Integer | O | ||||
Description | Description of a campaign | String | O | ||||
notice | Whether to send notice or not | Boolean | X | ||||
Type | Sending type
| String | O | ||||
targetingId | Targeting ID Essential field in case of targeting campaign | Integer | △ | ||||
registrant | name | Registrant name | String | X | |||
id | Registrant id | String | O | ||||
reservation | localizing | Whether to consider local time (Sending at once/Sending individual) | Boolean | O | |||
startDate | The period of constant sending (YYYY-MM-DD) | String | O | ||||
endDate | String | O | |||||
time | The time of sending push (HH:mm) | String | O | ||||
repeat | Whether to send pushes constantly or not | Boolean | O | ||||
weekday | The day of constant sending other than weekend | Integer[] | X | ||||
skip | he date to skip sending pushes in the period of constant sending | String[] | X | ||||
distribution | enable | Whether to send distributed or not | Boolean | X | |||
interval | The interval of distributed sending | Integer | X | ||||
count | The count of distributed sending | Integer | X | ||||
continents | The information list by selected continent (Refer to the country code) Check the CampaignContinent structure and example below | CampaignContinent[] | O | ||||
countries | The information of selected country (Refer to the country code) | String[] | O | ||||
game | gameindex | Game index | Integer | O | |||
serverIds | The list of server ID | String[] | X | ||||
apps[] | appindex | App index | Integer | O | |||
appid | AppId | String | O | ||||
defaultLanguage | Default setting language (Refer to the language code) | String | O | ||||
notification | {{LANGUAGE}} | Message information Check the message structure and example below | Message | X | |||
option | badge | Badge for push notification | Integer | X | |||
overwrite | Whether to overwrite pushes or not | Boolean | X | ||||
collapseKey | Key value for overwriting pushes | String | X | ||||
engagement | User Engagement | String | X | ||||
comment | Comment | String | X | ||||
groupKey | The group key value to expose notifications in group when a user receives notifications in iOS or Android OS environment. The notification setting chosen in the device OS is applied by default. For more details about the option, see the following documentation. | String | X | ||||
android | icon | This is the icon image file name exposed when a push notification appears on the user's device. The image file should be located in /src/main/res/drawable. See here for the supported image file formats. If you want to expose an image on the web instead of an image file, type the image URL in this field instead of an image file name. If this field is left empty, the app icon image will be exposed. | String | X | |||
sound | This is the name of the notification sound file to be played when a push notification appears on the user's device. You can specify a sound source file included in the app bundle, and the sound source file should be located in /src/main/res/raw. If this field is left empty, the system’s default sound file is used. | String | X | ||||
priority | Priority of messages to be sent to Android devices. This priority is an FCM concept that controls when messages are sent. It can have values of NORMAL or HIGH; the default is NORMAL. For more information, see Firebase Guide.
| enum(NORMAL, HIGH) | X | ||||
ios | sound | This is the name of the notification sound source file to be played when a push notification appears on the user's device. The sound file must exist in the app container's Library/Sounds or the app's main bundle. If this field is empty, it is automatically set to "default" and the user's Apple device system default sound source is used. td> | String | X |
Note
For more details about option
, see the respective markets' guidelines.
(The option field is not applicable for Facebook.)
-
Android: FirebaseNotification
CampaignContinent structure¶
Division | Field Name | Description | Type | Required |
---|---|---|---|---|
CampaignContinent | continent | Continent type | String | O |
countries | The code of countries in a continent | String[] | O |
CampaignContinent Example¶
[
{
"name": "Africa",
"countries": [
"Algeria",
"Angola",
"Benin",
"Sudan",
"Swaziland",
"Tanzania",
"Togo",
"Tunisia",
"Zambia",
"Zimbabwe"
]
}
]
Message structure¶
Division | Field Name | Description | Type | Required | |
Message | android | title | Title | String | O |
message | Message | String | O | ||
messageExpanded | Expanded message | String | X | ||
imageUrl | Image URL | String | X | ||
ticker | Ticker | String | X | ||
summaryText | Summarized message | String | X | ||
iOS | title | Title | String | O | |
message | Message | String | O | ||
mediaUrl | Image URL | String | X | title | Title (within 1~30 letters) | String | O |
body | Body (within 10~180 letters) | String | O | ||
media | Image URL | String | O |
Message example¶
{
"ko": {
"android": {
"messageExpanded": "(Ad) TEST(Block: Available in settings)",
"ticker": "gg",
"title": "(Ad)test",
"message": "(Ad) test (Restriction: Available in settings)",
"summaryText": "",
"imageUrl": ""
},
"ios": {
"mediaUrl": "",
"title": "Push",
"message": "(Ad) TEST (Block: Available in settings)"
},
"facebook": {
"title" : "Title",
"body" : "Push Message Body",
"media" : “https://image.newdaily.co.kr/site/data/img/2022/05/13/2022051300019_0.jpg”
}
}
}
Output result¶
Header | Content-Type | application/json;charset=utf-8 | |
UUID | {{UUID}} | ||
Body | Body is empty if success |
Response state code¶
Key | Value | Description |
---|---|---|
200 | Success | (Body is empty) |
400 | Bad Request | POST data is omitted JSON format error Required element is omitted or invalid Available to check additionally with reason message in Body |
401 | Unauthorized | Authorization header in request message is omitted or invalid Authorization token (API KEY) is not registered No access permission to the relevant API |
403 | Forbidden | Authorization scheme of Authorization header is not "Bearer" (Supported Bearer only) |
404 | Not Found | Request URL is wrong |
500 | Internal Server Error | Internal error on server |
502 | Bad Gateway | Push gateway server is overloaded Network connects in a wrong way |
503 | Service Unavailable | API server or authorization server is frozen |
Sample code¶
Campaign registration¶
- Call
curl -v -L
-H "Content-Type: application/json"
-H "Authorization: Bearer {API KEY}"
-d '{"description":"TEST","status":1,"company":"gcp", "companyIndex" : 3, "type":"B","targetingId":0,"reservation":{"localizing":false,"startDate":"2025-11-06","endDate":"2025-11-06","time":"17:00:00","repeat":false,"periodType":"","weekday":[],"skip":[]},"game":{"gameName":"스탭 바이 스탭","gameindex":592,"serverIds":[],"apps":[{"appindex":20002,"appid":"com.gcp.stepbystep.android.google.global.normal","versions":[]}],"serverAll":true},"distribution":{"enable":false,"interval":0,"count":0},"defaultLanguage":"ko","option":{"badge":1,"engagement":"","overwrite":false,"collapseKey":"0","comment":"","groupKey": "", "android":{"icon":"","sound":"","vibration":1},"ios":{"sound":""}},"timestamp":{"time":0,"date":""},"registrant":{"id":"soollung","name":"박기찬"},"notification":{"ko":{"android":{"title":"TEST","message":"(광고) TEST (수신거부: 설정에서 변경 가능)","messageExpanded":"","ticker":"","summaryText":"","imageUrl":""},"ios":{"title":"TEST","message":"(광고) TEST (수신거부: 설정에서 변경 가능)","mediaUrl":""},"facebook":{"title":"TEST", "body":"TEST MESSAGE BODY", "media": "https://image.newdaily.co.kr/site/data/img/2022/05/13/2022051300019_0.jpg"}}},"countries":["KR"],"continents":[{"name":"Africa","countries":[]},{"name":"Americas","countries":[]},{"name":"Asia","countries":["South Korea"]},{"name":"Europe","countries":[]},{"name":"Oceania","countries":[]},{"name":"Polar","countries":[]}]}'
https://sandbox-notification.qpyou.cn/push/campaigns
- Request
> POST /push/campaigns HTTP/1.1
> User-Agent: curl/7.29.0
> Host: sandbox-notification.qpyou.cn
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer {API KEY}
> Content-Length: 1314
> Expect: 100-continue
- Response
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Content-Length: 1491
< Content-Type: application/json
<: 3d18420b-4cf3-48a8-a3bf-6c9ac6cbe86a
<
{
"uuid": "3d18420b-4cf3-48a8-a3bf-6c9ac6cbe86a",
"status": 1,
"modify": true,
"id": 532,
"type": "B",
"company": "gcp",
"companyIndex": 3,
"description": "TEST",
"targetingId": 0,
"reservation": {
"localizing": false,
"startDate": "2025-11-06",
"endDate": "2025-11-06",
"time": "17:00:00",
"repeat": false
},
"distribution": {
"count": 0,
"interval": 0,
"enable": false
},
"continents": [
{
"name": "Africa",
"countries": []
},
{
"name": "Americas",
"countries": []
},
{
"name": "Asia",
"countries": [
"South Korea"
]
},
{
"name": "Europe",
"countries": []
},
{
"name": "Oceania",
"countries": []
},
{
"name": "Polar",
"countries": []
}
],
"countries": [
"KR"
],
"lastEndTime": 1762448400,
"tasks": {
"17:00:00": {
"startTime": 1762448400,
"endTime": 1762448400,
"time": "17:00:00",
"gmtOffset": 32400,
"zones": [
"Asia/Seoul"
]
}
},
"game": {
"gameindex": 592,
"gameName": "Step By Step",
"apps": [
{
"appid": "com.gcp.stepbystep.android.google.global.normal",
"appindex": 20002
}
]
},
"defaultLanguage": "ko",
"notification": {
"ko": {
"android": {
"messageExpanded": "",
"ticker": "",
"summaryText": "",
"imageUrl": "",
"title": "TEST",
"message": "(Ad) TEST (Opt out: can be modified in the settings)"
},
"ios": {
"title": "TEST",
"message": "(Ad) TEST (Opt out: can be modified in the settings)",
"mediaUrl": ""
},
"facebook": {
"media": "https://image.newdaily.co.kr/site/data/img/2022/05/13/2022051300019_0.jpg",
"title": "TEST",
"body": "TEST MESSAGE BODY"
}
}
},
"option": {
"badge": 1,
"engagement": "",
"overwrite": false,
"collapseKey": "0",
"comment": "",
"groupKey": "",
"android": {
"icon": "",
"vibration": "1",
"sound": ""
},
"ios": {
"sound": ""
}
},
"timestamp": {
"date": "2023-05-22 15:19:24.726",
"time": 1684736364726
},
"registrant": {
"name": "Park Ki Chan",
"id": "soollung"
},
"dryRun": false,
"debug": false
}
Campaign modification¶
- Call
curl -v -L
-H "Content-Type: application/json"
-H "Authorization: Bearer {API KEY}"
-d '{"description":"TEST","status":1,"company":"gcp", "companyIndex" : 3, "type":"B","targetingId":0,"reservation":{"localizing":false,"startDate":"2025-11-06","endDate":"2025-11-06","time":"17:00:00","repeat":false,"periodType":"","weekday":[],"skip":[]},"game":{"gameName":"스탭 바이 스탭","gameindex":592,"serverIds":[],"apps":[{"appindex":20002,"appid":"com.gcp.stepbystep.android.google.global.normal","versions":[]}],"serverAll":true},"distribution":{"enable":false,"interval":0,"count":0},"defaultLanguage":"ko","option":{"badge":1,"engagement":"","overwrite":false,"collapseKey":"0","comment":"","groupKey": "", "android":{"icon":"","sound":"","priority":"high"},"ios":{"sound":""}},"timestamp":{"time":0,"date":""},"registrant":{"id":"soollung","name":"박기찬"},"notification":{"ko":{"android":{"title":"TEST","message":"(광고) TEST (수신거부: 설정에서 변경 가능)","messageExpanded":"","ticker":"","summaryText":"","imageUrl":""},"ios":{"title":"TEST","message":"(광고) TEST (수신거부: 설정에서 변경 가능)","mediaUrl":""},"facebook":{"title":"TEST", "body":"TEST MESSAGE BODY", "media": "https://image.newdaily.co.kr/site/data/img/2022/05/13/2022051300019_0.jpg"}}},"countries":["KR"],"continents":[{"name":"Africa","countries":[]},{"name":"Americas","countries":[]},{"name":"Asia","countries":["South Korea"]},{"name":"Europe","countries":[]},{"name":"Oceania","countries":[]},{"name":"Polar","countries":[]}]}'
https://sandbox-notification.qpyou.cn/push/campaigns
- Request
> POST /push/campaigns HTTP/1.1
> User-Agent: curl/7.29.0
> Host: sandbox-notification.qpyou.cn
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer {API KEY}
> Content-Length: 1314
> Expect: 100-continue
- Response
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Content-Length: 1491
< Content-Type: application/json
< UUID: 65420989-ab96-4587-b19a-195fe13f9086
<
{
"uuid": "65420989-ab96-4587-b19a-195fe13f9086",
"status": 1,
"id": 475,
"type": "B",
"company": "gcp",
"companyIndex": 3,
"description": "TEST475",
"targetingId": 0,
"reservation": {
"localizing": false,
"startDate": "2020-11-06",
"endDate": "2020-11-06",
"time": "17:00:00",
"repeat": false
},
"distribution": {
"count": 0,
"interval": 0,
"enable": false
},
"continents": [{
"name": "Africa",
"countries": []
}, {
"name": "Americas",
"countries": []
}, {
"name": "Asia",
"countries": ["South Korea"]
}, {
"name": "Europe",
"countries": []
}, {
"name": "Oceania",
"countries": []
}, {
"name": "Polar",
"countries": []
}],
"countries": ["KR"],
"lastEndTime": 1604682000,
"tasks": {
"17:00:00": {
"startTime": 1604682000,
"endTime": 1604682000,
"time": "17:00:00",
"gmtOffset": 32400,
"zones": ["Asia/Seoul"]
}
},
"game": {
"gameindex": 592,
"gameName": "스탭바이스탭",
"apps": [{
"appid": "com.gcp.stepbystep.android.google.global.normal",
"appindex": 20002
}]
},
"defaultLanguage": "ko",
"notification": {
"ko": {
"android": {
"title": "TEST",
"message": "(광고) TEST (수신거부: 설정에서 변경 가능)",
"messageExpanded": "",
"ticker": "",
"summaryText": "",
"imageUrl": ""
},
"ios": {
"title": "TEST",
"message": "(광고) TEST (수신거부: 설정에서 변경 가능)",
"mediaUrl": ""
},
"facebook": {
"title": "TEST",
"body": "TEST MESSAGE BODY",
"media": "https://image.newdaily.co.kr/site/data/img/2022/05/13/2022051300019_0.jpg"
}
}
},
"option": {
"badge": 1,
"engagement": "",
"overwrite": false,
"collapseKey": "0",
"comment": "",
"android": {
"icon": "",
"sound": "",
"priority": "high"
},
"ios": {
"sound": ""
},
"groupKey": "test"
},
"timestamp": {
"date": "2020-03-23 11:03:43.094",
"time": 1584929023094
},
"registrant": {
"name": "박기찬",
"id": "soollung"
},
"dryRun": false,
"debug": false
}
Country code¶
Continent | Country | Code | Country | Code |
---|---|---|---|---|
Africa | Angola | AO | Madagascar | MG |
Burkina Faso | BF | Mali | ML | |
Burundi | BI | Mauritania | MR | |
Benin | BJ | Mauritius | MU | |
Botswana | BW | Malawi | MW | |
Democratic Republic of the Congo | CD | Mozambique | MZ | |
Central African Republic | CF | Namibia | NA | |
Republic of the Congo | CG | Niger | NE | |
Ivory Coast | CI | Nigeria | NG | |
Cameroon | CM | Reunion | RE | |
Cape Verde | CV | Rwanda | RW | |
Djibouti | DJ | Seychelles | SC | |
Algeria | DZ | Sudan | SD | |
Egypt | EG | Saint Helena | SH | |
Western Sahara | EH | Sierra Leone | SL | |
Eritrea | ER | Senegal | SN | |
Ethiopia | ET | Somalia | SO | |
Gabon | GA | South Sudan | SS | |
Ghana | GH | Sao Tome and Principe | ST | |
Gambia | GM | Swaziland | SZ | |
Guinea | GN | Chad | TD | |
Equatorial Guinea | GQ | French Southern Territories | TF | |
Guinea-Bissau | GW | Togo | TG | |
British Indian Ocean Territory | IO | Tunisia | TN | |
Kenya | KE | Tanzania | TZ | |
Comoros | KM | Uganda | UG | |
Liberia | LR | Mayotte | YT | |
Lesotho | LS | South Africa | ZA | |
Libya | LY | Zambia | ZM | |
Morocco | MA | Zimbabwe | ZW | |
Americas | Antigua and Barbuda | AG | Honduras | HN |
Anguilla | AI | Haiti | HT | |
Argentina | AR | Jamaica | JM | |
Aruba | AW | Saint Kitts and Nevis | KN | |
Barbados | BB | Cayman Islands | KY | |
Saint Barthélemy | BL | Saint Lucia | LC | |
Bermuda | BM | Saint Martin | MF | |
Bolivia | BO | Martinique | MQ | |
Bonaire, Saint Eustatius and Saba | BQ | Montserrat | MS | |
Brazil | BR | Mexico | MX | |
Bahamas | BS | Nicaragua | NI | |
Belize | BZ | Panama | PA | |
Canada | CA | Peru | PE | |
Chile | CL | Saint Pierre and Miquelon | PM | |
Colombia | CO | Puerto Rico | PR | |
Costa Rica | CR | Paraguay | PY | |
Cuba | CU | Suriname | SR | |
Curaçao | CW | El Salvador | SV | |
Dominica | DM | Sint Maarten | SX | |
Dominican Republic | DO | Turks and Caicos Islands | TC | |
Ecuador | EC | Trinidad and Tobago | TT | |
Falkland Islands | FK | United States Minor Outlying Islands | UM | |
Grenada | GD | United States | US | |
French Guiana | GF | Uruguay | UY | |
Greenland | GL | Saint Vincent and the Grenadines | VC | |
Guadeloupe | GP | Venezuela | VE | |
South Georgia and the South Sandwich Islands | GS | British Virgin Islands | VG | |
Guatemala | GT | U.S. Virgin Islands | VI | |
Guyana | GY | |||
Asia | United Arab Emirates | AE | Lebanon | LB |
Afghanistan | AF | Sri Lanka | LK | |
Armenia | AM | Myanmar | MM | |
Azerbaijan | AZ | Mongolia | MN | |
Bangladesh | BD | Macao | MO | |
Bahrain | BH | Maldives | MV | |
Brunei | BN | Malaysia | MY | |
Bhutan | BT | Nepal | NP | |
China | CN | Oman | OM | |
Georgia | GE | Philippines | PH | |
Hong Kong | HK | Pakistan | PK | |
Indonesia | ID | Palestinian Territory | PS | |
Israel | IL | Qatar | QA | |
India | IN | Saudi Arabia | SA | |
Iraq | IQ | Singapore | SG | |
Iran | IR | Syria | SY | |
Jordan | JO | Thailand | TH | |
Japan | JP | Tajikistan | TJ | |
Kyrgyzstan | KG | East Timor | TL | |
Cambodia | KH | Turkmenistan | TM | |
North Korea | KP | Turkey | TR | |
South Korea | KR | Taiwan | TW | |
Kuwait | KW | Uzbekistan | UZ | |
Kazakhstan | KZ | Vietnam | VN | |
Laos | LA | Yemen | YE | |
Europe | Andorra | AD | Iceland | IS |
Albania | AL | Italy | IT | |
Austria | AT | Jersey | JE | |
Aland Islands | AX | Liechtenstein | LI | |
Bosnia and Herzegovina | BA | Lithuania | LT | |
Belgium | BE | Luxembourg | LU | |
Bulgaria | BG | Latvia | LV | |
Belarus | BY | Monaco | MC | |
Switzerland | CH | Moldova | MD | |
Cyprus | CY | Montenegro | ME | |
Czech Republic | CZ | Macedonia | MK | |
Germany | DE | Malta | MT | |
Denmark | DK | Netherlands | NL | |
Estonia | EE | Norway | NO | |
Spain | ES | Poland | PL | |
Finland | FI | Portugal | PT | |
Faroe Islands | FO | Romania | RO | |
France | FR | Serbia | RS | |
United Kingdom | GB | Russia | RU | |
Guernsey | GG | Sweden | SE | |
Gibraltar | GI | Slovenia | SI | |
Greece | GR | Svalbard and Jan Mayen | SJ | |
Croatia | HR | Slovakia | SK | |
Hungary | HU | San Marino | SM | |
Ireland | IE | Ukraine | UA | |
Isle of Man | IM | Vatican | VA | |
Oceania | American Samoa | AS | Niue | NU |
Australia | AU | New Zealand | NZ | |
Cocos Islands | CC | French Polynesia | PF | |
Cook Islands | CK | Papua New Guinea | PG | |
Christmas Island | CX | Pitcairn | PN | |
Fiji | FJ | Palau | PW | |
Micronesia | FM | Solomon Islands | SB | |
Guam | GU | Tokelau | TK | |
Kiribati | KI | Tonga | TO | |
Marshall Islands | MH | Tuvalu | TV | |
Northern Mariana Islands | MP | Vanuatu | VU | |
New Caledonia | NC | Wallis and Futuna | WF | |
Norfolk Island | NF | Samoa | WS | |
Nauru | NR | |||
Polar | Antarctica | AQ |
Language Code¶
Language code | Language |
---|---|
ko | Korean |
zh-hans | Chinese (Simplified) |
zh-hant | Chinese (Traditional) |
en | English |
ja | Japanese |
ar | Arabic |
fr | French |
de | German |
es | Spanish |
pt | Portuguese |
th | Thai |
it | Italian |
ru | Russian |
id | Indonesian |
vi | Vietnamese |
tr | Turkish |