Http api
Overview
Chat services are provided via HTTP. The API is largely divided into channel API, user API, and message API.
- Channel API
- Get all channel list API
- Get channel API
- Get channel members API
- Create channel API
- Delete channel API
- Enter channel API
- Exit channel API
- User API
- Issue user token API
- Get user joined channels API
- Get user block list API
- Block user API
- Unblock user API
- Message API
- Send channel notice message API
- Send user notice message API
- Send channel custom message API
- Send user custom message API
- Get channel message history API
This section provides the basic information you need to know when using the HTTP API.
Prerequisites
To use the HTTP API, you need the following items:
- Hive certification key: An authentication token for API calls
- Can be found at Hive Console > App Center > Project management > Game details > Basic information
- Game index: The index of the game created in Hive Console > App Center > Project management
Channel types
The following channel types are used when sending via the HTTP API.
Type | Description |
PUBLIC | Channel anyone can join |
PRIVATE | Channel that requires a password to join |
GROUP | Channel for specific users (e.g., guild) |
Request URL
Server | URL |
LIVE | api-chat.withhive.com |
SANDBOX | sandbox-api-chat.withhive.com |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Content-Type | Type of request data (application/json ) | string | Y |
Response codes
HTTP Status Code | Code | Message | Description |
200 | 0 | Success. | Success |
400 | 100 | Bad request. | Invalid request |
401 | 101 | Invalid token. | Invalid token |
403 | 102 | Forbidden. | No permission |
404 | 103 | Not found. | Not found |
405 | 104 | Method not allowed. | Method not allowed |
500 | 105 | Internal server error. | Internal server error |
- Detailed error codes (400, 403)
HTTP Status Code | Code | Message | Description |
400 | 200 | Duplicate channel ID. | Duplicate channel ID |
| 201 | Channel not found or deleted. | Channel not found or deleted |
| 202 | Channel is full. | Channel is full |
| 203 | Invalid channel password. | Invalid channel password |
| 204 | Message size exceeded. The maximum size is 200. | Message size exceeded (max 200 characters) |
| 300 | User not in session. | User not in session (Not connected to Socket server) |
| 301 | User not in the channel. | User not in the channel |
| 302 | User is already in the channel. | User is already in the channel |
| 303 | User already blocked. | User already blocked |
| 304 | Block list is full. The maximum size is 100. | Block list is full (max 100 users) |
| 305 | User not in block list. | User not in block list |
| 306 | User is blocked. | User is blocked |
| 307 | The maximum number of channels a user can enter is 10. | Exceeded the maximum number of channels a user can enter (limit 10) |
| 400 | Custom message size exceeded. The maximum size is 8,000 bytes. | Exceeded the maximum size for custom messages (max 8,000 bytes) |
403 | 308 | User is not the owner of the channel. | User is not the owner of the channel |
Channel API functions
This section describes the API requests, responses, and example code for each function of the channel API used in the chat service.
Get all channels
Retrieve a list of all channels that have been created.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/channels |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/channels |
HTTP METHOD | GET |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Query parameters
Field | Description | Type | Required |
type | Channel type (PRIVATE , PUBLIC , GROUP ) | string | N |
channelId | Retrieve channels starting with this channel ID | string | N |
channelName | Retrieve channels containing this channel name | string | N |
sort | Sort criteria (channelId , channelName , regTime ) (Default regTime ) | string | N |
order | Sort order (ASC , DESC ) (Default DESC ) | string | N |
size | Number of channels to retrieve per page (Min 1 ~ Max 10, Default 10) | integer | N |
page | Page number to retrieve (Starts from 1, Default 1) | integer | N |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
data | Response data | object |
Response body > data
Field | Description | Type |
content | List of channels | object array |
page | Page information | object |
Response body > data > content
Field | Description | Type |
channelId | Channel ID | string |
type | Channel type (PRIVATE , PUBLIC , GROUP ) | string |
gameIndex | Hive game index | integer |
owner | Channel owner’s Player ID | string |
channelName | Channel name | string |
memberCount | Current number of members in the channel | integer |
maxMemberCount | Maximum number of members allowed in the channel | integer |
chatHistoryAllowed | Whether message history can be viewed | boolean |
regTime | Channel creation date and time (UTC+0 standard, yyyy-MM-dd'T'HH:mm:ss.SSSZ format) | string |
regTimeMillis | Channel creation date and time (UnixTimestamp Millisecond) | long |
Response body > data > page
Field | Description | Type |
size | Number of items per page | integer |
currentPage | Current page number | integer |
totalElements | Total number of items | integer |
totalPages | Total number of pages | integer |
Request sample
curl --request GET 'https://api-chat.withhive.com/api/v1/games/1/channels?type=PUBLIC&sort=regTime&order=DESC&size=10&page=1' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNzAyNDU4MTkzLCJqdGkiOiIxMzY2NDk4MjcxIn0.VSwvsTE-tS0sL_e9p9gNvHRkMCbsycSO4ObE4J2ysjs'
Response sample
{
"code": 0,
"message": "Success.",
"data": {
"content": [
{
"channelId": "open:12345",
"type": "PUBLIC",
"gameIndex": 1,
"owner": "1000",
"channelName": "Open Chat Room",
"memberCount": 2,
"maxMemberCount": 50,
"chatHistoryAllowed": true,
"regTime": "2024-12-30T15:01:01.004Z",
"regTimeMillis": 1731306364351
},
/// ... Channel information
],
"page": {
"size": 10,
"currentPage": 1,
"totalElements": 100,
"totalPages": 10
}
}
}
Get channel
Retrieve detailed information about a channel.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId} |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId} |
HTTP METHOD | GET |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
channelId | ID of the channel to retrieve | string | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
data | Response data | object |
Response body > data
Field | Description | Type |
info | Channel information | object |
members | List of members | object array |
Response body > data > info
Field | Description | Type |
channelId | Channel ID | string |
type | Channel type (PRIVATE , PUBLIC , GROUP ) | string |
gameIndex | Hive game index | integer |
owner | Channel owner | string |
channelName | Channel name | string |
memberCount | Current number of members in the channel | integer |
maxMemberCount | Maximum number of members allowed in the channel | integer |
chatHistoryAllowed | Whether message history can be viewed | boolean |
regTime | Channel creation date and time (UTC+0 standard, yyyy-MM-dd'T'HH:mm:ss.SSSZ format) | string |
regTimeMillis | Channel creation date and time (UnixTimestamp Millisecond) | long |
Response body > data > members
Field | Description | Type |
playerId | Player ID | long |
connectedTime | Connection date and time (UTC+0 standard, yyyy-MM-dd'T'HH:mm:ss.SSSZ format) | string |
connectedTimeMillis | Connection date and time (UnixTimestamp Millisecond) | long |
Request sample
curl --request GET 'https://api-chat.withhive.com/api/v1/games/1/channels/open:12345' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNzAyNDU4MTkzLCJqdGkiOiIxMzY2NDk4MjcxIn0.VSwvsTE-tS0sL_e9p9gNvHRkMCbsycSO4ObE4J2ysjs'
Response sample
{
"code": 0,
"message": "Success.",
"data": {
"info": {
"channelId": "open:12345",
"type": "PUBLIC",
"gameIndex": 1,
"owner": "SYSTEM",
"channelName": "Open Chat Room",
"memberCount": 2,
"maxMemberCount": 50,
"chatHistoryAllowed": true,
"regTime": "2024-12-30T15:01:01.004Z",
"regTimeMillis": 1731306364351
},
"members": [
{
"playerId": 1,
"connectedTime": "2024-11-25T06:22:06.604Z",
"connectedTimeMillis": 1739328218507
},
{
"playerId": 2,
"connectedTime": "2024-11-25T06:22:16.233Z",
"connectedTimeMillis": 1731306364351
}
]
}
}
Get channel members
Retrieve information about the members of a channel.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId}/members |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId}/members |
HTTP METHOD | GET |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
channelId | ID of the channel to retrieve | string | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
data | Response data | object |
Response body > data
Field | Description | Type |
members | List of channel members | object array |
Response Body > data > members
Field | Description | Type |
playerId | Player ID | long |
connectedTime | Connection date and time (UTC+0 standard, yyyy-MM-dd'T'HH:mm:ss.SSSZ format) | string |
connectedTimeMillis | Connection date and time (UnixTimestamp Millisecond) | long |
Request sample
curl --request GET 'https://api-chat.withhive.com/api/v1/games/1/channels/open:12345/members' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNzAyNDU4MTkzLCJqdGkiOiIxMzY2NDk4MjcxIn0.VSwvsTE-tS0sL_e9p9gNvHRkMCbsycSO4ObE4J2ysjs'
Response sample
{
"code": 0,
"message": "Success.",
"data": {
"members": [
{
"playerId": 1,
"connectedTime": "2024-11-25T06:22:06.604Z",
"connectedTimeMillis": 1739328218507
},
{
"playerId": 2,
"connectedTime": "2024-11-25T06:22:16.233Z",
"connectedTimeMillis": 1731306364351
}
]
}
}
Create channel
Create a new channel.
If you enter playerId
in the request body, the user corresponding to playerId
becomes the owner of the channel and enters the channel. If you do not enter playerId
, SYSTEM
becomes the owner of the channel.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/channel |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/channel |
HTTP METHOD | POST |
CONTENT-TYPE | application/json |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Content-Type | Type of request data (application/json ) | string | Y |
Request body
The data to be sent when requesting to create a channel.
Field | Description | Type | Required |
channelId | Channel ID (Can use English uppercase and lowercase letters, numbers, and some special characters (- , . , _ , ~ , : ), up to 100 characters) | string | Y |
playerId | Channel creator's Player ID | long | N |
password | Password (Required for PRIVATE channels) (Up to 50 characters) | string | N |
channelName | Channel name (Up to 50 characters) | string | Y |
maxMemberCount | Maximum number of members allowed in the channel (Min 2 ~ Max 5,000) | integer | Y |
type | Channel type (PRIVATE , PUBLIC , GROUP ) | string | Y |
chatHistoryAllowed | Whether message history can be viewed (Default false) | boolean | N |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
Request sample
curl --request POST 'https://sandbox-api-chat.withhive.com/api/v1/games/1/channel' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNzAyNDU4MTkzLCJqdGkiOiIxMzY2NDk4MjcxIn0.VSwvsTE-tS0sL_e9p9gNvHRkMCbsycSO4ObE4J2ysjs' \
--header 'Content-Type: application/json' \
--data'{
"channelId": "open:12345",
"playerId": 1000,
"channelName": "Open Chat Room",
"maxMemberCount": 100,
"type": "PUBLIC",
"chatHistoryAllowed": true
}'
Response sample
{
"code": 0,
"message": "Success."
}
Delete channel
Delete a channel.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId} |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId} |
HTTP Method | DELETE |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
channelId | ID of the channel to delete | string | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
Request sample
curl --request DELETE 'https://api-chat.withhive.com/api/v1/games/1/channels/open:12345' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNzAyNDU4MTkzLCJqdGkiOiIxMzY2NDk4MjcxIn0.VSwvsTE-tS0sL_e9p9gNvHRkMCbsycSO4ObE4J2ysjs'
Response sample
{
"code": 0,
"message": "Success."
}
Enter channel
Enter a channel.
The maximum number of channels that can be entered is 10 per user.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId}/enter |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId}/enter |
HTTP METHOD | POST |
CONTENT-TYPE | application/json |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
channelId | ID of the channel to enter | string | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Content-Type | Type of request data (application/json ) | string | Y |
Request body
The data required when requesting to enter a channel.
Field | Description | Type | Required |
playerId | Player ID of the user to be entered | long | Y |
password | Password (Required for PRIVATE channels) | string | N |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
Request sample
curl --request POST 'https://api-chat.withhive.com/api/v1/games/1/channels/guild:12345/enter' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNzAyNDU4MTkzLCJqdGkiOiIxMzY2NDk4MjcxIn0.VSwvsTE-tS0sL_e9p9gNvHRkMCbsycSO4ObE4J2ysjs' \
--header 'Content-Type: application/json' \
--data '{
"playerId": 1001,
"password": "guildPass123"
}'
Response sample
{
"code": 0,
"message": "Success."
}
Exit channel
Exit a channel.
Even if the owner of the channel exits, the channel will be maintained. However, if the owner is not SYSTEM
and there are no participants in the channel, the channel will be deleted periodically.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId}/exit |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId}/exit |
HTTP METHOD | POST |
CONTENT-TYPE | application/json |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
channelId | ID of the channel to exit | string | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Content-Type | Type of request data (application/json ) | string | Y |
Request body
The data required when requesting to exit a channel.
Field | Description | Type | Required |
playerId | Player ID of the user to be exited | long | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
Request sample
curl --request POST 'https://sandbox-api-chat.withhive.com/api/v1/games/1/channels/guild:12345/exit' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNzAyNDU4MTkzLCJqdGkiOiIxMzY2NDk4MjcxIn0.VSwvsTE-tS0sL_e9p9gNvHRkMCbsycSO4ObE4J2ysjs' \
--header 'Content-Type: application/json' \
--data '{
"playerId": 1001
}'
Response sample
{
"code": 0,
"message": "Success."
}
User API functions
This section describes the API requests, responses, and example code for each function of the user API used in the chat service.
Issue user token
Issue an authentication token for connecting to the Socket server.
Connect to the returned Socket server address using the issued token.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/users/{playerId}/token |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/users/{playerId}/token |
HTTP METHOD | POST |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
playerId | Player ID | long | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
data | Response data | object |
Response body > data
Field | Description | Type |
gameIndex | Hive game index | integer |
socketAddress | Socket server address | string |
token | Issued token | string |
Request sample
curl --request POST 'https://api-chat.withhive.com/api/v1/games/1/users/1001/token' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJnYW1lSW5kZXgiOjEsInBsYXllcklkIjoxLCJpYXQiOjE3MzI1MTcyMzUsImV4cCI6MTczMjUyMDgzNX0.lm5eFqEuSPjsKZUItpTQvFy_2oWrMMJ_J0MPH9VFtNg'
Response sample
{
"code": 0,
"message": "Success.",
"data": {
"gameIndex": 1,
"socketAddress": "wss://test-socket-chat.withhive.com/ws",
"token": "eyJhbGciOiJIUzI1NiJ9.eyJnYW1lSW5kZXgiOjEsInBsYXllcklkIjoxLCJpYXQiOjE3MzI1MTcyMzUsImV4cCI6MTczMjUyMDgzNX0.lm5eFqEuSPjsKZUItpTQvFy_2oWrMMJ_J0MPH9VFtNg"
}
}
Get user joined channels
Retrieve a list of channels the user has joined.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/users/{playerId}/channels |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/users/{playerId}/channels |
HTTP METHOD | GET |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
playerId | Player ID | long | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
data | Response data | object |
Response body > data
Field | Description | Type |
gameIndex | Hive game index | integer |
playerId | Player ID | long |
channels | List of channels | object array |
Response body > data > channels
Field | Description | Type |
channelId | Channel ID | string |
type | Channel type (PRIVATE , PUBLIC , GROUP ) | string |
gameIndex | Hive game index | integer |
owner | Channel owner | string |
channelName | Channel name | string |
memberCount | Current number of members in the channel | integer |
maxMemberCount | Maximum number of members allowed in the channel | integer |
chatHistoryAllowed | Whether message history can be viewed | boolean |
regTime | Channel creation date and time (UTC+0 standard, yyyy-MM-dd'T'HH:mm:ss.SSSZ format) | string |
regTimeMillis | Channel creation date and time (UnixTimestamp Millisecond) | long |
Request sample
curl --request GET 'https://sandbox-api-chat.withhive.com/api/v1/games/1/users/1001/channels' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJnYW1lSW5kZXgiOjEsInBsYXllcklkIjoxLCJpYXQiOjE3MzI1MTcyMzUsImV4cCI6MTczMjUyMDgzNX0.lm5eFqEuSPjsKZUItpTQvFy_2oWrMMJ_J0MPH9VFtNg'
Response sample
{
"code": 0,
"message": "Success.",
"data": {
"gameIndex": 1,
"playerId": 1001,
"channels": [
{
"channelId": "guild:12345",
"type": "GROUP",
"gameIndex": 1,
"owner": "1000",
"channelName": "Guild Chat Room",
"memberCount": 1,
"maxMemberCount": 50,
"chatHistoryAllowed": true,
"regTime": "2023-12-19T15:01:01.004Z",
"regTimeMillis": 1731306364351
},
{
"channelId": "open:67890",
"type": "PUBLIC",
"gameIndex": 1,
"owner": "SYSTEM",
"channelName": "Open Chat Room",
"memberCount": 2,
"maxMemberCount": 100,
"chatHistoryAllowed": true,
"regTime": "2023-12-20T10:15:30.123Z",
"regTimeMillis": 1731302348750
}
// ... channels
]
}
}
Get user block list
Retrieve a list of users blocked by the user.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/users/{playerId}/blocks |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/users/{playerId}/blocks |
HTTP METHOD | GET |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | string | Y |
playerId | Player ID | long | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
data | Response data | object |
Response body > data
Field | Description | Type |
gameIndex | Hive game index | integer |
playerId | Player ID | long |
blockedUsers | Blocked users list | object array |
Response body > data > blockedUsers
Field | Description | Type |
blockedPlayerId | Player ID of the blocked user | long |
blockedTime | Date and time when the user was blocked (UTC+0 standard, yyyy-MM-dd'T'HH:mm:ss.SSSZ format) | string |
blockedTimeMillis | Date and time when the user was blocked (UnixTimestamp Millisecond) | long |
Request sample
curl --request GET 'https://sandbox-api-chat.withhive.com/api/v1/games/1/users/1001/blocks' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJnYW1lSW5kZXgiOjEsInBsYXllcklkIjoxLCJpYXQiOjE3MzI1MTcyMzUsImV4cCI6MTczMjUyMDgzNX0.lm5eFqEuSPjsKZUItpTQvFy_2oWrMMJ_J0MPH9VFtNg'
Response sample
{
"code": 0,
"message": "Success.",
"data": {
"gameIndex": 1,
"playerId": 1001,
"blockedUsers": [
{
"blockedPlayerId": 1002,
"blockedTime": "2023-12-20T10:15:30.123Z",
"blockedTimeMillis": 1739329550811
},
{
"blockedPlayerId": 1003,
"blockedTime": "2023-12-21T08:45:12.456Z",
"blockedTimeMillis": 1739329553137
},
// ... Blocked users list
]
}
}
Block user
Block another user. This restricts real-time message sending and receiving.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/users/{playerId}/block/{blockPlayerId} |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/users/{playerId}/block/{blockPlayerId} |
HTTP METHOD | POST |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | string | Y |
playerId | Player ID | long | Y |
blockPlayerId | Player ID to be blocked | long | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
Request sample
curl --request POST 'https://sandbox-api-chat.withhive.com/api/v1/games/1/users/1001/block/1002' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJnYW1lSW5kZXgiOjEsInBsYXllcklkIjoxLCJpYXQiOjE3MzI1MTcyMzUsImV4cCI6MTczMjUyMDgzNX0.lm5eFqEuSPjsKZUItpTQvFy_2oWrMMJ_J0MPH9VFtNg'
Response sample
{
"code": 0,
"message": "Success."
}
Unblock user
Unblock a blocked user.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/users/{playerId}/block/{blockedPlayerId} |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/users/{playerId}/block/{blockedPlayerId} |
HTTP METHOD | DELETE |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | string | Y |
playerId | Player ID | long | Y |
blockedPlayerId | Player ID to be unblocked | long | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
Request sample
curl --request DELETE 'https://sandbox-api-chat.withhive.com/api/v1/games/1/users/1001/block/1002' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJnYW1lSW5kZXgiOjEsInBsYXllcklkIjoxLCJpYXQiOjE3MzI1MTcyMzUsImV4cCI6MTczMjUyMDgzNX0.lm5eFqEuSPjsKZUItpTQvFy_2oWrMMJ_J0MPH9VFtNg'
Response sample
{
"code": 0,
"message": "Success."
}
Message API functions
APIs for sending notice or custom messages, or retrieving message history for a specific channel.
Send notice message
Send a notice message to a specific channel or all users.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/notice |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/notice |
HTTP METHOD | POST |
CONTENT-TYPE | application/json |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Content-Type | Type of request data (application/json ) | string | Y |
Request body
The data to be sent when requesting to send a notice message.
Field | Description | Type | Required |
channelId | ID of the channel to send the message | string | N |
langCode | Hive language code of the user to receive the message (send regardless of language if not provided) (Based on ISO 639 alpha-2, use Script tag to distinguish languages not classified by ISO 639 alpha-2) | string | N |
message | Content of the notice message to be sent (Max 200 characters) | string | Y |
channelId
If channelId
is provided, the Channel notice message is sent to all users connected to the channel.
If channelId
is not provided, the User notice message is sent to all users connected to the app with the corresponding gameIndex
.
langCode
If langCode
is not provided, the message is sent to all users regardless of language.
If langCode
is provided, the message is sent only to users whose langCode
matches the value. For example, if langCode
is en
, the notice message is sent only to users whose Request body langCode
is en
when connecting the client.
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
Request sample
curl --request POST 'https://sandbox-api-chat.withhive.com/api/v1/games/1/notice' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJnYW1lSW5kZXgiOjEsInBsYXllcklkIjoxLCJpYXQiOjE3MzI1MTcyMzUsImV4cCI6MTczMjUyMDgzNX0.lm5eFqEuSPjsKZUItpTQvFy_2oWrMMJ_J0MPH9VFtNg' \
--header 'Content-Type: application/json' \
--data '{
"channelId": "open:12345",
"langCode": "en",
"message": "Server maintenance. Please reconnect later."
}'
Response sample
{
"code": 0,
"message": "Success."
}
Send user notice message
Send a User notice message to a user.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/notice/users/{playerId} |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/notice/users/{playerId} |
HTTP METHOD | POST |
CONTENT-TYPE | application/json |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
playerId | Hive player ID | long | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Content-Type | Type of request data (application/json ) | string | Y |
Request body
The data to be sent when requesting to send a notice message to a user.
Field | Description | Type | Required |
langCode | Hive language code of the user to receive the message (send regardless of language if not provided) (Based on ISO 639 alpha-2, use Script tag to distinguish languages not classified by ISO 639 alpha-2) | string | N |
message | Content of the notice message to be sent (Max 200 characters) | string | Y |
langCode
If langCode
is not provided, the message is sent to the user regardless of language.
If langCode
is provided, the notice message is sent only if the langCode
in the client's request when connecting matches this API's langCode
. For example, if playerId=1111
's client is connected with langCode=en
, and this API is called with playerId=1111, langCode=ja
, the notice message will not be sent to this user.
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
Request sample
curl --request POST 'https://sandbox-api-chat.withhive.com/api/v1/games/1/notice/users/123123' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJnYW1lSW5kZXgiOjEsInBsYXllcklkIjoxLCJpYXQiOjE3MzI1MTcyMzUsImV4cCI6MTczMjUyMDgzNX0.lm5eFqEuSPjsKZUItpTQvFy_2oWrMMJ_J0MPH9VFtNg' \
--header 'Content-Type: application/json' \
--data '{
"langCode": "en",
"message": "This is a notice message for user 123123."
}'
Response sample
{
"code": 0,
"message": "Success."
}
Send channel custom message
Send a custom message to all users participating in a channel.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/custom-message/channels/{channelId} |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/custom-message/channels/{channelId} |
HTTP METHOD | POST |
CONTENT-TYPE | application/json |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
channelId | ID of the channel to send the message | string | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Content-Type | Type of request data (application/json ) | string | Y |
Request body
The data to be sent when requesting to send a custom message.
Field | Description | Type | Required |
message | Content of the custom message to be sent (UTF-8 standard) (Max 8,000 Byte) | string | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
Request sample
curl --request POST 'https://sandbox-api-chat.withhive.com/api/v1/games/1/custom-message/channels/public:123' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJnYW1lSW5kZXgiOjEsInBsYXllcklkIjoxLCJpYXQiOjE3MzI1MTcyMzUsImV4cCI6MTczMjUyMDgzNX0.lm5eFqEuSPjsKZUItpTQvFy_2oWrMMJ_J0MPH9VFtNg' \
--header 'Content-Type: application/json' \
--data '{
"message": "This is a custom message."
}'
Response sample
{
"code": 0,
"message": "Success."
}
Send user custom message
Send a custom message to a user.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/custom-message/users |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/custom-message/users |
HTTP METHOD | POST |
CONTENT-TYPE | application/json |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Content-Type | Type of request data (application/json ) | string | Y |
Request body
The data to be sent when requesting to send a custom message to a user.
Field | Description | Type | Required |
playerIds | List of account identifiers to receive the message Player ID list (Max 10 users) | long array | Y |
message | Content of the custom message to be sent (UTF-8 standard) (Max 8,000 Byte) | string | Y |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
Request sample
curl --request POST 'https://sandbox-api-chat.withhive.com/api/v1/games/1/custom-message/users' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJnYW1lSW5kZXgiOjEsInBsYXllcklkIjoxLCJpYXQiOjE3MzI1MTcyMzUsImV4cCI6MTczMjUyMDgzNX0.lm5eFqEuSPjsKZUItpTQvFy_2oWrMMJ_J0MPH9VFtNg' \
--header 'Content-Type: application/json' \
--data '{
"playerIds": [
123123
],
"message": "This is a custom message."
}'
Response sample
{
"code": 0,
"message": "Success."
}
Get channel message history
Retrieve the message history of a channel. The channel message history is provided with cursor-based pagination, and only message histories from the last 30 days can be retrieved. This API can only be used if the channel setting View previous conversation history is enabled. The channel message history received in the API response may include messages from blocked users.
Pagination: size and index
Pagination using the index
query parameter is provided. The default value of index
is none, and if the request is made without index
, the most recent messages will be retrieved according to the size
.
For example, if the API is called with size=5
without index
, the 5 most recent message histories will be returned along with a nextIndex
(e.g., 68009c30780e4f2d9830d8a0
).
Subsequently, if the API is called with index=68009c30780e4f2d9830d8a0
and size=5
, the 5 messages that occurred before the last returned message will be retrieved.
If the response value hasNext
is true
, there are more message histories available. In other words, the nextIndex
received in the response can be used as index
to retrieve more previous message histories of the channel.
Request URL
Server | URL |
LIVE | https://api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId}/messages |
SANDBOX | https://sandbox-api-chat.withhive.com/api/v1/games/{gameIndex}/channels/{channelId}/messages |
HTTP METHOD | GET |
Path parameters
Field | Description | Type | Required |
gameIndex | Hive game index | integer | Y |
channelId | ID of the channel to retrieve | integer | Y |
Field | Description | Type | Required |
Authorization | Authentication token for API calls (Bearer ) | string | Y |
Query parameters
The query string data required when requesting to retrieve channel message history.
Field | Description | Type | Required |
size | Size of the channel history (Min 1 ~ Max 50) | integer | Y |
index | Index to use for retrieval (retrieve the most recent message if not provided) | string | N |
Response body
Field | Description | Type |
code | Response code | integer |
message | Result message | string |
data | Response data | object |
Response body > data
Field | Description | Type |
hasNext | Whether more data can be retrieved | boolean |
nextIndex | Next index to use for retrieval | string |
content | Channel message history | object array |
Response body > data > content
Field | Description | Type |
gameIndex | Hive game index | integer |
from | Identifier of the account that received the message Player ID | long |
extraData | Additional user information (UTF-8 standard) (Max 256 Byte) | string |
to | ID of the channel the message was sent to | string |
message | Message content | string |
langCode | Hive language code (Based on ISO 639 alpha-2, use Script tag to distinguish languages not classified by ISO 639 alpha-2) | string |
timestamp | Date and time when the message was sent (UTC+0 standard, yyyy-MM-dd'T'HH:mm:ss.SSSZ format) | string |
timestampMillis | Date and time when the message was sent (UnixTimestamp Millisecond) | long |
Request sample
curl --request GET 'https://test-api-chat.withhive.com/api/v1/games/1/channels/open:1/messages?size=50' \
--header 'Authorization: hivechat 005056fffea3fd10-000400fd-00000797-f67881178d98d1cd-64ae9a76'
Response sample
{
"code": 0,
"message": "Success.",
"data": {
"hasNext": true,
"nextIndex": "67c7d83336af25202c1c0ad4",
"content": [
// size=50이므로 아래와 같은 객체들을 50개 반환함.
{
"gameIndex": 1,
"from": 1111112,
"extraData": "Kim Hive",
"to": "open:10",
"message": "zzz",
"langCode": "ko",
"timestamp": "2025-03-05T04:50:59.757Z",
"timestampMillis": 1741150259757
},
{
"gameIndex": 1,
"from": 1111111,
"extraData": null,
"to": "open:10",
"message": "Hive2",
"langCode": "ko",
"timestamp": "2025-03-05T04:51:01.689Z",
"timestampMillis": 1741150261689
},
]
}
}