인증서 폼 수정
인증서 폼 수정 (PATCH)
특정 인증서 폼 정보를 수정합니다.
-
Method:
PATCH
-
URL:
/achievements/forms/{achievementFormId}
-
URL Parameter:
achievementFormId
(number, 필수): 수정할 인증서 폼 ID
-
Request Body (JSON):
필드 타입 필수 검증 규칙 설명 name string No - 인증서 폼의 이름 description string No - 인증서 폼 설명 type string (enum) No completion, activity, license, career, award, recommendation, membership, degree, warranty 인증서 폼의 유형 tags array of strings No 각 요소가 문자열이어야 함 스킬 태그 등, 인증서 폼에 적용할 태그 배열 prefix string No 알파벳만 포함 (정규표현식), 최대 5자 인증서 폼 접두사 (예: 인증번호 접두사) program_name string No - 프로그램 이름 program_type string No - 프로그램 종류 program_url string No - 프로그램 URL course_begin_at string (ISO 8601 Date) No ISO8601 형식 (예: "2025-04-03T00:00:00.000Z") 코스 시작일 course_end_at string (ISO 8601 Date) No ISO8601 형식 코스 종료일 achievementCertificateDesignId number No 정수여야 함 증명서 디자인 ID achievementBadgeDesignId number Yes 정수여야 함 뱃지 디자인 ID -
Body 예시:
{
"name": "Updated Form",
"prefix": "ABC",
"course_begin_at": "2025-07-01T00:00:00.000Z",
"achievementBadgeDesignId": 123
}
Response
{
"statusCode": 200,
"message": "인증서 폼이 수정되었습니다."
}
오류 코드
상태 코드 | 에러 | 메시지 | 상세 설명 |
---|---|---|---|
400 | Bad Request | 잘못된 요청입니다. | 허가되지 않은 값, 올바르지 않은 형식의 요청 |
401 | Unauthorized | Invalid token | 인증 정보가 올바르지 않은 경우 |
404 | Not Found | 해당 인증서를 찾을 수 없습니다. | 인증서 폼이 존재하지 않는 경우 |
해당 증명서 디자인을 찾을 수 없습니다. | 증명서 디자인이 존재하지 않은 경우 | ||
해당 배지 디자인을 찾을 수 없습니다. | 배지 디자인이 존재하지 않은 경우 | ||
500 | Internal Server Error | 예기치 않은 오류가 발생했습니다. | 서버 에러 |
Request Sample
- Java
- JavaScript
- Python
- Shell
- Unirest
- OkHttp
String url = "https://${baseURL}/open-api/achievements/forms/" + achievementFormId;
String jsonPayload = "{ \"name\": \"Updated Form\", \"prefix\": \"ABC\" }";
HttpResponse<String> response = Unirest.patch(url)
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("Authorization", "Bearer " + apiKey)
.body(jsonPayload)
.asString();
System.out.println("Status: " + response.getStatus());
System.out.println("Response: " + response.getBody());
OkHttpClient client = new OkHttpClient();
String url = "https://${baseURL}/open-api/achievements/forms/" + achievementFormId;
String jsonPayload = "{ \"name\": \"Updated Form\", \"prefix\": \"ABC\" }";
RequestBody body = RequestBody.create(
jsonPayload, MediaType.parse("application/json"));
Request request = new Request.Builder()
.url(url)
.patch(body)
.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());
}
- Axios
- XMLHttpRequest
- Fetch
- HTTP
const axios = require("axios");
const url = `https://api.test.kolleges.net/open-api/achievements/forms/${achievementFormId}`;
const payload = {
name: "Updated Form",
prefix: "ABC",
};
axios
.patch(url, payload, {
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${apiKey}`,
},
})
.then((res) => {
console.log("Status:", res.status);
console.log("Response:", res.data);
})
.catch((err) => {
console.error("Error:", err.response?.data || err.message);
});
const xhr = new XMLHttpRequest();
const url = `https://api.test.kolleges.net/open-api/achievements/forms/${achievementFormId}`;
const data = {
name: "Updated Form Name",
prefix: "ABC",
course_begin_at: "2025-07-01T00:00:00.000Z",
};
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log("Status:", this.status);
console.log("Response:", this.responseText);
}
});
xhr.open("PATCH", url);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("Authorization", "Bearer " + apiKey);
xhr.send(JSON.stringify(data));
const fetch = require("node-fetch");
const url = `https://api.test.kolleges.net/open-api/achievements/forms/${achievementFormId}`;
const payload = {
name: "Updated Form",
prefix: "ABC",
};
fetch(url, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify(payload),
})
.then((res) => {
console.log("Status:", res.status);
return res.text();
})
.then((body) => {
console.log("Response:", body);
})
.catch((err) => console.error("Error:", err));
const https = require("https");
const data = JSON.stringify({
name: "Updated Form",
prefix: "ABC",
});
const options = {
hostname: "api.test.kolleges.net",
path: `/open-api/achievements/forms/${achievementFormId}`,
method: "PATCH",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${apiKey}`,
"Content-Length": data.length,
},
};
const req = https.request(options, (res) => {
let body = "";
res.on("data", (chunk) => {
body += chunk;
});
res.on("end", () => {
console.log("Status:", res.statusCode);
console.log("Response:", body);
});
});
req.on("error", (error) => {
console.error("Error:", error);
});
req.write(data);
req.end();
- Requests
import requests
url = f"https://${baseURL}/open-api/achievements/forms/{achievement_form_id}"
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": f"Bearer {api_key}"
}
payload = {
"name": "Updated Form",
"prefix": "ABC"
}
response = requests.patch(url, json=payload, headers=headers)
print("Status:", response.status_code)
try:
print("Response:", response.json())
except Exception as e:
print("Response:", response.text)
- cURL
curl -X PATCH "https://${baseURL}/open-api/achievements/forms/${achievementFormId}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"name": "Updated Form",
"prefix": "ABC"
}'