REST API Reference

REST API 사용에 필요한 공통 규칙, 응답 모델, 엔드포인트별 예제를 제공합니다.

1. Overview

1.1. 공통 헤더 정보

Header Description Mandatory Example

Authorization

인증 토큰 (액세스 토큰)

N

Bearer 4B561A51-7773-4CA4-8E67-851EF4E85145

Request-Id

요청 식별 ID

N

c64af254-d067-475c-b4ce-15a6f0a73f99

1.2. API 응답 모델

Success
Path Type Mandatory Description

ok

Boolean

Y

성공(true), 실패(false)

result

Object

N

API 결과

Success Example
HTTP/1.1 200 OK
Content-Type: application/json

{
  "ok": true,
  "result": {
    "key": "value"
  }
}
Error
Path Type Mandatory Description

ok

Boolean

Y

성공(true), 실패(false)

error

Object

Y

에러 정보

error.code

String

Y

에러 코드 (에러 코드 문서 참고)

error.message

String

Y

사용자에게 노출 가능한 에러 메시지

error.details

Array<Object>

N

에러 상세 목록 (디버그용)

error.details[].field

String

Y

필드명

error.details[].reason

String

Y

에러 설명

Internal Server Error
HTTP/1.1 500 Internal Server Error
Content-Type: application/json

{
  "ok": false,
  "error": {
    "code": "internal_error",
    "message": "일시적인 오류가 발생했습니다. 잠시 후 다시 시도해 주세요."
  }
}
Invalid Arguments
HTTP/1.1 400 Bad Request
Content-Type: application/json

{
  "ok": false,
  "error": {
    "code": "invalid_arguments",
    "message": "입력한 내용을 다시 확인해 주세요.",
    "details": [
      {
        "field": "title",
        "reason": "Title must not be blank"
      },
      {
        "field": "content",
        "reason": "Content size must be between 0 and 500"
      }
    ]
  }
}

1.3. 공통 에러 코드

모든 API에서 공통적으로 발생할 수 있는 에러 목록입니다.
각 API별로 발생할 수 있는 에러 정보는 각 API의 에러 코드 문서를 참고해주세요.

Status Code Error Code Message Description

400

invalid_arguments

입력한 내용을 다시 확인해 주세요.

필수 파라미터가 없거나, 파라미터가 유효하지 않는 경우

401

invalid_auth_token

인증이 필요합니다.

인증 토큰이 없거나 유효하지 않은 경우

401

token_expired

인증이 만료되었습니다. 다시 로그인해 주세요.

인증 토큰이 만료된 경우 (액세스 토큰 갱신 필요)

500

internal_error

일시적인 오류가 발생했습니다. 잠시 후 다시 시도해 주세요.

서버 내부적으로 문제 발생 시

503

service_unavailable

현재 서비스를 이용할 수 없습니다. 잠시 후 다시 시도해 주세요.

현재 서비스를 이용할 수 없는 경우

2. APIs

2.1. Common APIs

2.1.1. Health Check

서버가 요청을 처리할 준비가 되었는지 확인하는 API입니다.

GET /api/health

Response Fields
Path Type Mandatory Description Etc

ok

Boolean

true

API 처리 성공 여부

Examples
HTTP Request
GET /api/health HTTP/1.1
Host: dev.api.jobdori.o-r.kr
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 17

{
  "ok" : true
}
Curl
$ curl 'http://dev.api.jobdori.o-r.kr/api/health' -i -X GET
Error Codes

공통 에러 코드는 공통 에러 코드를 참고해 주세요.

HTTP Status Code 메시지 설명

503

service_unavailable

현재 서비스를 이용할 수 없습니다. 잠시 후 다시 시도해 주세요.

서비스 상태가 아닌 경우 발생합니다

2.2. Auth APIs

2.2.1. 로그인

가입된 유저는 로그인하고, 미가입 유저는 자동 가입 후 로그인하는 API입니다.

POST /api/v1/auth/login

Request Fields
Path Type Mandatory Description Etc

provider

String

true

인증 제공자

GOOGLE

authorizationCode

String

true

OAuth 인가 코드

redirectUri

String

true

OAuth 리다이렉트 URI

Response Fields
Path Type Mandatory Description Etc

ok

Boolean

true

API 처리 성공 여부

result.isNewUser

Boolean

true

신규 가입 여부

result.accessToken

String

true

Access 토큰

result.refreshToken

String

true

Refresh 토큰

Response Headers
Header Mandatory Description Etc

Set-Cookie

true

access_token, refresh_token 쿠키

Examples
HTTP Request
POST /api/v1/auth/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 138
Host: dev.api.jobdori.o-r.kr

{
  "provider" : "GOOGLE",
  "authorizationCode" : "authorization-code",
  "redirectUri" : "http://dev.api.jobdori.o-r.kr/auth/callback"
}
Curl
$ curl 'http://dev.api.jobdori.o-r.kr/api/v1/auth/login' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "provider" : "GOOGLE",
  "authorizationCode" : "authorization-code",
  "redirectUri" : "http://dev.api.jobdori.o-r.kr/auth/callback"
}'
HTTP Response
HTTP/1.1 200 OK
Set-Cookie: access_token=access-token; Path=/; Max-Age=108287707; Expires=Tue, 1 Jan 2030 00:30:00 GMT; Secure; HttpOnly; SameSite=None
Set-Cookie: refresh_token=refresh-token; Path=/; Max-Age=109495507; Expires=Tue, 15 Jan 2030 00:00:00 GMT; Secure; HttpOnly; SameSite=None
Content-Type: application/json
Content-Length: 135

