REST 인증 API

REST API 사용을 위한 기업 사용자 인증 API입니다.

API Endpoint

POST/v1/rest/auth
No AuthRequest: application/jsonResponse: */*

API 한눈에 보기

구현 전에 확인할 요청/응답 규모와 코드값 힌트입니다.

Samples included

Request Fields

2

Required Fields

2

Response Fields

9

Available Code Samples

cURL / fetch / Request / Response

구현 체크리스트 (Implementation Checklist)

인증 토큰 없이 호출하되, 응답으로 내려온 accessToken 쿠키를 저장합니다.

Content-Type과 lang 헤더를 실제 운영 환경에서도 동일하게 전달합니다.

운영 확인 항목

!요청 시각, path, HTTP status, errorCode를 로그에 보관합니다.

!개인정보 필드는 로그와 실패 알림에서 완벽히 마스킹 처리합니다.

!4xx 에러는 요청 데이터 자가 보정, 5xx 에러는 임시 지수 백오프 적용 대상으로 삼습니다.

Request Body

2 fields2 required

id

required
string

아이디

exampleasapapiuser

pw

required
string

비밀번호

exampleAsap1234!

Response

4 fields1 nested

success

boolean

API 성공 여부

exampletrue

message

string

전달 메세지

exampleAPI가 정상 처리되었습니다

errorCode

number

int32

에러 코드

example0

data

OBJECT하위 5

인증 API Response Data

example{}

이 필드는 객체 구조입니다. 하위 필드는 섹션에서 확인합니다.

Response

/

data

data 하위 필드

5 fields

인증 API Response Data

OBJECT

userType

number

int32

사용자 타입(1: 기업, 2: 일반)

example1

userId

number

int64

사용자 ID(인덱스)

example1

id

string

사용자 아이디

exampleasapapiuser

email

string

사용자 이메일

exampleasap@asapx.ai

name

string

이름

example홍길동

예시 코드 및 샘플

같은 요청을 cURL, JavaScript fetch, JSON 샘플로 확인할 수 있습니다.

curl -X POST "$BASE_URL/v1/rest/auth" \
  -H "Content-Type: application/json" -H "lang: ko" \
  -d '{"id":"asapapiuser","pw":"Asap1234!"}'
const response = await fetch(`${BASE_URL}/v1/rest/auth`, {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "lang": "ko"
  },
  "body": "{\"id\":\"asapapiuser\",\"pw\":\"Asap1234!\"}"
});

if (!response.ok) {
  const error = await response.json();
  throw new Error(`ASAP API error: ${response.status} ${error.message ?? ''}`);
}

const data = await response.json();
{
  "id": "asapapiuser",
  "pw": "Asap1234!"
}
{
  "success": true,
  "message": "API가 정상 처리되었습니다",
  "errorCode": 0,
  "data": {
    "userType": 1,
    "userId": 1,
    "id": "asapapiuser",
    "email": "asap@asapx.ai",
    "name": "홍길동"
  }
}