Skip to content

마이페이지 API

황종훈 edited this page Apr 27, 2021 · 2 revisions

Base URL

/user/mypage

마이페이지

Request

  • URL
    /

  • Method
    GET

  • Headers

{
   "access_token": "..."
}
Field Type Description Example Required
access_token String 액세스 토큰 ... O

Response

  • Success Body
{
  "result": {
    "type": "mypage",
    "status": 200,
    "message": "마이페이지 정보 조회 성공",
    "data": {
      "idx": 1,
      "name": "김상덕",
      "nickname": "무야호",
      "intro": "그만큼 신나신다는거지",
      "email": "[email protected]",
      "picture": "https://i.ytimg.com/vi/26MPGlwqiCk/maxresdefault.jpg",
      "platform": "google",
      "job": "앵귀리지"
    }
  },
  "error": null
}
Field Type Description Example Required
result.type String 데이터 타입 "mypage" O
result.status Integer HTTP status code 200 O
result.message String 결과 메시지 "마이페이지 정보 조회 성공"
result.data.idx Long 유저 인덱스 1 O
result.data.name String 유저 이름 "김상덕" O
result.data.nickname String 유저 별명 "무야호" O
result.data.intro String 유저 자기소개 "그만큼 신나신다는거지" O
result.data.email String 유저 이메일 "[email protected]" O
result.data.picture String 유저 이미지 URL "..." O
result.data.platform String 유저 가입 플랫폼 "google" O
result.data.job String 유저 직업 "앵귀리지" O
  • Fail Body
{
  "result": null,
  "error": {
    "type": "mypage",
    "status": 500,
    "message": "서버 내부 에러"
  }
}
Field Type Description Example Required
error.type String 데이터 타입 "mypage" O
error.status Integer HTTP status code 500 O
error.message String 결과 메시지 "서버 내부 에러"

마이페이지 일괄 수정

Request

  • URL
    /changeAll

  • Method
    POST

  • Headers

{
  "access_token": "..."
}
Field Type Description Example Required
access_token String 액세스 토큰 ... O
  • Body
{
  "nickname": "유야호",
  "intro": "그만큼 설정을 잘 잡으신다는거지",
  "picture": "https://cdn.gukjenews.com/news/photo/202103/2189917_2182810_5541.png",
  "job": "MC"
}
Field Type Description Example Required
nickname String 유저 별명 "유야호" O
intro String 유저 자기소개 "그만큼 설정을 잘 잡으신다는거지" O
picture String 유저 이미지 URL "..." O
job String 유저 직업 "MC" O

Response

  • Success Body
{
  "result": {
    "type": "mypage",
    "status": 200,
    "success": true,
    "message": "마이페이지 전체 수정 성공"
  },
  "error": null
}
Field Type Description Example Required
result.type String 데이터 타입 "mypage" O
result.status Integer HTTP status code 200 O
result.success Boolean 요청 성공 여부 false O
result.message String 결과 메시지 "닉네임을 입력해주세요"
  • Fail Body
{
  "result": null,
  "error": {
    "type": "mypage",
    "status": 500,
    "message": "서버 내부 에러"
  }
}
Field Type Description Example Required
error.type String 데이터 타입 "mypage" O
error.status Integer HTTP status code 500 O
error.message String 결과 메시지 "서버 내부 에러"

회원 탈퇴

Request

  • URL
    /withdraw

  • Method
    GET

  • Headers

{
   "access_token": "..."
}
Field Type Description Example Required
access_token String 액세스 토큰 ... O

Response

  • Success Body
{
  "result": {
    "type": "mypage",
    "status": 200,
    "success": true,
    "message": "회원 탈퇴 완료"
  },
  "error": null
}
Field Type Description Example Required
result.type String 데이터 타입 "mypage" O
result.status Integer HTTP status code 200 O
result.success Boolean 요청 성공 여부 false O
result.message String 결과 메시지 "회원 탈퇴 완료"
  • Fail Body
{
  "result": null,
  "error": {
    "type": "mypage",
    "status": 500,
    "message": "서버 내부 에러"
  }
}
Field Type Description Example Required
error.type String 데이터 타입 "mypage" O
error.status Integer HTTP status code 500 O
error.message String 결과 메시지 "서버 내부 에러"

마이페이지 닉네임 수정

Request

  • URL
    /changeNickname

  • Method
    POST

  • Headers