{
  "ok" : true,
  "result" : {
    "accessToken" : "access-token",
    "refreshToken" : "refresh-token",
    "isNewUser" : false
  }
}
Error Codes

공통 에러 코드는 공통 에러 코드를 참고해 주세요.

HTTP Status Code 메시지 설명

400

invalid_authorization_code

인증 코드가 올바르지 않습니다.

유효하지 않은 OAuth 인증 코드인 경우

2.2.2. 액세스 토큰 갱신

Refresh 토큰으로 새로운 Access 토큰을 발급하는 API입니다.

Access 토큰 만료로 token_expired 에러가 발생한 경우 호출해서 신규 액세스 토큰을 발급합니다.

POST /api/v1/auth/refresh

Request Cookies
Cookie Mandatory Description Etc

refresh_token

true

Refresh 토큰

Response Fields
Path Type Mandatory Description Etc

ok

Boolean

true

API 처리 성공 여부

result.accessToken

String

true

Access 토큰

Response Headers
Header Mandatory Description Etc

Set-Cookie

true

access_token 쿠키

Examples
HTTP Request
POST /api/v1/auth/refresh HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: dev.api.jobdori.o-r.kr
Cookie: refresh_token=refresh-token
Curl
$ curl 'http://dev.api.jobdori.o-r.kr/api/v1/auth/refresh' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    --cookie 'refresh_token=refresh-token'
HTTP Response
HTTP/1.1 200 OK
Set-Cookie: access_token=new-access-token; Path=/; Max-Age=108287706; Expires=Tue, 1 Jan 2030 00:30:00 GMT; Secure; HttpOnly; SameSite=None
Content-Type: application/json
Content-Length: 76

{
  "ok" : true,
  "result" : {
    "accessToken" : "new-access-token"
  }
}

2.2.3. 로그아웃

로그아웃 API입니다.

POST /api/v1/auth/logout

Request Cookies
Cookie Mandatory Description Etc

refresh_token

true

Refresh 토큰

Response Fields
Path Type Mandatory Description Etc

ok

Boolean

true

API 처리 성공 여부

Response Headers
Header Mandatory Description Etc

Set-Cookie

true

만료된 access_token, refresh_token 쿠키

Examples
HTTP Request
POST /api/v1/auth/logout HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: dev.api.jobdori.o-r.kr
Cookie: refresh_token=refresh-token
Curl
$ curl 'http://dev.api.jobdori.o-r.kr/api/v1/auth/logout' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    --cookie 'refresh_token=refresh-token'
HTTP Response
HTTP/1.1 200 OK
Set-Cookie: access_token=; Path=/; Max-Age=0; Expires=Thu, 1 Jan 1970 00:00:00 GMT; Secure; HttpOnly; SameSite=None
Set-Cookie: refresh_token=; Path=/; Max-Age=0; Expires=Thu, 1 Jan 1970 00:00:00 GMT; Secure; HttpOnly; SameSite=None
Content-Type: application/json
Content-Length: 17

{
  "ok" : true
}

2.2.4. 회원 탈퇴

인증된 사용자의 계정을 탈퇴 처리하는 API입니다.

DELETE /api/v1/auth/withdrawal

Request Headers
Name Description

Authorization

Bearer 액세스 토큰

Response Fields
Path Type Mandatory Description Etc

ok

Boolean

true

API 처리 성공 여부

Response Headers
Header Mandatory Description Etc

Set-Cookie

true

access_token, refresh_token 만료 쿠키

Examples
HTTP Request
DELETE /api/v1/auth/withdrawal HTTP/1.1
Authorization: Bearer access-token
Host: dev.api.jobdori.o-r.kr
Curl
$ curl 'http://dev.api.jobdori.o-r.kr/api/v1/auth/withdrawal' -i -X DELETE \
    -H 'Authorization: Bearer access-token'
HTTP Response
HTTP/1.1 200 OK
Set-Cookie: access_token=; Path=/; Max-Age=0; Expires=Thu, 1 Jan 1970 00:00:00 GMT; Secure; HttpOnly; SameSite=None
Set-Cookie: refresh_token=; Path=/; Max-Age=0; Expires=Thu, 1 Jan 1970 00:00:00 GMT; Secure; HttpOnly; SameSite=None
Content-Type: application/json
Content-Length: 17

{
  "ok" : true
}
Error Codes

공통 에러 코드는 공통 에러 코드를 참고해 주세요.

HTTP Status Code 메시지 설명

404

user_not_found

사용자를 찾을 수 없습니다.

유저를 찾을 수 없는 경우

2.3. Experience APIs

2.3.1. 파일 경험 불러오기 (PDF)

파일에서 경험을 가져오는 API입니다. (현재 지원되는 파일: PDF)

POST /api/v1/workspaces/{workspaceId}/experience-imports

Request Parts
Part Description

file

경험을 가져올 PDF 파일

Response Fields
Path Type Mandatory Description Etc

ok

Boolean

true

API 처리 성공 여부

Examples
POST /api/v1/workspaces/workspace-id/experience-imports HTTP/1.1
Content-Type: multipart/form-data;charset=UTF-8; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Authorization: Bearer access-token
Host: dev.api.jobdori.o-r.kr

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=resume.pdf
Content-Type: application/pdf

%PDF-1.4 sample
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 17

{
  "ok" : true
}
$ curl 'http://dev.api.jobdori.o-r.kr/api/v1/workspaces/workspace-id/experience-imports' -i -X POST \
    -H 'Content-Type: multipart/form-data;charset=UTF-8' \
    -H 'Authorization: Bearer access-token' \
    -F 'file=@resume.pdf;type=application/pdf'