Voucher API

쿠폰 등록

HTTP Request

POST /api/vouchers HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=image; filename=voucherImage.jpg
Content-Type: image/jpeg

voucherImage
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=request
Content-Type: application/json

{"groupId":1,"voucherName":"voucher name","expiration":"2025-01-01"}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--

Multipart info

Part Description

request

쿠폰 생성 request

image

쿠폰 이미지 파일

Multipart Request Fields

Path Type Description Optional

groupId

Number

쿠폰을 저장할 그룹 ID

X

voucherName

String

저장할 쿠폰의 이름

X

expiration

String

저장할 쿠폰의 만료 기간

X

HTTP Response

HTTP/1.1 201 Created
Location: /vouchers/1
Content-Type: application/json
Content-Length: 154

{
  "id" : 1,
  "presignedImage" : "image",
  "name" : "voucher name",
  "registeredUserId" : 1,
  "expiration" : "2025-01-01",
  "status" : "AVAILABLE"
}

Response Fields

Path Type Description Optional

id

Number

생성된 쿠폰 ID

X

presignedImage

String

이미지 URL

X

status

String

쿠폰 상태 (AVAILABLE/EXPIRED/USED)

X

registeredUserId

Number

쿠폰을 등록한 유저의 ID

X

name

String

쿠폰 등록자가 설정한 쿠폰의 이름

X

expiration

String

쿠폰 등록자가 설정한 쿠폰의 만료 기간

X

쿠폰 삭제

HTTP Request

DELETE /api/vouchers/group/1/voucher/1 HTTP/1.1
Content-Type: application/json
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site
Table 1. /api/vouchers/group/{groupId}/voucher/{voucherId}
Parameter Description

groupId

쿠폰이 속한 그룹 ID

voucherId

삭제할 쿠폰 ID

HTTP Response

HTTP/1.1 200 OK

쿠폰 조회

HTTP Request

GET /api/vouchers/1?cursorId=1&pageSize=1 HTTP/1.1
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site
Table 2. /api/vouchers/{groupId}
Parameter Description

groupId

쿠폰을 조회하고자 하는 그룹 ID

Query parameters

Name Description Optional

cursorId

커서 ID 값

O

pageSize

페이지 사이즈 값 (기본값 10)

O

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 733

{
  "content" : [ {
    "groupTitle" : "나의 그룹 이름",
    "groupInviteCode" : "InviteCode",
    "vouchers" : [ {
      "id" : 1,
      "presignedImage" : "mockPresignedUrl",
      "name" : "my voucherName",
      "registeredUserId" : 1,
      "expiration" : "2025-01-01",
      "status" : "AVAILABLE"
    } ]
  } ],
  "pageable" : {
    "pageNumber" : 0,
    "pageSize" : 1,
    "sort" : {
      "empty" : true,
      "sorted" : false,
      "unsorted" : true
    },
    "offset" : 0,
    "paged" : true,
    "unpaged" : false
  },
  "size" : 1,
  "number" : 0,
  "sort" : {
    "empty" : true,
    "sorted" : false,
    "unsorted" : true
  },
  "numberOfElements" : 1,
  "first" : true,
  "last" : true,
  "empty" : false
}

Response Fields

Path Type Description Optional

content

Array

조회된 쿠폰 객체들의 배열

X

content[].groupTitle

String

해당 쿠폰 객체가 속해있는 그룹의 사용자별 별칭

X

content[].groupInviteCode

String

해당 쿠폰 객체가 속해있는 그룹의 초대코드

X

content[].vouchers[].id

Number

쿠폰 ID

X

content[].vouchers[].presignedImage

String

쿠폰 이미지 URL

X

content[].vouchers[].status

String

쿠폰 사용 상태 (AVAILABLE/EXPIRED/USED)

X

content[].vouchers[].registeredUserId

Number

쿠폰을 등록한 유저의 ID

X

content[].vouchers[].name

String

쿠폰 등록자가 설정한 쿠폰의 이름

X

content[].vouchers[].expiration

String

쿠폰 등록자가 설정한 쿠폰의 만료 기간

X

pageable

Object

페이지네이션 요청 정보

X

pageable.pageNumber

Number

현재 페이지 번호

X

pageable.pageSize

Number

요청된 페이지 크기

X

pageable.sort

Object

요청된 정렬 정보

X

pageable.sort.empty

Boolean

정렬 기준 존재 여부

X

pageable.sort.sorted

Boolean

정렬이 적용되었는지 여부

X

pageable.sort.unsorted

Boolean

정렬이 적용되지 않았는지 여부

X

pageable.offset

Number

요청 오프셋

X

pageable.paged

Boolean

페이지네이션이 적용되었는지 여부

X

pageable.unpaged

Boolean

페이지네이션이 적용되지 않았는지 여부

X

size

Number

페이지 크기

X

number

Number

현재 페이지 번호

X

sort

Object

실제 적용된 정렬 정보

X

sort.empty

Boolean

정렬 기준 존재 여부

X

sort.sorted

Boolean

정렬이 적용되었는지 여부

X

sort.unsorted

Boolean

정렬이 적용되지 않았는지 여부

X

first

Boolean

첫 페이지인지 여부

X

last

Boolean

마지막 페이지인지 여부

X

numberOfElements

Number

현재 페이지에 실제 포함된 요소 개수

X

empty

Boolean

현재 페이지가 비어 있는지 여부

X

쿠폰 상태 변경

HTTP Request

PATCH /api/vouchers/group/1/voucher/1 HTTP/1.1
Content-Type: application/json
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site
Table 3. /api/vouchers/group/{groupId}/voucher/{voucherId}
Parameter Description

