템플릿 디자인 단건조회
템플릿 디자인 단건 조회 (GET)
특정 인증서 템플릿 디자인을 조회합니다.
-
Method:
GET
-
URL:
/certificate-designs/{certificateDesignId}
-
Path Parameters:
파라미터 타입 필수 설명 certificateDesignId number Yes 조회할 템플릿 디자인의 고유 ID
Response
{
"statusCode": 200,
"message": "템플릿 디자인이 상세 조회되었습니다.",
"certificateDesign": {
"id": 165,
"name": "sandbox-certificate-v1",
"main_color": "#7657FA",
"sub_color": "#CABDFF",
"extra_color_1": null,
"extra_color_2": null,
"template_type": "NewCertificateType7Single",
"created_at": "2025-04-09T18:37:39.696Z",
"updated_at": "2025-04-09T18:37:39.696Z",
"club": {
"domain": "sandbox",
"customData": [...]
}
}
}
certificateDesign (object)
필드명 | 타입 | 설명 |
---|---|---|
id | number | certificate 디자인 고유 id |
name | string | certificate 디자인 이름 |
main_color | string | null | certificate 디자인 메인 색상 |
sub_color | string | null | certificate 디자인 서브 색상 |
extra_color_1 | string | null | certificate 디자인 추가 색상1 |
extra_color_2 | string | null | certificate 디자인 추가 색상2 |
layout_json | object[] | 인증서 이미지 생성을 위한 디자인 JSON 배열 |
template_type | string | certificate 디자인 템플릿 타입 |
created_at | string (ISO8601) | certificate 디자인 생성일 |
updated_at | string (ISO8601) | certificate 디자인 수정일 |
certificateDesign.club (object)
필드명 | 타입 | 설명 |
---|---|---|
domain | string | 클럽의 도메인 |
customData | array | 클럽이 정의한 커스텀 데이터 목록 |
customData[].attribute_name | string | 커스텀 데이터 이름 |
customData[].attribute_tag | string | 커스텀 데이터 태그 |
오류 코드
상태 코드 | 에러 | 메시지 | 상세 설명 |
---|---|---|---|
400 | BadRequest | 잘못된 요청입니다. | 허가되지 않은 값, 올바르지 않은 형식의 요청 |
401 | Unauthorized | Invalid token | 인증 정보가 올바르지 않은 경우 |
404 | CertificateDesignNotFound | 템플릿 디자인을 찾을 수 없습니다. | 해당 클럽 도메인의 디자인 데이터가 없을 경우 |
500 | InternalServerError | 예기치 않은 오류가 발생했습니다. | 서버 에러 |
Request Sample
- Java
- JavaScript
- Python
- Shell
- Unirest
- OkHttp
String url = "https://api.test.kolleges.net/open-api/certificate-designs/" + certificateDesignId;
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 baseUrl = "https://api.test.kolleges.net/open-api/certificate-designs/" + certificateDesignId;
String url = baseUrl;
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();
}
- XMLHttpRequest
- HTTP
- Axios
- Fetch
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
const baseUrl = `https://api.test.kolleges.net/open-api/certificate-designs/${certificateDesignId}`;
const url = baseUrl;
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 https = require("https");
const options = {
method: "GET",
hostname: "api.test.kolleges.net",
path: `/open-api/certificate-designs/${certificateDesignId}`,
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();
const axios = require("axios");
const url = `https://api.test.kolleges.net/open-api/certificate-designs/${certificateDesignId}`;
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 fetch = require("node-fetch");
const url = `https://api.test.kolleges.net/open-api/certificate-designs/${certificateDesignId}`;
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));
- Requests
import requests
url = f"https://api.test.kolleges.net/open-api/certificate-designs/{certificateDesignId}"
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://api.test.kolleges.net/open-api/certificate-designs/${certificateDesignId}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer $API_KEY"