Skip to content

HTTP API

Overview

The HTTP API provides chat services by communicating with the API server via HTTP. It is mainly composed of Channel API and User API.

The main features of the channel API and user API are as follows.

  • Channel API
    • Get all channel list API
    • Channel retrieval API
    • Channel participant retrieval API
    • Channel creation API
    • Channel deletion API
    • Channel entry API
    • Channel exit API
    • Announcement message sending API
  • User API
    • User token issuance API
    • User participating channel retrieval API
    • User block list retrieval API
    • User block API
    • User unblock API

Basic information

This provides basic information that you need to know when using the HTTP API.

Preparation

To use the HTTP API, you need to prepare the following items.

  • Hive Certification Key: Authentication token for API calls
    • Can be found in 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 type

The channel types used when sending HTTP API are as follows.

Type Description
PUBLIC A channel that anyone can enter
PRIVATE A channel that can be entered by entering a password
GROUP A channel that only specific users can participate in (e.g., guild channel)

Request URL

Server URL
LIVE api-chat.withhive.com
SANDBOX sandbox-api-chat.withhive.com

Common header

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y
Content-Type Type of the request data (application/json) string Y

Response code

  • API response code
HTTP Status Code Code Message Description
200 0 Success. Success
400 100 Bad request. Bad request
401 101 Invalid token. Invalid token
403 102 Forbidden. Forbidden
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, cannot enter due to exceeding participant limit
203 Invalid channel password. Invalid channel password
204 Message size exceeded. The maximum size is 200. Message size exceeded (maximum 200 characters)
300 User not in session. User is not in session (not connected to the Socket server)
301 User not in the channel. User is not in the channel
302 User is already in the channel. User is already in the channel
303 User already blocked. User is already blocked
304 Block list is full. The maximum size is 100. Block list is full (maximum 100 people)
305 User not in block list. User is not in the block list
306 User is blocked. User is blocked
307 The maximum number of channels a user can enter is 10. Exceeded the number of channels a user can enter (limit of 10)
403 308 User is not the owner of the channel. User is not the owner of the channel

Channel API features

This explains the API requests and responses for each function of the channel API used in the chat service, along with example code.

Retrieve all channel list

Retrieving the list of currently created channels.

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 Name Description Type Required
gameIndex Hive Game Index integer Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y

Query parameters

Field Name Description Type Required
type Channel type (PRIVATE, PUBLIC, GROUP) string N
channelId Retrieve channels starting with a specific channel ID string N
channelName Retrieve channels containing a specific channel name string N
sort Sorting criteria (channelId, channelName, regTime)
(default regTime)
string N
order Sorting method (ASC, DESC)
(default DESC)
string N
size Number of channels to retrieve per page
(minimum 10 ~ maximum 100, default 10)
integer N
page Page number to retrieve
(starts from 1, default 1)
integer N

Response body

Field Name Description Type
code Response code integer
message Result message string
data Response data object
Response body > data
Field Name Description Type
content Channel List array
page Page Info object
Response body > data > content
Field Name Description Type
channelId Channel ID string
type Channel type (PRIVATE, PUBLIC, GROUP) string
gameIndex Hive game index integer
owner Hive player ID of the channel owner string
channelName Channel name string
memberCount Current number of channel participants integer
maxMemberCount Maximum number of channel participants integer
regTime Channel creation date and time (based on UTC+0, format yyyy-MM-dd'T'HH:mm:ss.SSSZ) string
regTimeMillis Channel creation date and time (UnixTimestamp Millisecond) integer
Response body > data > page
Field Name 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": "오픈 채팅방",
        "memberCount": 2,
        "maxMemberCount": 50,
        "regTime": "2024-12-30T15:01:01.004Z",
        "regTimeMillis": 1731306364351
      },
      /// ... 채널 정보
    ],
    "page": {
      "size": 10,
      "currentPage": 1,
      "totalElements": 100,
      "totalPages": 10
    }
  }
}

Channel lookup

Retrieving detailed information for a specific 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 Name Description Type Required
gameIndex Hive Game Index integer Y
channelId Channel ID to query string Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y

Response body