groupId

쿠폰이 속한 그룹 ID

voucherId

변경할 쿠폰 ID

HTTP Response

HTTP/1.1 200 OK

Token API

엑세스 토큰 발급

HTTP Request

GET /api/reissue HTTP/1.1
Host: api.shareticon.site
Cookie: refresh=refreshtoken
Name Description

refresh

리프레시 토큰

HTTP Response

HTTP/1.1 200 OK
Authorization: Bearer expectedToken

Response Header

Name Description

Authorization

엑세스 토큰

로그아웃

HTTP Request

POST /api/logout HTTP/1.1
Content-Type: application/json
Authorization: Bearer expectedToken
Host: api.shareticon.site

Request Header

Name Description

Authorization

엑세스 토큰

HTTP Response

HTTP/1.1 200 OK

Group API

그룹 생성

HTTP Request

POST /api/group HTTP/1.1
Content-Type: application/json
Content-Length: 31
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site

{
  "title" : "그룹 이름"
}

HTTP Response

HTTP/1.1 201 Created
Location: /group/1
Content-Type: application/json
Content-Length: 38

{
  "id" : 1,
  "inviteCode" : "ABC"
}

Response Fields

Path Type Description Optional

id

Number

생성된 그룹 ID

X

inviteCode

String

생성된 그룹의 초대코드

X

Response Header

Name Description

Location

생성된 그룹 조회 URI

전체 그룹 조회

HTTP Request

GET /api/group HTTP/1.1
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 150

[ {
  "groupId" : 1,
  "groupTitleAlias" : "title1",
  "memberCount" : 2
}, {
  "groupId" : 2,
  "groupTitleAlias" : "title2",
  "memberCount" : 2
} ]

Response Fields

Path Type Description Optional

[]

Array

조회된 그룹 리스트

X

[].groupId

Number

그룹 ID

X

[].groupTitleAlias

String

그룹의 별칭

X

[].memberCount

Number

그룹에 참여중인 총 멤버의 수

X

그룹 가입

HTTP Request

POST /api/group/join HTTP/1.1
Content-Type: application/json
Content-Length: 33
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site

{
  "inviteCode" : "inviteCode"
}

Request Fields

Path Type Description Optional

inviteCode

String

가입하기를 원하는 그룹의 초대 코드

X

HTTP Response

HTTP/1.1 204 No Content

그룹 가입 신청 내역 조회

HTTP Request

GET /api/group/join HTTP/1.1
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 185

[ {
  "targetGroupId" : 1,
  "leaderGroupAlias" : "리더의 그룹 별칭",
  "pendingMembers" : [ {
    "applyUserId" : 1,
    "applyUserNickname" : "가입신청한 유저"
  } ]
} ]

Response Fields

Path Type Description Optional

[]

Array

유저가 처리할 수 있는 그룹 가입 신청 리스트

X

[].targetGroupId

Number

가입 신청이 들어온 그룹 ID

X

[].leaderGroupAlias

String

리더가 설정한 가입 신청이 들어온 그룹의 별칭

X

[].pendingMembers

Array

가입을 신청한 유저의 리스트

X

[].pendingMembers[].applyUserId

Number

가입을 신청한 유저 ID

X

[].pendingMembers[].applyUserNickname

String

가입을 신청한 유저의 닉네임

X

그룹 가입 신청 내역 처리

HTTP Request

PATCH /api/group/1/user/1?status=APPROVED HTTP/1.1
Content-Type: application/json
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site
Table 4. /api/group/{groupId}/user/{userId}
Parameter Description

groupId

유저가 가입 신청을 한 대상 그룹 ID

userId

가입 신청을 한 유저 ID

Query parameters

Name Description Optional

status

처리할 상태값. (APPROVED: 승인, REJECTED: 거절)

X

HTTP Response

HTTP/1.1 204 No Content

사용자별 그룹 별칭 변경

HTTP Request

PATCH /api/group/1 HTTP/1.1
Content-Type: application/json
Content-Length: 43
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site

{
  "newGroupTitleAlias" : "그룹별칭"
}
Table 5. /api/group/{groupId}
Parameter Description

groupId

별칭을 변경할 대상이 되는 그룹 ID

Request Fields

Path Type Description Optional

newGroupTitleAlias

String

변경하기를 원하는 별칭

X

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 52

{
  "groupId" : 1,
  "titleAlias" : "그룹별칭"
}

Response Fields

Path Type Description Optional

groupId

Number

별칭이 변경된 그룹 ID

X

titleAlias

String

변경된 별칭

X

User API

유저 프로필 조회

HTTP Request

GET /api/profile HTTP/1.1
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 122

{
  "userId" : 1,
  "nickName" : "닉네임",
  "email" : "test@test",
  "joinGroupCount" : 1,
  "ownedVoucherCount" : 2
}

Response Fields

Path Type Description Optional

userId

Number

서버에서의 유저 아이디

X

nickName

String

유저의 닉네임

X

email

String

유저의 이메일

X

joinGroupCount

Number

유저가 가입되어 있는 그룹의 개수

X

ownedVoucherCount

Number

유저가 등록한 쿠폰의 총 개수

X

유저 닉네임 변경

HTTP Request

PATCH /api/profile HTTP/1.1
Content-Type: application/json
Content-Length: 43
Authorization: Bearer TOKEN_VALUE
Host: api.shareticon.site

{
  "newNickname" : "새로운 닉네임"
}

Request Fields

Path Type Description Optional

newNickname

String

유저가 새로 바꾸려는 닉네임

X

HTTP Response

HTTP/1.1 204 No Content