인증서 단건 조회
단건 조회 (GET)
특정 인증서의 상세 정보를 조회합니다.
-
Method:
GET
-
URL:
/achievements/{achievementId}
-
URL Parameter:
achievementId
(number, 필수): 조회할 인증서의 고유 ID
Response
{
"statusCode": 200,
"message": "인증서가 조회되었습니다.",
"achievement": {
// 인증서 객체
}
}
achievement (object)
필드명 | 타입 | 설명 |
---|---|---|
id | number | 인증서의 고유 ID |
admin_comment | string | null | 관리자가 인증서에 남긴 코멘트 |
level | string | null | 인증서 레벨 |
nft_token | string | null | NFT로 발행된 경우, NFT 토큰 정보 |
issuance_route | "manual" | "automatic" | 발급 경로 |
certificate_number | string | 인증서 고유 번호 |
course_begin_at | string (ISO8601) | null | 수강 시작 날짜 |
course_end_at | string (ISO8601) | null | 수강 종료 날짜 |
expiration_date | string (ISO8601) | null | 인증서 만료일 (null이면 영구 유효) |
is_received | boolean | 사용자가 인증서를 수령했는지 여부 |
status | "PREVIEW" | "ISSUED" | 인증서 상태 |
issuance_method | "EMAIL" | "PHONE" | 발급 방식 |
created_at | string (ISO8601) | 인증서 발급일 |
updated_at | string (ISO8601) | 인증서 마지막 수정일 |
user | user (object) | 유저정보 |
evidences | evidences (object) | 인증서 성과 정보 배열 |
achievementForm | achievementForm (object) | 인증서 양식 정보 |
achievement.user (object)
필드명 | 타입 | 설명 |
---|---|---|
string | 사용자 이메일 | |
name | string | 사용자 이름 |
avatar | string[] | 아바타 이미지 URL 배열 |
deleted_at | string | null | 계정 삭제 날짜 (null이면 가입 완료된 상태) |
image | string | null | 프로필 이미지 URL (직접 업로드한 이미지) |
profileImageType | "avatar" | "profile" | 프로필 이미지 타입 |
achievement.evidences (object)
필드명 | 타입 | 설명 |
---|---|---|
id | number | 성과 정보 고유 ID |
title | string | 사용자가 직접 입력한 제목 (없으면 file_name 사용) |
link | string | null | 외부 링크 (링크로 제출한 증빙 자료일 경우) |
file_name | string | null | 업로드된 PDF의 실제 파일 이름 |
file_url | string | null | Supabase에서 접근 가능한 전체 URL |
created_at | string (ISO8601) | 증빙 자료 업로드 일자 |
achievement.achievementForm (object)
필드명 | 타입 | 설명 |
---|---|---|
id | number | 인증서 양식의 고유 ID |
name | string | 인증서 양식 제목 |
description | string | 인증서 양식 설명 |
type | "completion" | "activity" | "license" | "career" | "award" | "recommendation" | "membership" | "degree" | 인증서 양식 타입 |
tags | string[] | 인증서 양식 관련 태그 |
prefix | string | 인증서 고유 번호 접두어 |
program_type | string | 프로그램 유형 |
program_name | string | 프로그램 이름 |
program_url | string | 프로그램 URL |
course_begin_at | string (ISO8601) | 강의 시작 날짜 |
course_end_at | string (ISO8601) | 강의 종료 날짜 |
created_at | string (ISO8601) | 인증서 양식 생성일 |
updated_at | string (ISO8601) | 인증서 양식 마지막 수정일 |
clubInstitutions | clubInstitutions (object[]) | 발급기관 정보 |
representativeInstitution | representativeInstitution (object) | 대표발급기관 정보 |
requirements | requirements (object[]) | 취득성과 정보 |
achievementCertificateDesign | achievementCertificateDesign (object) | certificate 디자인 정보 객체 |
achievementBadgeDesign | achievementBadgeDesign (object) | badge 디자인 정보 객체 |
achievement.achievementForm.clubInstitutions (object[])
필드명 | 타입 | 설명 |
---|---|---|
type | string | 기관 유형 (공공기관, 기업, 학교 등) |
name | string | 기관 이름 |
website_url | string | 기관 웹사이트 URL |
images | object[] | 기관 이미지 리스트 |
images[].path | string | 이미지 파일 URL |
images[].type | "club_symbol" | "sign_image" | "club_logo" | 이미지 타입 |
achievement.achievementForm.representativeInstitution (object)
필드명 | 타입 | 설명 |
---|---|---|
type | string | 대표 기관 유형 |
name | string | 대표 기관 이름 |
website_url | string | 대표 기관 웹사이트 URL |
images | object[] | 대표 기관 이미지 리스트 |
images[].path | string | 이미지 파일 URL |
images[].type | "club_symbol" | "sign_image" | "club_logo" | 이미지 타입 |
achievement.achievementForm.requirements (object[])
필드명 | 타입 | 설명 |
---|---|---|
type | "submit_homework" | "offline_meet" | "watch_video" | "live_meet" | "read" | "test" | "project" | "etc" | 취득 조건 타입 |
url | string | 관련 링크 |
description | string | 요구사항 설명 |
achievement.achievementForm.achievementCertificateDesign (object)
필드명 | 타입 | 설명 |
---|---|---|
id | number | certificate 디자인의 고유 ID |
name | string | 디자인 이름 |
main_color | string | null | 메인 색상 |
sub_color | string | null | 서브 색상 |
extra_color_1 | string | null | 보조 색상1 |
extra_color_2 | string | null | 보조 색상2 |
layout_json | object[] | 인증서 이미지 생성을 위한 디자인 JSON 배열 |
template_type | string | 사용된 템플릿 종류 |
created_at | string (ISO8601) | 디자인 생성일 |
updated_at | string (ISO8601) | 디자인 수정일 |
achievement.achievementForm.achievementBadgeDesign (object)
필드명 | 타입 | 설명 |
---|---|---|
id | number | badge 디자인의 고유 ID |
name | string | 디자인 이름 |
main_color | string | null | 메인 색상 |
sub_color | string | null | 서브 색상 |
extra_color_1 | string | null | 보조 색상1 |
extra_color_2 | string | null | 보조 색상2 |
layout_json | object[] | 인증서 이미지 생성을 위한 디자인 JSON 배열 |
template_type | string | 사용된 템플릿 종류 |
created_at | string (ISO8601) | 디자인 생성일 |
updated_at | string (ISO8601) | 디자인 수정일 |
오류 코드
상태 코드 | 에러 | 메시지 | 상세 설명 |
---|---|---|---|
400 | BadRequest | 잘못된 요청입니다. | 허가되지 않은 값, 올바르지 않은 형식의 요청 |
401 | Unauthorized | 인증 정보가 올바르지 않음 | 토큰 누락 또는 유효하지 않은 토큰 사용 |
404 | AchievementNotFound | 인증서를 찾을 수 없습니다. | 요청한 인증서 ID에 해당하는 리소스가 없음 |
500 | InternalServerError | 서버 오류 발생 | 예기치 않은 서버 내부 오류 |
Request Sample
- Java
- JavaScript
- Python
- Shell
- Unirest
- OkHttp
String url = "https://${baseURL}/open-api/achievements/" + achievementId;
HttpResponse<String> response = Unirest.get(url)
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("Authorization", "Bearer " + apiKey)
.asString();
System.out.println("Status: " + response.getStatus());
System.out.println("Response: " + response.getBody());
OkHttpClient client = new OkHttpClient();
String url = "https://${baseURL}/open-api/achievements/" + achievementId;
Request request = new Request.Builder()
.url(url)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Bearer " + apiKey)
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println("Status: " + response.code());
System.out.println("Response: " + response.body().string());
} catch (Exception e) {
e.printStackTrace();
}
- Axios
- XMLHttpRequest
- Fetch
- HTTP
const axios = require("axios");
const url = `https://api.test.kolleges.net/open-api/achievements/${achievementId}`;
axios
.get(url, {
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${apiKey}`,
},
})
.then((response) => {
console.log("Status:", response.status);
console.log("Response:", response.data);
})
.catch((error) => {
console.error(
"Error:",
error.response ? error.response.data : error.message
);
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
const url = `https://api.test.kolleges.net/open-api/achievements/${achievementId}`;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log("Response:", this.responseText);
}
});
xhr.open("GET", url);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("Authorization", "Bearer " + apiKey);
xhr.send();
const fetch = require("node-fetch");
const url = `https://api.test.kolleges.net/open-api/achievements/${achievementId}`;
fetch(url, {
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${apiKey}`,
},
})
.then((response) => {
console.log("Status:", response.status);
return response.json();
})
.then((data) => {
console.log("Response:", data);
})
.catch((error) => console.error("Error:", error));
const https = require("https");
const options = {
method: "GET",
hostname: "api.test.kolleges.net",
path: `/open-api/achievements/${achievementId}`,
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${apiKey}`,
},
};
const req = https.request(options, (res) => {
const chunks = [];
res.on("data", (chunk) => {
chunks.push(chunk);
});
res.on("end", () => {
const body = Buffer.concat(chunks).toString();
console.log("Status:", res.statusCode);
console.log("Response:", body);
});
});
req.on("error", (error) => {
console.error("Error:", error);
});
req.end();
- Requests
import requests
url = f"https://${baseURL}/open-api/achievements/{achievement_id}"
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": f"Bearer {api_key}"
}
response = requests.get(url, headers=headers)
print("Status:", response.status_code)
try:
print("Response:", response.json())
except Exception as e:
print("Response:", response.text)
- cURL
curl -X GET "https://${baseURL}/open-api/achievements/${achievementId}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer $API_KEY"