이 문서는 REST API를 구현한 JEEOK-MEMBER API 사용 방법을 안내합니다.

개요

Http 동사

본 REST API에서 사용하는 HTTP 동사(verbs)는 가능한 표준 HTTP 와 REST 규약을 따릅니다.

동사 용례

GET

리소스를 가져올 때 사용

POST

새 리소스를 만들 때 사용

PUT

기존 리소스를 수정할 때 사용

PATCH

기존 리소스의 일부를 수정할 때 사용

DELETE

기존 리소스를 삭제할 떄 사용

HTTP 상태 코드

본 REST API에서 사용하는 HTTP 상태 코드는 가능한 표준 HTTP와 REST 규약을 따릅니다.

상태 코드 용례

200 OK

요청을 성공적으로 처리함

201 Created

새 리소스를 성공적으로 생성함. 응답의 Location 헤더에 해당 리소스의 URI가 담겨있다.

204 No Content

기존 리소스를 성공적으로 수정함.

400 Bad Request

잘못된 요청을 보낸 경우. 응답 본문에 더 오류에 대한 정보가 담겨있다.

404 Not Found

요청한 리소스가 없음.

409 Conflict

클라이언트의 요청이 서버의 상태와 충돌이 발생한 경우.

기본 정보

로그인 및 권한정보를 request header에 포함하여 인증

header에 member-id 입력할 필요 없음

Key Value Description

Authorization

Bearer ${accessToken}

로그인 후 리턴 받은 accessToken

사용자 모드

사용자 화면에 사용됩니다.

내 정보 조회

요청

Name Description

member-id

회원 고유번호(입력하지 말것!)

GET //delivery.jeeokshop.jeeok.com/member/info HTTP/1.1
member-id: 27
Host: https

응답

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 204

{"transaction_time":"2022-11-19T20:45:17.230184","code":"SUCCESS","message":null,"errors":null,"data":{"memberId":27,"email":"gildong-hong@jeeok.com","memberName":"홍길동","phoneNumber":"01012345678"}}
Path Type Description

transaction_time

String

api 요청 시간

code

String

SUCCESS or ERROR

message

Null

메시지

errors

Null

에러

data.memberId

Number

회원 고유번호

data.email

String

이메일

data.memberName

String

회원 이름

data.phoneNumber

String

회원 휴대폰번호

내 정보 수정

요청

Table 1. /member/{memberId}/edit
Parameter Description

memberId

회원 고유번호

PUT //delivery.jeeokshop.jeeok.com/member/26/edit HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 54
Host: https

{"memberName":"홍길순","phoneNumber":"01087654321"}

응답

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 119

{"transaction_time":"2022-11-19T20:45:17.1029331","code":"SUCCESS","message":null,"errors":null,"data":{"memberId":26}}
Path Type Description

transaction_time

String

api 요청 시간

code

String

SUCCESS or ERROR

message

Null

메시지

errors

Null

에러

data.memberId

Number

회원 고유번호

관리자 모드

관리자 권한만 사용할 수 있습니다.

회원 목록 조회

요청

GET //delivery.jeeokshop.jeeok.com/admin/members?searchKeyword=jeeok&searchCondition=NAME&page=0&size=10 HTTP/1.1
Host: https
Parameter Description

searchCondition

검색 조건

searchKeyword

검색 키워드

page

검색 페이지

size

검색 사이즈

응답

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 1935

{"transaction_time":"2022-11-19T20:45:16.9885591","code":"SUCCESS","message":null,"errors":null,"data":[{"memberId":25,"email":"jeeok@gmail.com14","memberName":"jeeok14","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}},{"memberId":24,"email":"jeeok@gmail.com13","memberName":"jeeok13","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}},{"memberId":23,"email":"jeeok@gmail.com12","memberName":"jeeok12","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}},{"memberId":22,"email":"jeeok@gmail.com11","memberName":"jeeok11","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}},{"memberId":21,"email":"jeeok@gmail.com10","memberName":"jeeok10","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}},{"memberId":20,"email":"jeeok@gmail.com9","memberName":"jeeok9","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}},{"memberId":19,"email":"jeeok@gmail.com8","memberName":"jeeok8","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}},{"memberId":18,"email":"jeeok@gmail.com7","memberName":"jeeok7","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}},{"memberId":17,"email":"jeeok@gmail.com6","memberName":"jeeok6","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}},{"memberId":16,"email":"jeeok@gmail.com5","memberName":"jeeok5","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}}]}
Path Type Description

