Member API

๋ฉค๋ฒ„ ํšŒ์›๊ฐ€์ž…

HTTP ์š”์ฒญ

POST /api/member/join HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 94
Host: localhost:8080

{
  "email" : "lena.hyatt@yahoo.com",
  "password" : "B88B564E8B79",
  "nickname" : "Jeremy"
}
Path Type Description

email

String

๋ฉค๋ฒ„ ์ด๋ฉ”์ผ

password

String

๋ฉค๋ฒ„ ๋น„๋ฐ€๋ฒˆํ˜ธ

nickname

String

๋ฉค๋ฒ„ ๋‹‰๋„ค์ž„

HTTP ์‘๋‹ต

HTTP/1.1 201 Created
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 75

{
  "id" : 3,
  "email" : "lena.hyatt@yahoo.com",
  "nickname" : "Jeremy"
}
Path Type Description

id

Number

๋ฉค๋ฒ„ ID

email

String

๋ฉค๋ฒ„ ์ด๋ฉ”์ผ

nickname

String

๋ฉค๋ฒ„ ๋‹‰๋„ค์ž„

๋ฉค๋ฒ„ ๋กœ๊ทธ์ธ

HTTP ์š”์ฒญ

POST /api/member/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 72
Host: localhost:8080

{
  "email" : "denver.blanda@gmail.com",
  "password" : "24F7410803A4"
}
Path Type Description

email

String

๋ฉค๋ฒ„ ์ด๋ฉ”์ผ

password

String

๋ฉค๋ฒ„ ๋น„๋ฐ€๋ฒˆํ˜ธ

HTTP ์‘๋‹ต

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 488

{
  "id" : 2,
  "email" : "denver.blanda@gmail.com",
  "nickname" : "Adrian",
  "jwtTokenPair" : {
    "accessToken" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyIiwiaWF0IjoxNjk3MDI0NjY3LCJleHAiOjE2OTcwMjU1Njd9.plYl_EPUd82mhuyvZxBXn-sWOU2GaJnQJ5lIohBVF9dgiz29gZf-IMVY5mxO3XhAvzuVq5jza3ncjMuMpwJpIA",
    "refreshToken" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyIiwiaWF0IjoxNjk3MDI0NjY3LCJleHAiOjE2OTcxMTEwNjd9.vtjO3JB6PAyW2AXq-tH7MdD45qfhGq5ToMseVbSqGkvwBIaHuKt59t4R5c9QeuQGV2svrO-GSmyex5xI3lzkEw"
  }
}
Path Type Description

id

Number

๋ฉค๋ฒ„ ID

email

String

๋ฉค๋ฒ„ ์ด๋ฉ”์ผ

nickname

String

๋ฉค๋ฒ„ ๋‹‰๋„ค์ž„

jwtTokenPair['accessToken']

String

JWT ์•ก์„ธ์Šค ํ† ํฐ

jwtTokenPair['refreshToken']

String

JWT ๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ

๋ฉค๋ฒ„ ์กฐํšŒ

HTTP ์š”์ฒญ

GET /api/member/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
Table 1. /api/member/{id}
Parameter Description

id

๋ฉค๋ฒ„ ID

HTTP ์‘๋‹ต

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 77

{
  "id" : 1,
  "email" : "dana.wolf@hotmail.com",
  "nickname" : "Maribel"
}
Path Type Description

id

Number

๋ฉค๋ฒ„ ID

email

String

๋ฉค๋ฒ„ ์ด๋ฉ”์ผ

nickname

String

๋ฉค๋ฒ„ ๋‹‰๋„ค์ž„

JWT API

์•ก์„ธ์Šค ํ† ํฐ ์žฌ์ƒ์„ฑ

HTTP ์š”์ฒญ

POST /api/auth/refresh HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMjM0IiwiaWF0IjoxNjk3MDI0NjY2LCJleHAiOjE2OTcwMjU1NjZ9._df_uT9peku8XG7Y0olwSbYnM7IqlMgFo_VivX07LVgHdsqqtqTFO1MIJXkzXvQQL7b1e6dft6GKqxz_NI__Uw
Content-Length: 223
Host: localhost:8080

