API 목록
내 알림 목록 조회 API
Curl request
$ curl 'http://localhost:8080/api/v1/notifications/me?page=1&size=10' -i -X GET \
-H 'X-USER-ID: 1'
HTTP request
GET /api/v1/notifications/me?page=1&size=10 HTTP/1.1
X-USER-ID: 1
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 772
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : {
"notifications" : [ {
"userId" : 1,
"title" : "알림 제목",
"content" : "알림 본문",
"readAt" : "2024-03-13T14:29:11.703958333Z",
"createdAt" : "2024-03-13T14:29:11.703985233Z",
"data" : {
"type" : "comment",
"commentId" : 1,
"articleId" : 1
}
}, {
"userId" : 1,
"title" : "알림 제목",
"content" : "알림 본문",
"readAt" : null,
"createdAt" : "2024-03-13T14:29:11.704471046Z",
"data" : {
"type" : "articleLike",
"articleId" : 1
}
} ],
"page" : 1,
"size" : 10,
"totalPages" : 1,
"numberOfElements" : 1,
"totalElements" : 1
}
}
HTTPie request
$ http GET 'http://localhost:8080/api/v1/notifications/me?page=1&size=10' \
'X-USER-ID:1'
Query parameters
| Parameter | Description |
|---|---|
|
페이지 |
|
페이지 사이즈 |
Request body
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 id |
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : {
"notifications" : [ {
"userId" : 1,
"title" : "알림 제목",
"content" : "알림 본문",
"readAt" : "2024-03-13T14:29:11.703958333Z",
"createdAt" : "2024-03-13T14:29:11.703985233Z",
"data" : {
"type" : "comment",
"commentId" : 1,
"articleId" : 1
}
}, {
"userId" : 1,
"title" : "알림 제목",
"content" : "알림 본문",
"readAt" : null,
"createdAt" : "2024-03-13T14:29:11.704471046Z",
"data" : {
"type" : "articleLike",
"articleId" : 1
}
} ],
"page" : 1,
"size" : 10,
"totalPages" : 1,
"numberOfElements" : 1,
"totalElements" : 1
}
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
페이지 |
|
|
페이지 사이즈 |
|
|
총 페이지 수 |
|
|
반환된 데이터 개수 |
|
|
전체 데이터 개수 |
|
|
알림 목록 |
|
|
사용자 id |
|
|
알림 제목 |
|
|
알림 본문 |
|
|
읽은 시간 |
|
|
알림 생성 시간 |
|
|
알림 동적 데이터 |
|
|
알림 데이터 타입 |
알림 확인 API
Curl request
$ curl 'http://localhost:8080/api/v1/notifications/me/read' -i -X PUT \
-H 'X-USER-ID: 1'
HTTP request
PUT /api/v1/notifications/me/read HTTP/1.1
X-USER-ID: 1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 76
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : 3
}
HTTPie request
$ http PUT 'http://localhost:8080/api/v1/notifications/me/read' \
'X-USER-ID:1'
Request body
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 id |
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : 3
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
확인한 알림 갯수 |
확인하지 않은 알림 유무 API
Curl request
$ curl 'http://localhost:8080/api/v1/notifications/me/unread' -i -X GET \
-H 'X-USER-ID: 1'
HTTP request
GET /api/v1/notifications/me/unread HTTP/1.1
X-USER-ID: 1
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : true
}
HTTPie request
$ http GET 'http://localhost:8080/api/v1/notifications/me/unread' \
'X-USER-ID:1'
Request body
Request headers
| Name | Description |
|---|---|
|
로그인한 유저 id |
Response body
{
"success" : true,
"code" : "SUCCESS",
"message" : "",
"data" : true
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
성공 여부 |
|
|
결과 코드 |
|
|
메시지 |
|
|
확인하지 않은 알림 존재 유무 |