K-OTP

템플릿 상세

GET /v1/templates/{templateId}

GET https://api.k-otp.dev/v1/templates/{templateId}

개요

Returns one template including the variables schema that templateVariables must satisfy on POST /issue. code is always filled in by the server and must not be sent in templateVariables.

Requires an sk_ secret key; pk_ public keys are rejected with 403.

인증

허용 키필요 scope대체 허용 scope
sk_otp:templatesotp:read, *

파라미터

이름위치타입필수설명
templateIdpathstring예Template id from GET /v1/templates.

응답 (200)

Template detail.

필드타입필수설명
templateIdstring예
namestring예
channelSupport"alimtalk" | "sms"[]예Channels this template can be sent on.
bodystring예Message body; #{code} is replaced with the OTP and other #{variable} placeholders with templateVariables.
variablesobject예Variables accepted in templateVariables when issuing with this template.

오류 응답

모든 오류는 { defined, code, status, message, data? } 형태입니다. 자세한 내용은 오류를 참고하세요.

상태code설명
400BAD_REQUESTthe request failed input validation. message describes the first failing constraint.
401UNAUTHORIZEDthe Authorization: Bearer credential is missing, malformed, inactive, or rejected by introspection.
403FORBIDDENthe credential lacks otp:templates (or an accepted alias), or a pk_ public key was used. Public keys are limited to issue/verify.
404NOT_FOUNDno template with this templateId is available.
409CONFLICTthe request conflicts with the current state of the resource.
500INTERNAL_SERVER_ERRORunexpected server failure. Undefined errors (defined: false) use the same envelope.
503SERVICE_UNAVAILABLEcredential introspection or a downstream dependency is temporarily unavailable. Retry with backoff.

요청 예시

curl "https://api.k-otp.dev/v1/templates/otp_default_kr" \
  -H "Authorization: Bearer $KOTP_SECRET_KEY"

이 페이지의 내용