Mailbox (/message)
연동가이드 > https://kakaogames.atlassian.net/wiki/x/TA8GLw
/message/send
Description
This API allows the delivery of a message request to another user through the message delivery server.
The target group for delivery is specified by messageBoxId, and the message box must be pre-registered via the admin tool.
When sending a message, it is possible to attach a list of items. The items to be attached must also be pre-registered via the admin tool before sending.
Method
POST
Request Headers
Name | Type | Mandatory | Description |
Content-Type | String | Y | "application/json;charset=UTF-8" |
appSecret | String | Y | App Secret |
Authorization | String | Y | Authorization: KakaoAK {ADMIN_KEY} |
kgAppId | String | Y | KG App Id |
playerId | String | Y | User ID issued by the platform (Item sender) |
Request Body Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
senderAppId | String | N | Sender App ID (set to appId if left blank) |
appId | String | Y | Receiver App ID |
senderId | String | Y | Sender ID |
receiverId | String | Y | Receiver ID |
message | Message | Y | Message |
items | List<Item> | N | Item list |
checkPlayer | Boolean | N | Whether to check the user |
receiverIdType | String | N | User type (default: playerId) |
Message
Name | Type | Mandatory | Description |
---|---|---|---|
messageId | String | N | Unique message UUID.
|
messageBoxId | String | N | Unique mailbox ID.
|
title | String | N | Title |
body | String | N | Body |
titleMap | Map<String, String> | N | Title (used for multilingual processing) |
bodyMap | Map<String, String> | N | Body (used for multilingual processing) |
resourceMap | Map<String, String> | N | Data values required to display the message Limitations
|
expiryTime | Long | N | Expiration time. If specified, it must be at least 10 seconds after the registration time. Cannot exceed the message box's expiration time. |
Item
Name | Type | Mandatory | Description |
---|---|---|---|
itemCode | String | Y | Item code |
quantity | Long | Y | Item quantity |
validityTime | Long | N | Validity period. If not specified, set to -1 (unlimited). |
Response Status Code
Status Code | Status Code Description | Status Code Detailed Description |
---|---|---|
200 | Normal response | Normal |
400 | Bad Request | Unparsable request data, missing required parameters, or parameter type error |
401 | Unauthenticated | Authentication failed |
406 | Not Acceptable | Cannot process |
461 | Invalid Message Box | The requested message box with messageBoxId does not exist. |
500 | Internal Server Error | Internal server system error |
503 | Service Unavailable | Service is unavailable (e.g., internal server timeout) |
Response Content
Name | Type | Description |
---|---|---|
messageId | String | The messageId of the delivered message |
Example Request
POST /service/v5/message/send HTTP/1.1
Host: kr-openapi-zinny3.game.kakao.com:10443
kgAppId: 103815
appSecret: 951b75bf17fe0885ab5106ba2a9f9bc9
playerId: 1527701800
Content-Type: application/json;charset=UTF-8
Authorization: KakaoAK c0948035a320f789f585acae3dedcd70
{
"receiverId": "1527701800",
"message": {
"messageBoxId": "inbox",
"title": "Title",
"body": "Body"
},
"items": [
{
"itemCode": "TEST_ITEM_QA2",
"quantity": 10,
"validityTime": 25900000
}
]
} |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"messageId": "c21c6dfe-c13b-46ff-9946-961d28beb914"
} |
/message/getList
Description
Retrieve a list of messages delivered to the message delivery server.
The retrieved list is sorted in reverse chronological order, with the most recent message appearing on the first page. A maximum of 100 messages can be retrieved per page.
If the nextPageKey value in the response is not -1, you can use this key to retrieve the next page.
Messages can have multiple attached items.
Attached items should be processed by calling /message/claim after applying them in the game, and then /message/finish should be called to complete the process.
Method
POST
Request Headers
Name | Type | Mandatory | Description |
Content-Type | String | Y | "application/json;charset=UTF-8" |
appSecret | String | Y | App Secret |
Authorization | String | Y | Authorization: KakaoAK {ADMIN_KEY} |
kgAppId | String | Y | KG App Id |
playerId | String | Y | User ID issued by the platform (Item sender) |
Request Body Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
messageBoxId | String | N | Mailbox Id |
count | Integer | Y | Number of messages to retrieve (maximum 100) |
nextPageKey | Long | N | Offset to query the starting offset of the page. If null, the first page is requested. Even if you enter the Long Max value (9223372036854775807), the first page is requested. |
states | List<String> | N | List of message state values to query: unread, read, error, deleted, expired. If not entered, a list of messages in unread and read states is returned. |
Response Status Code
Status Code | Status Code Description | Status Code Detailed Description |
---|---|---|
200 | Normal Response | Normal |
400 | Bad Request | Unparsable request data. Lack of required parameters or parameter type error |
401 | Unauthenticated | Unauthenticated request |
406 | Not Acceptable | Non-existent user |
461 | Restricted | Restricted User |
463 | Removed | Unregistered User (The user has applied to unregister, and the process is ongoing. The actual user data still exists.) |
500 | Internal Server Error | Internal server system error |
503 | Service Unavailable | Service is unavailable (e.g., internal server timeout) |
Response Content
Name | Type | Description |
---|---|---|
nextPageKey | Long | Next page key to be used for the next page request.
|
messages | List<MessagePacket> | Message list |
maxCount | Integer |
|
totalCount | Integer | Current number of messages (total pages) |
MessagePacket
Name | Type | Description |
---|---|---|
message | Message | Message data |
items | List<Item> | List of attached items |
existUnconfirmedItems | Boolean | Whether there are unconfirmed items |
Message
Name | Type | Description |
---|---|---|
deliverySeq | Long | Unique message number |
messageId | String | Message ID |
messageBoxId | String | Mailbox ID |
senderAppId | String | Sender App ID |
senderId | String | Sender ID |
receiverAppId | String | Receiver App ID |
receiverId | String | Receiver ID |
title | String | Title |
body | String | Body |
resourceMap | Map | Data values required to represent the message |
state | String | Message state value unread, read, error, deleted, expired |
regTime | Long | Registration time |
modTime | Long | Last modification time |
readTime | Long | Confirmation processing time (read processing) |
expiredTime | Long | Expiration time |
Item
Name | Type | Description |
---|---|---|
itemId | String | Unique item ID |
itemCode | String | Item code |
itemName | String | Item name |
quantity | Long | Item quantity |
state | String | Processing state value registered, sent, confirmed, error, deleted, expired |
sentCount | Integer | Number of times the item claim has been processed.
|
validityTime | Long | Item validity time |
regTime | Long | Registration time |
modTime | Long | Last modification time |
sentTime | Long | Time when the requestItem was sent |
confirmedTime | Long | Confirmation processing time |
expiredTime | Long | Expiration time |
Example Request
POST /service/v5/message/getList HTTP/1.1
Host: kr-openapi-zinny3.game.kakao.com:10443
Content-Type: application/json;charset=UTF-8
kgAppId: 103815
appSecret: 951b75bf17fe0885ab5106ba2a9f9bc9
playerId: 23423432453
Authorization: KakaoAK c0948035a320f789f585acae3dedcd70
{
"count": 50
} |
Example Response
/message/claimItems
Description
Notifies the platform server to request the receipt of items included in the message.
When this API is called, the list of items to be delivered is returned, and the status is changed to 'In Delivery (Processing Delivery)'. After the process is completed, you must call /message/finish to set the status to completed, thereby concluding the transaction.
If /message/finish is not called, the process is considered incomplete, and if the same request is received again, the same list as before will be returned.
If the same messageId is called more than once through this API, it will be handled as an error and excluded from the delivery processing list.
If the messageId has already been processed through finish, the status value of the result will be handled as an error with a status of 406.
If claimItems is called again within 20 seconds with the same messageId before finish processing is completed, it will also be handled as a 406 error.
Request Headers
Name | Type | Mandatory | Description |
Content-Type | String | Y | "application/json;charset=UTF-8" |
appSecret | String | Y | App Secret |
Authorization | String | Y | Authorization: KakaoAK {ADMIN_KEY} |
kgAppId | String | Y | KG App Id |
playerId | String | Y | User ID issued by the platform (Item sender) |
Request Body Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
messageIds | List<String> | Y | List of message IDs for which to claim items |
Response Status Code
Status Code | Status Code Description | Status Code Detailed Description |
---|---|---|
200 | Normal Response | Normal |
400 | Bad Request | Unparsable request data. Lack of required parameters or parameter type error. |
401 | Unauthenticated | Unauthenticated request |
406 | Not Acceptable | Non-existent message |
500 | Internal Server Error | Internal server system error |
503 | Service Unavailable | Service is unavailable (e.g., internal server timeout) |
Response Content
Name | Type | Description |
---|---|---|
results | List<Result> |
|
Result Content
Name | Type | Description |
---|---|---|
messageId | String | messageId |
status | Integer | Item claim processing status code
|
receiverId | String | Receiver ID |
senderId | String | Sender ID |
resourceMap | Map<String, String> | Values required to represent the message |
items | List<Item> | List of item information |
Item
Name | Type | Description |
---|---|---|
appId | String | App ID |
itemCode | String | Item code |
quantity | Long | Item quantity |
itemId | String | Unique item ID |
validityTime | Long | Validity period.
|
senderId | String | Sender ID |
Example Request
Example Response
/message/finish
Description
Called after the game server has successfully processed the item delivery following the /message/claim.
It finalizes the transaction for the delivery of items included in the message (item delivery completion) and deletes the message.
Method
POST
Request Headers
Name | Type | Mandatory | Description |
Content-Type | String | Y | "application/json;charset=UTF-8" |
appSecret | String | Y | App Secret |
Authorization | String | Y | Authorization: KakaoAK {ADMIN_KEY} |
kgAppId | String | Y | KG App Id |
playerId | String | Y | User ID issued by the platform (Item sender) |
Request Body Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
messageIds | List<String> | Y | List of message IDs to be marked as completed |
Response Status Code
Status Code | Status Code Description | Status Code Detailed Description |
---|---|---|
200 | Normal Response | Normal |
400 | Bad Request | Unparsable request data. Lack of required parameters or parameter type error. |
401 | Unauthenticated | Unauthenticated request |
406 | Not Acceptable | Non-existent message |
500 | Internal Server Error | Internal server system error |
503 | Service Unavailable | Service is unavailable (e.g., internal server timeout) |
Response Content
Name | Type | Description |
---|---|---|
results | List<Result> | List of item information |
Result Content
Name | Type | Description |
---|---|---|
messageId | String | messageId |
status | Integer | Processing result (200 success) |
Example Request
Example Response
/message/markAsRead
Description
Marks the message as read.
The item information and status are retained, but the message is changed to a 'read' state.
Method
POST
Request Headers
Name | Type | Mandatory | Description |
Content-Type | String | Y | "application/json;charset=UTF-8" |
appSecret | String | Y | App Secret |
Authorization | String | Y | Authorization: KakaoAK {ADMIN_KEY} |
kgAppId | String | Y | KG App Id |
playerId | String | Y | User ID issued by the platform (Item sender) |
Request Body Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
messageIds | List<String> | Y | List of message IDs to be marked as read |
Response Status Code
Status Code | Status Code Description | Status Code Detailed Description |
---|---|---|
200 | Normal Response | Normal |
400 | Bad Request | Unparsable request data. Lack of required parameters or parameter type error. |
401 | Unauthenticated | Unauthenticated request |
406 | Not Acceptable | Non-existent message |
500 | Internal Server Error | Internal server system error |
503 | Service Unavailable | Service is unavailable (e.g., internal server timeout) |
Example Request
Example Response
/message/confirmItems
Description
After the item delivery is completed, this call changes the message status.
Message Status → "Read"
Existence of Unconfirmed Items → "None"
Method
POST
Request Headers
Name | Type | Mandatory | Description |
Content-Type | String | Y | "application/json;charset=UTF-8" |
appSecret | String | Y | App Secret |
Authorization | String | Y | Authorization: KakaoAK {ADMIN_KEY} |
kgAppId | String | Y | KG App Id |
playerId | String | Y | User ID issued by the platform (Item sender) |
Request Body Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
messageIds | List<String> | Y | List of message IDs to be processed for item delivery completion |
Response Status Code
Status Code | Status Code Description | Status Code Detailed Description |
---|---|---|
200 | Normal Response | Normal |
400 | Bad Request | Unparsable request data. Lack of required parameters or parameter type error. |
401 | Unauthenticated | Unauthenticated request |
406 | Not Acceptable | Non-existent message |
500 | Internal Server Error | Internal server system error |
503 | Service Unavailable | Service is unavailable (e.g., internal server timeout) |
Example Request
Example Response
/message/deleteMessages
Description
Changes the message status to 'Deleted'.
Method
POST
Request Headers
Name | Type | Mandatory | Description |
Content-Type | String | Y | "application/json;charset=UTF-8" |
appSecret | String | Y | App Secret |
Authorization | String | Y | Authorization: KakaoAK {ADMIN_KEY} |
kgAppId | String | Y | KG App Id |
playerId | String | Y | User ID issued by the platform (Item sender) |
Request Body Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
messageIds | List<String> | Y | List of message IDs to be processed for deletion |
Response Status Code
Status Code | Status Code Description | Status Code Detailed Description |
---|---|---|
200 | Normal Response | Normal |
400 | Bad Request | Unparsable request data. Lack of required parameters or parameter type error. |
401 | Unauthenticated | Unauthenticated request |
406 | Not Acceptable | Non-existent message |
500 | Internal Server Error | Internal server system error |
503 | Service Unavailable | Service is unavailable (e.g., internal server timeout) |
Example Request