transaction_time

String

api 요청 시간

code

String

SUCCESS or ERROR

message

Null

메시지

errors

Null

에러

data[*].memberId

Number

회원 고유번호

data[*].email

String

이메일

data[*].memberName

String

회원 이름

data[*].role

String

회원 권한

data[*].auth

String

회원 로그인 유형

data[*].phoneNumber

String

회원 휴대폰번호

data[*].address.zipcode

String

우편번호

data[*].address.address

String

회원 주소

회원 단건 조회

요청

Table 2. /admin/members/{memberId}
Parameter Description

memberId

회원 고유 번호

GET //delivery.jeeokshop.jeeok.com/admin/members/9 HTTP/1.1
Host: https

응답

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 282

{"transaction_time":"2022-11-19T20:45:15.7312776","code":"SUCCESS","message":null,"errors":null,"data":{"memberId":9,"email":"jeeok@gmail.com","memberName":"jeeok","role":"일반유저","auth":"JEEOK","phoneNumber":"01011112222","address":{"zipcode":"83726","address":"서울시"}}}
Path Type Description

transaction_time

String

api 요청 시간

code

String

SUCCESS or ERROR

message

Null

메시지

errors

Null

에러

data.memberId

Number

회원 고유번호

data.email

String

이메일

data.memberName

String

회원 이름

data.role

String

회원 권한

data.auth

String

회원 로그인 유형

data.phoneNumber

String

회원 휴대폰번호

data.address.zipcode

String

우편번호

data.address.address

String

회원 주소

회원 저장

요청

POST //delivery.jeeokshop.jeeok.com/admin/members HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 157
Host: https

{"email":"jeeok@gmail.com","password":"1234","memberName":"jeeok","roleType":"ROLE_USER","phoneNumber":"01011112222","zipcode":"83726","address":"서울시"}
Path Type Description

email

String

이메일

password

String

비밀번호

memberName

String

회원 이름

roleType

String

회원 권한 타입

phoneNumber

String

회원 휴대폰번호

zipcode

String

우편번호

address

String

회원 주소

응답

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 124

{"transaction_time":"2022-11-19T20:45:15.8558899","code":"SUCCESS","message":null,"errors":null,"data":{"savedMemberId":10}}
Path Type Description

transaction_time

String

api 요청 시간

code

String

SUCCESS or ERROR

message

Null

메시지

errors

Null

에러

data.savedMemberId

Number

저장된 회원 고유번호

회원 수정

요청

Table 3. /admin/members/{memberId}
Parameter Description

memberId

회원 고유번호

PUT //delivery.jeeokshop.jeeok.com/admin/members/7 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 97
Host: https

{"memberName":"update_jeeok","phoneNumber":"01033331234","zipcode":"99802","address":"세종시"}
Path Type Description

memberName

String

회원 이름

phoneNumber

String

회원 휴대폰번호

zipcode

String

우편번호

address

String

회원 주소

응답

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 124

{"transaction_time":"2022-11-19T20:45:15.453699","code":"SUCCESS","message":null,"errors":null,"data":{"updatedMemberId":7}}
Path Type Description

transaction_time

String

api 요청 시간

code

String

SUCCESS or ERROR

message

Null

메시지

errors

Null

에러

data.updatedMemberId

Number

수정된 회원 고유번호

회원 삭제

요청

Table 4. /admin/members/{memberId}
Parameter Description

memberId

회원 고유번호

DELETE //delivery.jeeokshop.jeeok.com/admin/members/8 HTTP/1.1
Host: https

응답

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 108

{"transaction_time":"2022-11-19T20:45:15.6382758","code":"SUCCESS","message":null,"errors":null,"data":null}
Path Type Description

transaction_time

String

api 요청 시간

code

String

SUCCESS or ERROR

message

Null

메시지

errors

Null

에러

data

Null

데이터