{
  "grantType" : "Bearer",
  "refreshToken" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMjM0IiwiaWF0IjoxNjk3MDI0NjY2LCJleHAiOjE2OTcxMTEwNjZ9.0btETiulOj1TijVoFDwEI2416A-rMyEJfpTM4E4wc7lN3fI_qYI8uiCS4_fwVEJ1miZSbDTf2rLV1q9puF_XzA"
}
Path Type Description

grantType

String

ํ† ํฐ ๊ถŒํ•œ ํƒ€์ž…

refreshToken

String

๋กœ๊ทธ์ธ ์‹œ ๋ฐœ๊ธ‰ ๋ฐ›์€ ๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ

HTTP ์‘๋‹ต

HTTP/1.1 201 Created
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 417

{
  "grantType" : "Bearer",
  "accessToken" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMjM0IiwiaWF0IjoxNjk3MDI0NjY2LCJleHAiOjE2OTcwMjU1NjZ9._df_uT9peku8XG7Y0olwSbYnM7IqlMgFo_VivX07LVgHdsqqtqTFO1MIJXkzXvQQL7b1e6dft6GKqxz_NI__Uw",
  "refreshToken" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMjM0IiwiaWF0IjoxNjk3MDI0NjY2LCJleHAiOjE2OTcxMTEwNjZ9.0btETiulOj1TijVoFDwEI2416A-rMyEJfpTM4E4wc7lN3fI_qYI8uiCS4_fwVEJ1miZSbDTf2rLV1q9puF_XzA"
}
Path Type Description

grantType

String

ํ† ํฐ ๊ถŒํ•œ ํƒ€์ž…

accessToken

String

์žฌ์ƒ์„ฑ๋œ ์•ก์„ธ์Šค ํ† ํฐ

refreshToken

String

๋ฆฌํ”„๋ ˆ์‹œ ํ† ํฐ

POST API

ํฌ์ŠคํŠธ ๋ชฉ๋ก ์กฐํšŒ

HTTP ์š”์ฒญ

GET /api/post?page=1&size=3 HTTP/1.1
Host: localhost:8080
Parameter Description

page

ํŽ˜์ด์ง€ ๋ฒˆํ˜ธ

size

ํŽ˜์ด์ง€ ๋‹น ๊ฒŒ์‹œ๊ธ€ ๊ฐœ์ˆ˜

HTTP ์‘๋‹ต

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 669

[ {
  "postId" : 12,
  "memberId" : 7,
  "title" : "Ea hic rerum sint.",
  "content" : "Dolorem quibusdam quia sed aliquam commodi nesciunt et. Voluptatem esse fugiat non. Saepe vel ut velit voluptas neque."
}, {
  "postId" : 11,
  "memberId" : 7,
  "title" : "Praesentium et voluptates maiores est magni soluta.",
  "content" : "Magnam aliquam tenetur. Ipsam doloremque et."
}, {
  "postId" : 10,
  "memberId" : 7,
  "title" : "Accusamus reiciendis blanditiis officia laborum.",
  "content" : "Quibusdam eius iure cupiditate mollitia sit. Illo aut et. Fugit omnis debitis eveniet consequatur saepe. Qui consequatur veniam consectetur incidunt amet inventore vero."
} ]
Path Type Description

[].postId

Number

๊ฒŒ์‹œ๊ธ€ ID

[].memberId

Number

๋ฉค๋ฒ„(์ž‘์„ฑ์ž) ID

[].title

String

๊ฒŒ์‹œ๊ธ€ ์ œ๋ชฉ

[].content

String

๊ฒŒ์‹œ๊ธ€ ๋‚ด์šฉ

ํฌ์ŠคํŠธ ์กฐํšŒ

HTTP ์š”์ฒญ

GET /api/post/6 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080

HTTP ์‘๋‹ต

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 283

{
  "postId" : 6,
  "memberId" : 7,
  "title" : "Exercitationem iste fugit totam modi porro odio.",
  "content" : "Id minus et molestiae. Voluptas consequatur cupiditate non neque voluptas velit ut. Itaque voluptas sunt sed blanditiis aut voluptatem iure. Consequatur sed dolores."
}
Path Type Description

postId

Number

๊ฒŒ์‹œ๊ธ€ ID

memberId

Number

๋ฉค๋ฒ„(์ž‘์„ฑ์ž) ID

title

String

๊ฒŒ์‹œ๊ธ€ ์ œ๋ชฉ

