인증서 다건조회
다건 조회 (GET)
인증서 목록을 조회합니다.
-
Method:
GET
-
URL:
/achievements
-
Query Parameters:
파라미터 타입 필수 설명 page
number No 조회할 페이지 번호 (기본: 1) pageSize
number No 페이지 당 항목 수 (기본: 15) search
string No 사용자 이름, 이메일, 인증서 폼 이름 대상 검색어 startDate
string (ISO8601) No 조회 시작일 endDate
string (ISO8601) No 조회 종료일
Response
{
"statusCode": 200,
"message": "인증서 목록이 조회되었습니다.",
"achievements": [인증서 데이터 객체],
"totalPages": 1
}
achievements (object[])
필드명 | 타입 | 설명 |
---|---|---|
id | number | 인증서의 고유 ID |
certificate_number | string | 인증서 고유 번호 |
expiration_date | string | null (ISO8601) | 인증서 만료일 (없다면 영구 유효) |
is_received | boolean | 사용자가 인증서를 수령했는지 여부 |
issuance_method | "EMAIL" | "PHONE" | 발급 방식 |
created_at | string (ISO8601) | 인증서 발급일 |
updated_at | string (ISO8601) | 인증서 마지막 수정일 |
user | user (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.achievementForm (object[])
필드명 | 타입 | 설명 |
---|---|---|
id | number | 인증서 양식의 고유 ID |
name | string | 인증서 제목 |
achievementBadgeDesign | achievementBadgeDesign (object) |
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 | Page must be a positive number | 페이지 번호가 양의 정수가 아닌 경우 |
400 | BadRequest | Page must not be less than 1 | 페이지 번호가 1보다 작을 경우 |
400 | BadRequest | PageSize must be a positive number | 페이즈 사이즈가 양의 정수가 아닌 경우 |
400 | BadRequest | PageSize must not be less than 1 | 페이지 사이즈가 1보다 작을 경우 |
400 | BadRequest | Page size cannot exceed 15 | 페이지 사이즈가 15를 초과했을 경우 |
400 | InvalidDateFormat | startDate이 유효한 날짜 형식이 아닙니다. (예: YYYY-MM-DD) | 날짜 타입이 올바르지 않은 경우 |
401 | Unauthorized | Invalid token | 인증 정보가 올바르지 않은 경우 |
404 | AchievementsNotFound | 해당 인증서를 찾을 수 없습니다. | 인증서 목록 조회에 실패했을 경우 |
500 | InternalServerError | 예기치 않은 오류가 발생했습니다. | 서버 에러 |
Request Sample
- Java
- JavaScript
- Python
- Shell
- Unirest
- OkHttp
String url = "https://${baseURL}/open-api/achievements";
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://${baseURL}/open-api/achievements";
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();
}
- Axios
- XMLHttpRequest
- Fetch
- HTTP
const axios = require("axios");
const url = `https://api.test.kolleges.net/open-api/achievements`;
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 xhr = new XMLHttpRequest();
xhr.withCredentials = true;
const baseUrl = `https://api.test.kolleges.net/open-api/achievements`;
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 fetch = require("node-fetch");
const url = `https://api.test.kolleges.net/open-api/achievements`;
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));
const https = require("https");
const options = {
method: "GET",
hostname: "api.test.kolleges.net",
path: `/open-api/achievements${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();
- Requests
import requests
url = f"https://${baseURL}/open-api/achievements"
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://${baseURL}/open-api/achievements?page=1&pageSize=10&search=검색어&startDate=2025-03-01&endDate=2025-03-31" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer $API_KEY"