コンテンツにスキップ

Agent: Certificates

Create or run a certificate (revoke)

POST /api/v1/agent/certificates/{certificate_id}/revoke/

Requires certificates: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/certificates/<certificate_id>/revoke/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
certificate_id path yes
CERTIFICATE_ID="..."
curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/certificates/$CERTIFICATE_ID/revoke/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

certificate_id = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/certificates/{certificate_id}/revoke/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const certificate_id = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/certificates/${certificate_id}/revoke/`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Read certificate settings

GET /api/v1/agent/courses/{course_pk}/certificate-settings/

Requires certificates: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/certificate-settings/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X GET "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/certificate-settings/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/certificate-settings/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/certificate-settings/`, {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Replace certificate settings

PUT /api/v1/agent/courses/{course_pk}/certificate-settings/

Requires certificates: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/certificate-settings/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X PUT "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/certificate-settings/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/certificate-settings/"
response = requests.put(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/certificate-settings/`, {
  method: "PUT",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Create or run certificate backfill

POST /api/v1/agent/courses/{course_pk}/certificate-settings/backfill/

Requires certificates: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/certificate-settings/backfill/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/certificate-settings/backfill/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/certificate-settings/backfill/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/certificate-settings/backfill/`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Create or run a certificate preview

POST /api/v1/agent/courses/{course_pk}/certificate-settings/preview/

Requires certificates: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/certificate-settings/preview/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/certificate-settings/preview/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/certificate-settings/preview/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/certificate-settings/preview/`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.