API 명세서 _ 0909 초안

API 리스트 (v1.0.0, v1.3.697) _ 0928

API 에러 코드 리스트

API 명세서 관련 참고 내용(토글)

<aside> 📌 관련 내용

설명 메서드 경로 JWT Content-Type request (body) response error code list
회원가입 POST /api/auth/signup multi-part/form-data; {
imageValue?: ‘이미지 파일(선택)’,

// API 명세 수정

nickname: ’별명’, email: ’이메일’, password: ’비밀번호’, nicknameVerifyToken: ’토큰값’, emailVerifyToken: ’토큰값’,

// 추가기능

favorCupSizeList: ‘355,473,591’, favorTemperatureList: ‘hot,ice’, favorCategoryList: ‘’,

disfavorCupsizeList: ‘’, disfavorTemperatureList: ‘’, disfavorCategoryList: ‘’ } | { isSuccess: true, message: '회원가입에 성공하셨습니다.', user: { userId: 123, email: ‘이메일’, nickname: ‘유저네임’, imageUrl: ‘이미지 경로’, recizedUrl: ‘리사이징 URL’, createdAt: ‘날자’, updatedAt: ‘날자’ } } | “AUTH-004”: “${email} 이메일 및 닉네임 인증 절차를 진행하지 않은 사용자입니다.” ”AUTH-005": “등록되지 않은 emailVerifyToken 입니다.” ”AUTH-006" “등록되지 않은 nicnameVerifyToken 입니다.” "AUTH-001-01”: “${email} 은 사용 중입니다.”,

| | | 로그인 | POST | /api/auth/signin | | application/x-www-form-urlencoded; | { email: ‘이메일’, password: ‘비밀번호’ } | { isSuccess: true, message: '로그인에 성공하셨습니다.', accessToken: ‘토큰’, refreshToken: ‘토큰’ } | ”AUTH-002”: “${email} 은 존재하지 않는 이메일입니다.” ”AUTH-003”: “${email} 와 일치하지 않는 비밀번호 입니다.”

| | | 로그아웃 | PATCH | /api/auth/logout**?refreshToken=** | | application/x-www-form-urlencoded; | | { isSuccess: true, message: '로그아웃에 성공하셨습니다.', } | ”AUTH-007-02”: “이미 탈퇴한 사용자의 RefreshToken 입니다.” | | | AccessToken 재발행 | GET | /api/auth/token**?refreshToken=** | | application/x-www-form-urlencoded; | - | { isSuccess: true, message: '토큰 재발행에 성공하셨습니다.', accessToken: ‘토큰’ } | ”AUTH-007-02”: “이미 탈퇴한 사용자의 RefreshToken 입니다.” ”AUTH-008”: “로그인 기록이 없는 사용자입니다.” ”AUTH-008”: “등록되지 않은 RefreshToken 입니다.” | | | 이메일 중복확인 후 인증 | PATCH

// API 명세 수정 // GET → PATCH | /api/auth/send-email | | application/x-www-form-urlencoded; | // API 명세 수정 { “email”: “이메일” } | { isSuccess: true, message: ‘사용자 이메일로 6자리 숫자가 발송되었습니다.’, date: new Date(), exceededDate: { lastSentDate: ‘최종 메일 발송일자’, accessibleDate: ‘재사용 가능 일자’ /* 형태는 2022년 10월 3일 처럼*/ } }

{ isSuccesss: false, message: ‘이미 사용 중인 이메일입니다.’ } | ”AUTH-001-01”: “${email} 은 이미 가입한 이메일입니다.” ”AUTH-004-EXP-01”: “사용자 이메일로 일일 이메일 제한 횟수 5회를 초과했어요!\n24 시간 뒤에 다시 신청해주세요!” 만료 에러의 경우, date, exceededDate 가 같이 갑니다. | | | 이메일에 도착한 숫자 확인 | PATCH

// API 명세 수정 // GET → PATCH | /api/auth/confirm-email | | application/x-www-form-urlencoded; | // API 명세 수정 // email-verify-code → emailVerifyCode { “email”: ”이메일”, “emailVerifyCode”: ”12346” } | { isSuccess: true, message: ‘사용자 이메일 인증이 완료되었습니다.’, emailVerifyToken: ‘토큰’, }

{ isSuccess: false, message: ‘인증번호가 틀렸습니다.’ } | ”AUTH-001-01”: “${email} 은 이미 가입한 이메일입니다.” "AUTH-004-01”: “${email} 은 인증번호 발송 과정이 진행되지 않았습니다.” ”AUTH-004-02”: “인증 번호가 틀렸습니다.” | | | 닉네임 중복확인 | PATCH