content

String

๊ฒŒ์‹œ๊ธ€ ๋‚ด์šฉ

ํฌ์ŠคํŠธ ์ž‘์„ฑ

HTTP ์š”์ฒญ

POST /api/post HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI2IiwiaWF0IjoxNjk3MDI0NjY4LCJleHAiOjE2OTcwMjU1Njh9.dnKHtkgJPt0Vg0gYP6_PnRsf3FdLsOL85a_WC0D408-2xZfZEjHVICgPpsQ2WZMHK1fqYTIVC1BfhsEMHNGAAA
Content-Length: 277
Host: localhost:8080

{
  "title" : "Culpa velit atque quia atque possimus ea reprehenderit maiores sint iste et.",
  "content" : "Asperiores voluptates et eveniet facilis aut repudiandae. Nulla ducimus perferendis ratione. Aut occaecati ex ut et et. Eius aut quo hic voluptatem laboriosam nulla."
}
Path Type Description

title

String

๊ฒŒ์‹œ๊ธ€ ์ œ๋ชฉ

content

String

๊ฒŒ์‹œ๊ธ€ ๋‚ด์šฉ

HTTP ์‘๋‹ต

HTTP/1.1 201 Created
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 311

{
  "postId" : 5,
  "memberId" : 6,
  "title" : "Culpa velit atque quia atque possimus ea reprehenderit maiores sint iste et.",
  "content" : "Asperiores voluptates et eveniet facilis aut repudiandae. Nulla ducimus perferendis ratione. Aut occaecati ex ut et et. Eius aut quo hic voluptatem laboriosam nulla."
}
Path Type Description

postId

Number

๊ฒŒ์‹œ๊ธ€ ID

memberId

Number

๋ฉค๋ฒ„ ID

title

String

๊ฒŒ์‹œ๊ธ€ ์ œ๋ชฉ

content

String

๊ฒŒ์‹œ๊ธ€ ๋‚ด์šฉ

ํฌ์ŠคํŠธ ์ˆ˜์ •

HTTP ์š”์ฒญ

PUT /api/post/2 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI1IiwiaWF0IjoxNjk3MDI0NjY4LCJleHAiOjE2OTcwMjU1Njh9.0wRCNhaU8b-8D2SIfzZ9vDLq4nJ9AxUK5iZ6ZCmlVsWhD1L8NYGzpMJ5eBMs0hFxBaOWGkvwG-JdJXNk6QM0Fg
Content-Length: 151
Host: localhost:8080

{
  "title" : "Perspiciatis ab dolores dolorem quas veniam.",
  "content" : "Magni est molestiae dolorem velit nihil. Voluptatem rerum quis facilis."
}
Path Type Description

title

String

๊ฒŒ์‹œ๊ธ€ ์ œ๋ชฉ

content

String

๊ฒŒ์‹œ๊ธ€ ๋‚ด์šฉ

HTTP ์‘๋‹ต

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 185

{
  "memberId" : 5,
  "postId" : 2,
  "title" : "Perspiciatis ab dolores dolorem quas veniam.",
  "content" : "Magni est molestiae dolorem velit nihil. Voluptatem rerum quis facilis."
}
Path Type Description

postId

Number

๊ฒŒ์‹œ๊ธ€ ID

memberId

Number

๋ฉค๋ฒ„ ID

title

String

๊ฒŒ์‹œ๊ธ€ ์ œ๋ชฉ

content

String

๊ฒŒ์‹œ๊ธ€ ๋‚ด์šฉ

ํฌ์ŠคํŠธ ์‚ญ์ œ

HTTP ์š”์ฒญ

DELETE /api/post/1 HTTP/1.1
Authorization: bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0IiwiaWF0IjoxNjk3MDI0NjY3LCJleHAiOjE2OTcwMjU1Njd9.xztr8goHS6EkmgZn5eTSrOK7wmHQHNsw-uZE6MZu7zE_VpYCGXb4bn_od-sHP6iGC9pWfYiTIgAbD2aumFqLIw
Host: localhost:8080

HTTP ์‘๋‹ต

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 18

{
  "postId" : 1
}
Path Type Description

postId

Number

์‚ญ์ œ๋œ ๊ฒŒ์‹œ๊ธ€ ID