좋아요
채널의 각 메시지에 '좋아요'를 추가하거나 취소할 수 있습니다.
- '좋아요' 추가 혹은 취소 API를 호출하면 해당 채널의 참여자들에게 '좋아요' 관련 이벤트 메시지가 전송됩니다.
'좋아요' 추가 API
특정 메시지에 '좋아요'를 추가합니다.
- 이미 '좋아요'를 추가한 메시지에 중복으로 추가할 수 없습니다.
- 공지 메시지에는 '좋아요'를 추가할 수 없습니다.
Request URL
서버 | URL |
LIVE | https://plugin-chat.withhive.com/plugin/api/like/v1/games/{gameIndex}/channels/{channelId}/messages/{messageId} |
SANDBOX | https://sandbox-plugin-chat.withhive.com/plugin/api/like/v1/games/{gameIndex}/channels/{channelId}/messages/{messageId} |
HTTP METHOD | POST |
Path parameters
필드명 | 설명 | 타입 | 필수 여부 |
gameIndex | Hive 게임 인덱스 | integer | Y |
channelId | 채널 ID | string | Y |
messageId | 메시지 ID | string | Y |
필드명 | 설명 | 타입 | 필수 여부 |
Authorization | API 호출을 위한 인증 토큰 (Bearer ) | string | Y |
Content-Type | 요청 데이터의 타입 (application/json ) | string | Y |
Request body
필드명 | 설명 | 타입 | 필수 여부 |
playerId | '좋아요'를 추가한 유저의 Player ID | long | Y |
Response body
필드명 | 설명 | 타입 |
code | 응답 결과 코드 | integer |
message | 결과 메시지 | string |
Request sample
curl --location 'https://plugin-chat.withhive.com/plugin/api/like/v1/games/1/channels/open:12345/messages/0196f733-4f33-7a63-a657-5b0e5e792472' \
--header 'Content-Type: application/json' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNzAyNDU4MTkzLCJqdGkiOiIxMzY2NDk4MjcxIn0.VSwvsTE-tS0sL_e9p9gNvHRkMCbsycSO4ObE4J2ysjs' \
--data '{"playerId":1}'
Response sample
{
"code": 0,
"message": "Success."
}
'좋아요' 취소
메시지에 추가된 '좋아요'를 취소합니다.
- 본인이 추가한 '좋아요'만 취소할 수 있습니다.
Request URL
서버 | URL |
LIVE | https://plugin-chat.withhive.com/plugin/api/like/v1/games/{gameIndex}/channels/{channelId}/messages/{messageId}/players/{playerId} |
SANDBOX | https://sandbox-plugin-chat.withhive.com/plugin/api/like/v1/games/{gameIndex}/channels/{channelId}/messages/{messageId}/players/{playerId} |
HTTP METHOD | DELETE |
Path parameters
필드명 | 설명 | 타입 | 필수 여부 |
gameIndex | Hive 게임 인덱스 | integer | Y |
channelId | 채널 ID | string | Y |
messageId | 메시지 ID | string | Y |
playerId | '좋아요'를 취소할 유저의 Player ID | long | Y |
필드명 | 설명 | 타입 | 필수 여부 |
Authorization | API 호출을 위한 인증 토큰 (Bearer ) | string | Y |
Response body
필드명 | 설명 | 타입 |
code | 응답 결과 코드 | integer |
message | 결과 메시지 | string |
Request sample
curl --location --request DELETE 'https://plugin-chat.withhive.com/plugin/api/like/v1/games/1/channels/open:12345/messages/0196f733-4f33-7a63-a657-5b0e5e792472/players/1' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIaXZlIiwiaWF0IjoxNzAyNDU4MTkzLCJqdGkiOiIxMzY2NDk4MjcxIn0.VSwvsTE-tS0sL_e9p9gNvHRkMCbsycSO4ObE4J2ysjs'
Response sample
{
"code": 0,
"message": "Success."
}
Response code
공통 응답 코드를 제외하고, '좋아요' 기능 전용으로 수신할 수 있는 응답 코드입니다.
HTTP 상태 코드 | 코드 | 메시지 | 설명 |
400 | 10000 | The Like not found or deleted. | '좋아요' 정보를 찾을 수 없음 |
400 | 10001 | Message not found or deleted. | '좋아요' 정보를 처리할 메시지를 찾을 수 없음 |
400 | 10002 | Message already has the Like info. | '좋아요' 정보가 이미 존재함 |
'좋아요' 정보를 포함한 API 응답
기존 채널 메시지 내역 조회 API 응답에 포함된 '좋아요' 정보를 설명합니다.
Response body > data > content > pluginData
채널 메시지에 '좋아요' 정보가 있을 경우, 채널 메시지 내역 조회 API 응답 본문 중 data > content > pluginData 에 like
필드가 포함됩니다.
필드명 | 설명 | 타입 |
like | '좋아요' 정보 | object |
Response body > data > content > pluginData > like
필드명 | 설명 | 타입 |
playerIds | '좋아요'를 추가한 유저의 Player ID(복수) | long array |
Response sample
{
// ... 중략
"content": [
{
"gameIndex": 1374,
"from": 1,
"messageId": "ggJ5Csh15J-mI3i5",
"extraData": "",
"pluginData": {
"like": {
"playerIds": [
1
]
}
},
"to": "public:10",
"message": "aaa",
"langCode": "ko",
"timestamp": "2025-07-17T00:56:17.156Z",
"timestampMillis": 1752713777156
}
]
// ... 중략
}