Field Name Description Type
code Response result code integer
message Result message string
data Response data object
Response body > data
Field Name Description Type
info Channel Info object
members Participant List array
Response body > data > info
Field Name 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 channel participants integer
maxMemberCount Maximum number of channel participants integer
regTime Channel creation date and time (based on UTC+0, format yyyy-MM-dd'T'HH:mm:ss.SSSZ) string
regTimeMillis Channel creation date and time (UnixTimestamp Millisecond) integer
Response body > data > members
Field Name Description Type
playerId Hive Player ID long
extraData Additional data (UTF-8 based)
(Maximum 256 Byte)
string
connectedTime Connection date and time (UTC+0 based, yyyy-MM-dd'T'HH:mm:ss.SSSZ format) string
connectedTimeMillis Connection time (UnixTimestamp Millisecond) integer

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": "오픈채팅방",
      "memberCount": 2,
      "maxMemberCount": 50,
      "regTime": "2024-12-30T15:01:01.004Z",
      "regTimeMillis": 1731306364351
    },
    "members": [
      {
        "playerId": 1,
        "extraData": null,
        "connectedTime": "2024-11-25T06:22:06.604Z",
        "connectedTimeMillis": 1739328218507
      },
      {
        "playerId": 2,
        "extraData": null,
        "connectedTime": "2024-11-25T06:22:16.233Z",
        "connectedTimeMillis": 1731306364351
      }
    ]
  }
}

Channel participants query

Retrieving participant information for a specific 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 Name Description Type Required
gameIndex Hive Game Index integer Y
channelId Channel ID to query string Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y

Response body

Field Name Description Type
code Response result code integer
message Result message string
data Response data object
Response body > data
Field Name Description Type
members List of channel participants array
Response body > data > members
Field Name Description Type
playerId Hive Player ID long
extraData Additional data (UTF-8 based)
(Maximum 256 Byte)
string
connectedTime Connection date and time (UTC+0 based, yyyy-MM-dd'T'HH:mm:ss.SSSZ format) string
connectedTimeMillis Connection time (UnixTimestamp Millisecond) integer

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,
        "extraData": null,
        "connectedTime": "2024-11-25T06:22:06.604Z",
        "connectedTimeMillis": 1739328218507
      },
      {
        "playerId": 2,
        "extraData": null,
        "connectedTime": "2024-11-25T06:22:16.233Z",
        "connectedTimeMillis": 1731306364351
      }
    ]
  }
}

Create channel

Creating a new conversation channel.

If the playerId exists, the user will be allowed to enter the channel. If there is no playerId, the owner will be SYSTEM.

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 Name Description Type Required
gameIndex Hive Game Index integer Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y
Content-Type Type of the request data (application/json) string Y

Request body

This is the transmission data required when requesting to create a channel.

Field Name Description Type Required
channelId Channel ID
(English letters, numbers, and some special characters (-, ., _, ~, :) allowed, up to 100 characters)
string Y
playerId Player ID of the channel creator's Hive 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 channel participants
(minimum 2 to maximum 5,000)
integer Y
type Channel type (PRIVATE, PUBLIC, GROUP) string Y

Response body

Field Name Description Type
code Response result 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": "오픈 채팅방",
    "maxMemberCount": 100,
    "type": "PUBLIC"
}'

Response sample

{
    "code": 0,
    "message": "Success."
}

Delete channel

Deleting a specific 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 Name Description Type Required
gameIndex Hive Game Index integer Y
channelId Channel ID to delete string Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y

Response body

Field Name 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

Entering users into the existing channel.

The maximum number of channels that a user can enter is 10.

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 Name Description Type Required
gameIndex Hive Game Index integer Y
channelId Channel ID string Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y
Content-Type Type of the request data (application/json) string Y

Request body

This is the transmission data required when requesting to enter the channel.

Field Name Description Type Required
playerId Player ID of the user to be admitted Hive long Y
password Password (required for PRIVATE channels) string N

Response body

Field Name Description Type
code Response result 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-raw '{
    "playerId": 1001,
    "password": "guildPass123"
}'

Response sample

{
    "code": 0,
    "message": "Success."
}

Channel exit