// API 명세 수정 // GET → PATCH | /api/auth/confirm-nickname | | application/x-www-form-urlencoded; | // API 명세 수정 { “emailVerifyToken”: ”토큰값”, “nickname”: ”닉네임” } | { isSuccess: true, message: ‘사용자 닉네임 중복확인이 완료되었습니다.’, nicknameVerifyToken: ‘토큰’, } | ”AUTH-001-02”: “${nickname} 은 이미 가입한 닉네임입니다.” ”AUTH-004-03”: "${nickname} 은 다른 사람이 중복 확인 중인 닉네임입니다.” ”AUTH-004-01”: ”${.email} 은 인증번호 발송 과정이 진행되지 않았습니다.” ”AUTH-004-4”: “${email} 은 인증번호 확인 과정이 진행되지 않았습니다.” | | | 비밀번호 초기화 용 이메일 발송 | PATCH

// API 명세 수정 // GET → PATCH | /api/auth/send-password | | application/x-www-form-urlencoded; | // API 명세 수정 { “email”: ”이메일” } | { isSuccess: true, message: ‘임시 비밀번호가 이메일로 발송되었습니다.’, date: new Date(), exceededDate: { lastSentDate: ‘최종 메일 발송일자’, accessibleDate: ‘재사용 가능 일자’ /* 형태는 2022년 10월 3일 처럼*/ } } | ”AUTH-002”: “${email} 은 존재하지 않는 이메일입니다.” ”AUTH-004-EXP-02”: “사용자 이메일로 일일 이메일 제한 횟수 5회를 초과했어요!\n24 시간 뒤에 다시 신청해주세요!”만료 에러의 경우, date, exceededDate 가 같이 갑니다. | | | 이메일 에 있는 버튼 클릭 시 비밀번호 초기화 | PATCH

// API 명세 수정 // GET → PATCH | /api/auth/reset-password | | application/x-www-form-urlencoded; | // API 명세 수정 { “resetPasswordToken”: ”이메일” } | redirect 302 → frotend_url/signIn?email=

→ 변경(2022-10-17)