{
   "access_token": "..."
}
Field Type Description Example Required
access_token String 액세스 토큰 ... O
  • Body
{
  "nickname": "유야호"
}
Field Type Description Example Required
nickname String 유저 별명 "유야호" O

Response

  • Success Body
{
  "result": {
    "type": "mypage",
    "status": 200,
    "success": true,
    "message": "마이페이지 닉네임 수정 성공"
  },
  "error": null
}
Field Type Description Example Required
result.type String 데이터 타입 "mypage" O
result.status Integer HTTP status code 200 O
result.success Boolean 요청 성공 여부 false O
result.message String 결과 메시지 "닉네임을 입력해주세요"
  • Fail Body
{
  "result": null,
  "error": {
    "type": "mypage",
    "status": 500,
    "message": "서버 내부 에러"
  }
}
Field Type Description Example Required
error.type String 데이터 타입 "mypage" O
error.status Integer HTTP status code 500 O
error.message String 결과 메시지 "서버 내부 에러"

마이페이지 자기소개 수정

Request

  • URL
    /changeIntro

  • Method
    POST

  • Headers

{
  "access_token": "..."
}
Field Type Description Example Required
access_token String 액세스 토큰 ... O
  • Body
{
  "intro": "그만큼 설정을 잘 잡으신다는거지"
}
Field Type Description Example Required
intro String 유저 자기소개 "그만큼 설정을 잘 잡으신다는거지" O

Response

  • Success Body
{
  "result": {
    "type": "mypage",
    "status": 200,
    "success": true,
    "message": "마이페이지 자기소개 수정 성공"
  },
  "error": null
}
Field Type Description Example Required
result.type String 데이터 타입 "mypage" O
result.status Integer HTTP status code 200 O
result.success Boolean 요청 성공 여부 false O
result.message String 결과 메시지 "자기소개를 입력해주세요"
  • Fail Body
{
  "result": null,
  "error": {
    "type": "mypage",
    "status": 500,
    "message": "서버 내부 에러"
  }
}
Field Type Description Example Required
error.type String 데이터 타입 "mypage" O
error.status Integer HTTP status code 500 O
error.message String 결과 메시지 "서버 내부 에러"

마이페이지 프로필 사진 수정

Request

  • URL
    /changePicture

  • Method
    POST

  • Headers

{
  "access_token": "..."
}
Field Type Description Example Required
access_token String 액세스 토큰 ... O
  • Body
{
  "picture": "https://cdn.gukjenews.com/news/photo/202103/2189917_2182810_5541.png"
}
Field Type Description Example Required
picture String 유저 이미지 URL "..." O

Response

  • Success Body
{
  "result": {
    "type": "mypage",
    "status": 200,
    "success": true,
    "message": "마이페이지 프로필 사진 수정 성공"
  },
  "error": null
}
Field Type Description Example Required
result.type String 데이터 타입 "mypage" O
result.status Integer HTTP status code 200 O
result.success Boolean 요청 성공 여부 false O
result.message String 결과 메시지 "마이페이지 프로필 사진 수정 성공"
  • Fail Body
{
  "result": null,
  "error": {
    "type": "mypage",
    "status": 500,
    "message": "서버 내부 에러"
  }
}
Field Type Description Example Required
error.type String 데이터 타입 "mypage" O
error.status Integer HTTP status code 500 O
error.message String 결과 메시지 "서버 내부 에러"

마이페이지 직업 수정

Request

  • URL
    /changeJob

  • Method
    POST

  • Headers

{
  "access_token": "..."
}
Field Type Description Example Required
access_token String 액세스 토큰 ... O
  • Body
{
  "job": "MC"
}
Field Type Description Example Required
job String 유저 직업 "MC" O

Response

  • Success Body
{
  "result": {
    "type": "mypage",
    "status": 200,
    "success": true,
    "message": "마이페이지 직업 수정 성공"
  },
  "error": null
}
Field Type Description Example Required
result.type String 데이터 타입 "mypage" O
result.status Integer HTTP status code 200 O
result.success Boolean 요청 성공 여부 false O
result.message String 결과 메시지 "직업을 입력해주세요"
  • Fail Body
{
  "result": null,
  "error": {
    "type": "mypage",
    "status": 500,
    "message": "서버 내부 에러"
  }
}
Field Type Description Example Required
error.type String 데이터 타입 "mypage" O
error.status Integer HTTP status code 500 O
error.message String 결과 메시지 "서버 내부 에러"