Removing users from the channel. The channel will remain even if the channel owner leaves.

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 Name Description Type Required
gameIndex Hive Game Index integer Y
channelId Channel ID string Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y
Content-Type Type of the request data (application/json) string Y

Request body

This is the transmission data required when requesting to exit the channel.

Field Name Description Type Required
playerId Player ID of the user to be removed Hive long Y

Response body

Field Name Description Type
code Response result 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."
}

Notice message sending

Sends announcement messages to a specific channel or all channels in the game. If the channelId parameter is not provided, the announcement message will be delivered to all channels created for the corresponding gameIndex.

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 Name Description Type Required
gameIndex Hive Game Index integer Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y
Content-Type Type of the request data (application/json) string Y

Request body

This is the transmission data required when requesting to send a notification message.

Field Name Description Type Required
channelId The channel ID to send the message to (if channelId is not provided, it will be sent to all channels) string N
message The content of the announcement message to be sent string Y

Response body

Field Name Description Type
code Response result code integer
message Description 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",
    "message": "서버 점검이 있습니다. 잠시 후 다시 접속해 주세요."
}'

Response sample

{
    "code": 0,
    "message": "Success."
}

User API features

This explains the API requests and responses for user APIs used in the chat service, along with example code.

User token issuance

Issuing an authentication token for connecting to the socket server.

Connect to the Socket server address returned through 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 Name Description Type Required
gameIndex Hive Game Index integer Y
playerId Hive Player ID long Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y

Response body

Field Name Description Type
code Response result code integer
message Result message string
data Response data object
Response body > data
Field Name 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"
  }
}

User participation channel inquiry

Retrieves the list of channels the user is participating in.

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 Name Description Type Required
gameIndex Hive Game Index integer Y
playerId Hive Player ID long Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y

Response body

Field Name Description Type
code Response result code integer
message Result message string
data Response data object
Response body > data
Field Name Description Type
gameIndex Hive Game Index integer
playerId Hive Player ID long
channels List of Channels array
Response body > data > channels
Field Name 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 channel participants integer
maxMemberCount Maximum number of channel participants integer
regTime Channel creation date and time (based on UTC+0, format yyyy-MM-dd'T'HH:mm:ss.SSSZ) string
regTimeMillis Channel creation date and time (UnixTimestamp Millisecond) integer

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": "길드 채팅방",
        "memberCount": 1,
        "maxMemberCount": 50,
        "regTime": "2023-12-19T15:01:01.004Z",
        "regTimeMillis": 1731306364351
      },
      {
        "channelId": "open:67890",
        "type": "PUBLIC",
        "gameIndex": 1,
        "owner": "SYSTEM",
        "channelName": "오픈 채팅방",
        "memberCount": 2,
        "maxMemberCount": 100,
        "regTime": "2023-12-20T10:15:30.123Z",
        "regTimeMillis": 1731302348750
      }
      // ... 채널
    ]
  }
}

User block list retrieval

Retrieving the 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 Name Description Type Required
gameIndex Hive Game Index string Y
playerId Hive Player ID long Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y

Response body

Field Name Description Type
code Response result code integer
message Result message string
data Response data object
Response body > data
Field Name Description Type
gameIndex Hive game index integer
playerId Hive player ID long
blockedUsers Blocked list array
Response body > data > blockedusers
Field Name Description Type
blockedPlayerId Player ID of the blocked user Hive long
blockedTime Time of blocking (based on UTC+0, format yyyy-MM-dd'T'HH:mm:ss.SSSZ) string
blockedTimeMillis Time of blocking (Unix Timestamp Millisecond) integer

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
      },
      // ... 차단 목록
    ]
  }
}

User block

The user blocks a specific user.

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 Name Description Type Required
gameIndex Hive Game Index string Y
playerId Hive Player ID long Y
blockPlayerId Block Hive Player ID long Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y

Response body

Field Name Description Type
code Response result 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

The user unblocks a specific 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 Name Description Type Required
gameIndex Hive game index string Y
playerId Hive player ID long Y
blockedPlayerId Unblock Hive player ID long Y

Header parameters

Field Name Description Type Required
Authorization Authentication token for API calls (Bearer) string Y

Response body

Field Name Description Type
code Response result 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."
}