템플릿 디자인 다건조회
템플릿 디자인 다건 조회 (GET)
인증서 템플릿 디자인 목록을 조회합니다.
-
Method:
GET
-
URL:
/certificate-designs
-
Query Parameters:
파라미터 타입 필수 기본값 설명 page
number No 1 조회할 페이지 번호 pageSize
number No 15 페이지 당 항목 수
Response
{
"statusCode": 200,
"message": "템플릿 디자인 리스트가 조회되었습니다.",
"certificateDesigns": [
{
"id": 123,
"name": "Template Design A",
"created_at": "2025-04-09T18:37:39.696Z",
"updated_at": "2025-04-09T18:37:39.696Z"
}
],
"totalPages": 5
}
certificateDesigns (object[])
필드명 | 타입 | 설명 |
---|---|---|
id | number | certificate 디자인 고유 id |
name | string | certificate 디자인 이름 |
created_at | string (ISO8601) | certificate 디자인 생성일 |
updated_at | string (ISO8601) | certificate 디자인 수정일 |
layout_json | object[] | 인증서 이미지 생성을 위한 디자인 JSON 배열 |
오류 코드
상태 코드 | 에러 | 메시지 | 상세 설명 |
---|---|---|---|
400 | BadRequest | Page must not be less than 1, Page must be a positive number | 페이지 타입이 올바르지 않은 경우 |
400 | BadRequest | PageSize must not be less than 1, PageSize must be a positive number | 페이지 사이즈 타입이 올바르지 않은 경우 |
401 | Unauthorized | Invalid token | 인증 정보가 올바르지 않은 경우 |
404 | CertificateDesignsNotFound | 템플릿 디자인 리스트를 찾을 수 없습니다. | 해당 클럽 도메인의 디자인 데이터가 없을 경우 |
500 | InternalServerError | 예기치 않은 오류가 발생했습니다. | 서버 에러 |
Request Sample
- Java
- JavaScript
- Python
- Shell
- Unirest
- OkHttp
String url = "https://api.test.kolleges.net/open-api/certificate-designs";
HttpResponse<String> response = Unirest.get(url + queryParams)
.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";
String url = baseUrl + queryParams;
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`;
const url = baseUrl + queryParams;
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${queryParams}`,
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`;
axios
.get(url + queryParams, {
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`;
fetch(url + queryParams, {
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 = "https://api.test.kolleges.net/open-api/certificate-designs"
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": f"Bearer {api_key}"
}
response = requests.get(url + queryParams, 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?page=1&pageSize=10" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer $API_KEY"