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 | ||
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 ● gamevil: Com2uS Holdings ● com2us: Com2uS ● gcp: Com2uS Platform |
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 ● B: Bulk push ● T: Targeting push |
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 | The 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 | |||
ios | sound | This is the name of the notification sound file to be played when a push notification appears on the user’s device. The sound source file should be located in Library/Sounds of the app container, or it must exist in the main bundle of your app. If this field is left empty, the value is automatically set to “default,” and the system default sound file of the user’s Apple device will be used. | String | X |
For more details about
option
, see the respective markets’ guidelines.
(The option field is not applicable for Facebook.)
- iOS: Generating a remote notification
- Android: FirebaseNotification
Division | Field Name | Description | Type | Required |
CampaignContinent | continent | Continent type | String | O |
countries | The code of countries in a continent | String[] | O |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[ { "name": "Africa", "countries": [ "Algeria", "Angola", "Benin", "Sudan", "Swaziland", "Tanzania", "Togo", "Tunisia", "Zambia", "Zimbabwe" ] } ] |
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 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
{ "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
1 2 3 4 5 |
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 |
1 2 3 4 5 6 7 8 |
> 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 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
< 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
1 2 3 4 5 |
curl -v -L \ -H "Content-Type: application/json" \ -H "Authorization: Bearer {API KEY}" \ -d '{"id":475,"description":"TEST 475","status":1,"company":"gcp","companyIndex" : 3,"type":"B","targetingId":0,"reservation":{"localizing":false,"startDate":"2020-11-06","endDate":"2020-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":"","android":{"icon":"","sound":"","vibration":1},"ios":{"sound":""}, "groupKey":"test"},"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 |
1 2 3 4 5 6 7 8 |
> 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 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
< 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": "Step By Step", "apps": [{ "appid": "com.gcp.stepbystep.android.google.global.normal", "appindex": 20002 }] }, "defaultLanguage": "ko", "notification": { "ko": { "android": { "title": "TEST", "message": "(Ad) TEST (Opt out: can be modified in the settings)", "messageExpanded": "", "ticker": "", "summaryText": "", "imageUrl": "" }, "ios": { "title": "TEST", "message": "(Ad) TEST (Opt out: can be modified in the settings)", "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": "", "vibration": "1", "sound": "" }, "ios": { "sound": "" }, "groupKey": "test" }, "timestamp": { "date": "2020-03-23 11:03:43.094", "time": 1584929023094 }, "registrant": { "name": "Park Ki Chan", "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 |