Skip to content

User Auth API

soyeon Park edited this page Nov 14, 2020 · 34 revisions

Base URL

http://54.82.105.93:8080

Sign up API

Request

  • url

    /v1/user/sign-up

  • method

    POST

  • header

    method parameter Description Required
    Content-Type application/json
  • request body

    {
        "userId": {{String}},
        "userName": {{String}},
        "email": {{String}},
        "accessToken": {{String}},
        "nickName": {{String}},
        "address": {{Long}},
        "category": [],
        "intro": {{Long}}
    }
    
    Field Type Description Example Required
    userId String 카카오톡에서 받아오는 유저 oauthId O
    userName String 카카오톡에서 받아오는 유저 이름 O
    email String 카카오톡에서 받아오는 유저 이메일 O
    accessToken String 로그인 토큰 O
    nickName String 유저 닉네임(중복X) O
    address Long 위치 O
    category List 관심 종목 O
    intro String 자기소개 O

Response

  • success response

    • header

      method parameter Description Required
      Authorization {{token}} access token O
    • body

      {
          "status": 200,
          "success": true,
          "message": "회원가입을 축하드립니다!\n운동플래닛과 건강한 운동생활을\n시작해보세요!"
      }
      
      Field Type Description Example Required
      status integer HTTP STATUS CODE 200 O
      success boolean 성공 여부 true O
      message String 회원가입 성공 메세지 O
  • fail response

    {
        "status":{{Integer}},
        "success": {{Boolean}},
        "responseType": {{String}},
        "message": {{String}}
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    responseType String 오류 실패 메세지 "USER_NOT_FOUND" O
    message String 오류 실패 메세지 "사용자를 찾을 수 없습니다" O
    status success message 상황
    404 false "USER_NOT_FOUND" "사용자를 찾을 수 없습니다"

Login API

Request

  • url

    /user/sign-in

  • method

    POST

  • header

    method parameter Description Required
    Content-Type application/json
  • request body

    {
        "userId": {{String}},
        "email": {{String}},
        "accessToken": {{String}},
        "nickName": {{String}}
    }
    
    Field Type Description Example Required
    userId String 카카오톡에서 받아오는 유저 oauthId O
    email String 카카오톡에서 받아오는 유저 이메일
    accessToken String 로그인 토큰 O
    nickName String 유저 닉네임(중복X)

Response

  • success response

    {
        "status": 200,
        "success": true,
        "message": "로그인 성공"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 200 O
    success boolean 성공 여부 true O
    message String 회원가입 성공 메세지 O
  • fail response

    {
        "status":{{Integer}},
        "success": {{Boolean}},
        "responseType": {{String}},
        "message": {{String}}
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    responseType String 오류 실패 메세지 "USER_NOT_FOUND" O
    message String 오류 실패 메세지 "사용자를 찾을 수 없습니다" O
    status success message 상황
    404 false "USER_NOT_FOUND" "사용자를 찾을 수 없습니다"
    401 false "INACTIVE_USER_FAIL" "회원 가입이 필요합니다."
    403 false "SUSPENDED_USER_FAIL" "신고로 정지된 사용자입니다."
    400 false "INVALID_REQUEST_BODY" "정확한 값을 Request Body에 담아서 요청하시기 바랍니다"
    400 false "INVALID_METHOD" "메소드 유형이 잘못 되었습니다."
    400 false "INVALID_METHOD" "메소드 유형이 잘못 되었습니다."
    500 false "INTERNAL_SERVER_ERROR" "서버 내부 오류"

Sign out API

Reqeust

  • url

    /v1/user/withdraw

  • method

    DELETE

  • header

    method parameter Description Required
    Authorization {{token}} access token O

Response

  • success response

    • body
      {
          "status": 200,
          "success": true,
          "message": "사용자 삭제 성공"
      }
      
    Field Type Description Example Required
    status integer HTTP STATUS CODE 200 O
    success boolean 성공 여부 true O
    message String 유저 삭제 성공 메세지 O
  • fail response

    • 글 번호 param이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "삭제할 사용자 번호가 필요합니다."
    }
    
    • 삭제 하고자 하는 사용자 아이디와 토큰의 아이디가 다른 경우
    {
        "status": 400,
        "success": false,
        "message": "본인의 아이디가 아닙니다."
    }
    
    • access token이 없는 경우
    {
        "status": 400,
        "success": false,
        "message": "토큰이 없습니다."
    }
    
    • 삭제된 사용자일 경우
    {
        "status": 400,
        "success": false,
        "message": "삭제된 사용자입니다."
    }
    
    • access token이 만료 되었을 경우/유효하지 않은 토큰인 경우
    {
        "status": 401,
        "success": false,
        "message": "access token refresh가 필요합니다."
    }
    
    • 서버 내부 오류
    {
        "status": 500,
        "success": false,
        "message": "서버 내부 오류"
    }
    
    Field Type Description Example Required
    status integer HTTP STATUS CODE 500 O
    success boolean 성공 여부 false O
    message String 서버 내부 오류 실패 메세지 O

Clone this wiki locally