{ isSuccess: true, message: ‘임시 비밀번호로 변경이 완료 되었습니다.’, accessToken: ‘토큰’, refreshToken: ‘토큰’ } | ”AUTH-001-02”: “${email} 은 존재하지 않는 이메일입니다.” | | | 프로필 조회 | GET | /api/profile/my-profile | O | application/json; | - | { isSuccess: true, message: '프로필 조회에 성공하셨습니다.', user: { userId: 123456, nickname: ‘유저 닉네임’, email: ‘유저 이메일’, imageUrl: ‘이미지 경로’, resizedUrl: ‘이미지 경로’ } } | - | | | 프로필 수정 | PATCH | /api/profile | O | application/json; | { imageValue: ‘변경할-이미지-파일(선택)’,

// API 명세 수정 nickname: "변경할-별명", password: "변경할-비밀번호",

// 추가기능

favorCupSizeList: '355,473,591’ favorTemperatureList: ‘hot,ice’, favorCategoryList: ’’,

disfavorCupsizeList: ‘’, disfavorTemperatureList: ‘’, disfavorCategoryList: ‘’ } | { isSuccess: true, message: '프로필 수정에성공하셨습니다..', userId: 123456 } | ”AUTH-007-02”: “이미 탈퇴한 사용자의 RefreshToken 입니다.” | | | 내가 업로드 한 레시피 조회 페이지네이션 O, 3 개 씩 | GET | /api/profile/my-recipe**?page=&count=** | O | application/json; | - | { isSuccess: true, message: '레시피 조회에성공하셨습니다.’, recipeList: [{ recipeId: 123456, title: ‘레시피 이름’, content: ‘레시피 본문', isIced: boolean, cupSize: 355 | 473 | 591, createdAt: ‘2022-’, updatedAt: ‘2022-’, nickname: ‘작성자 이름’, imageUrl: ‘작성자 프로필 이미지’, resizedUrl: ‘작성자 프로필 이미지’, isLiked: boolean,
commentTotal: number, 22-10-03 윤승근 likeTotal: number,
ingredientList: [{ ingredientName: ‘음식 재료 이름’, ingredientColor: ‘#123456’, ingredientAmount: 100 }] }] } | ”AUTH-007-02”: “이미 탈퇴한 사용자의 RefreshToken 입니다.” | | | 내가 좋아요 한 레시피 조회 페이지네이션 O, 3 개 씩 | GET | /api/profile/like-reciipe**?page=&count=** | O | application/json; | - | 위와 동일 | “AUTH-007-01”: “이미 탈퇴한 사용자의 AccessToken 입니다” | | | 내 뱃지 조회하기 (이것 아님!) | GET | /api/bedge | O | application/json; | | { isSuccess: true, message: ‘내 뱃지가 조회되었습니다.’, badgeList: [{ name: ‘뱃지 이름’, createdAt: ‘12312321321’ }] } | | | | 내 뱃지 조회 ‣ | GET | /api/bedge | O | application/json; | | { isSucccess: true, message: ‘뱃지 조회에 성공하셨습니다.’, badgeList: [{ name: ‘뱃지 A’ }, { name: ‘뱃지 B’ }] } | “AUTH-007-01”: “이미 탈퇴한 사용자의 AccessToken 입니다” | | | 이번주 인기 레시피 조회 (기준은 좋아요) 페이지네이션 X , 3 개만!! | GET | /api/ranking/weekly-recipe | | application/json; | - | { isSuccess: true, message: '레시피 조회에성공하셨습니다.’, recipeList: [{ recipeId: 123456, title: ‘레시피 이름’, content: ‘레시피 본문', isIced: boolean, cupSize: 355 | 473 | 591, createdAt: ‘2022-’, updatedAt: ‘2022-’, nickname: ‘작성자 이름’, imageUrl: ‘작성자 프로필 이미지’, resizedUrl: ‘작성자 프로필 이미지’, isLiked: boolean, likeTotal: 좋아요 개수(number) ingredientList: [{ ingredientName: ‘음식 재료 이름’, ingredientColor: ‘#123456’, ingredientAmount: 100 }] }], categoryList: [”카테고리A”, “카테고리B”] } | - | | | 레시피 조회 페이지네이션 O, 12 / 6 개 씩 | GET | /api/recipes**?page=&count=&favorCupSizeList=&favorTemperatureList=&favorIngredientList=** | | application/json; | page=1 count=12 page=2 count=6 >>> page=3 count=6 >>> | 위와 동일 | - | | | 레시피 작성 | POST | /api/recipes

컵 사이즈 변경 시, ingredientList 가 다 비워짐 | O | application/json; | { title: ‘레시피 이름’, content: ‘레시피 본문', isIced: boolean, isPublic: boolean, cupSize: 355 | 473 | 591, category: [ ‘카테고리A’, ‘카테고리B’ ] ingredientList: [{ ingredientName: ‘음식 재료 이름’, ingredientColor: ‘#123456’, ingredientAmount: 123 }] } | { isSuccess: true, message: '레시피 등록에 성공하셨습니다.’, recipeId: 123456 } | “AUTH-007-01”: “이미 탈퇴한 사용자의 AccessToken 입니다” | | | 레시피 상세 조회 | GET | /api/recipes/:recipeId | | application/json; | - | { isSuccess: true, message: '레시피 조회에성공하셨습니다.’, recipe: { recipeId: 123456, nickname: “닉네임”, imageUrl: “이미지 주소”, resizedUrl: “리사이징 주소”, title: ‘레시피 이름’, content: ‘레시피 본문', isIced: boolean, cupSize: 355 | 473 | 591, createdAt: ‘2022-’, updatedAt: ‘2022-, isLiked: boolean, 2022-09-24 추가 윤승근 ingredientList: [{ ingredientName: ‘음식 재료 이름’, ingredientColor: ‘#123456’, ingredientAmount: 100 }] } } | ”RECIPE-001”: “존재하지 않는 레시피입니다.” | | | 레시피 수정 | PUT | /api/recipes/:recipeId

컵 사이즈 변경 불가능 | O | application/json; | { title: ‘레시피 이름’, content: ‘레시피 본문', isIced: boolean, isPublic: boolean, category: [ ‘카테고리A’, ‘카테고리B’ ] ingredientList: [{ ingredientName: ‘음식 재료 이름’, ingredientColor: ‘#123456’, ingredientAmount: 100 }] } | { isSuccess: true, message: '레시피 수정에 성공하셨습니다.’, recipeId: 123456 } | “AUTH-007-01”: “이미 탈퇴한 사용자의 AccessToken 입니다” ”RECIPE-001”: “존재하지 않는 레시피입니다.” ”RECIPE-002”: “내가 작성한 레시피가 아닙니다.” | | | 레시피 삭제 | DEL | /api/recipes/:recipeId | O | application/json; | | { isSuccess: true, message: '레시피 삭제에 성공하셨습니다.’ } | “AUTH-007-01”: “이미 탈퇴한 사용자의 AccessToken 입니다” ”RECIPE-001”: “존재하지 않는 레시피입니다.” ”RECIPE-002”: “내가 작성한 레시피가 아닙니다.” | | | 레시피 좋아요 반영 | PATCH | /api/recipes/:recipeId/like | O | application/json; | - | { isSuccess: true, message: '좋아요에 성공하셨습니다.’ } | “AUTH-007-01”: “이미 탈퇴한 사용자의 AccessToken 입니다” ”RECIPE-001”: “존재하지 않는 레시피입니다.” “RECIPE-003-01”: “이미 좋아요를 한 레시피입니다.” | | | 레시피 좋아요 취소 | PATCH | /api/recipes/:recipeId/dislike | O | application/json; | - | { isSuccess: true, message: '좋아요 취소에 성공하셨습니다.’ } | “AUTH-007-01”: “이미 탈퇴한 사용자의 AccessToken 입니다” ”RECIPE-001”: “존재하지 않는 레시피입니다.” “RECIPE-003-02”: “좋아요를 하지 않은 레시피입니다.” | | | (레시피) 댓글 전체 조회 | GET | /api/comments?recipeId=1234&page=1&count=10 | X | application/json; | | { isSuccess: true, message: '댓글 전체 조회에 성공했습니다.', commentList: [{ userId: 1234, nickname: '유저 닉네임', userImageUrl: "http://",
userResizedUrl: "리사이징 URL",
recipeId: 1234, commentId: 12354, imageUrl: 'http://', recizedUrl: ‘리사이징 URL’, comment: '이것은 댓글입니다.', createdAt: '2022-08~~' // Date 양식 updatedAt: '2022-08~~' // Date 양식 }] } | ”RECIPE-001”: “존재하지 않는 레시피입니다.” | | | (레시피) 댓글 작성 | POST | /api/comments?recipeId=1234 | O | multi-part/form-data; | { imageValue: ‘변경할-이미지-파일(선택)’, // API 명세 수정

comment: ‘댓글 내용’ } | { isSuccess: true, message: '댓글 작성에 성공하였습니다.', comment: { userId: 1234, nickname: '유저 닉네임', recipeId: 1234, commentId: 12354, imageUrl: 'http://', recizedUrl: ‘리사이징 URL’, comment: '이것은 댓글입니다.', createdAt: '2022-08~~' // Date 양식 updatedAt: '2022-08~~' // Date 양식 } } | “AUTH-007-01”: “이미 탈퇴한 사용자의 AccessToken 입니다” ”RECIPE-001”: “존재하지 않는 레시피입니다.” | | | (레시피) 댓글 수정 | PUT | /api/comments/:commentId | O | multi-part/form-data; | { imageValue: ‘변경할-이미지-파일(선택)’, // API 명세 수정

comment: ‘댓글 내용’ } | { isSuccess: true, message: '댓글 수정에 성공하였습니다.', comment: { userId: 1234, nickname: '유저 닉네임', userImageUrl: “http.//”, userResizedUrl: “리사이징 URL”, recipeId: 1234, commentId: 12354, imageUrl: 'http://', resizedUrl: ‘리사이징 URL’, comment: '이것은 댓글입니다.', createdAt: '2022-08~~' // Date 양식 updatedAt: '2022-08~~' // Date 양식 } } | “AUTH-007-01”: “이미 탈퇴한 사용자의 AccessToken 입니다” “COMMENT-001”: “존재하지 않는 코멘트입니다.” ”COMMENT-002”: “내가 작성한 코멘트가 아닙니다.” | | | (레시피) 댓글 삭제 | DELETE | /api/comments/:commentId | X | application/json; | - | { isSuccess: true, message: '댓글 삭제에 성공하였습니다.' } | “AUTH-007-01”: “이미 탈퇴한 사용자의 AccessToken 입니다” “COMMENT-001”: “존재하지 않는 코멘트입니다.” ”COMMENT-002”: “내가 작성한 코멘트가 아닙니다.” | | | | | | | | | | | | | | | | | | | | | |

API 명세서

API 명세 질의사항 (1차 피드백 준비)