개발 문서 / 프린터
프린터 목록 조회
GET /v1/api/printer
이 라이선스에 등록한 프린터 목록과 프린터마다의 상태를 돌려줍니다. 상태는 state 값과 reasons, 센서 값은 detail 에 있습니다.
요청 칸
요청에 넣는 칸입니다.
| 이름 | 위치 | 형 | 뜻 |
|---|---|---|---|
Authorization | 머리 | 문자열 | 필수. Bearer 뒤에 라이선스 키(인증). 예: Bearer OPL-XXXXX-XXXXX-XXXXX-XXXXX. |
요청 예시
Bash
curl -s "https://studio.oplanet.net/v1/api/printer" \
-H "Authorization: Bearer $OPLANET_LICENSE_KEY"응답 예시
상태 200. 칸은 값이 없어도 빠지지 않고 null로 나옵니다(표에 "빠질 수 있음"이라 적은 칸만 없을 수 있음).
JSON
{
"ok": true,
"items": [
{
"serial": "10001400142",
"model": "KC Prime",
"registered": true,
"activated": true,
"activatedAt": "2026-11-01T02:00:00.000Z",
"state": "ready",
"reasons": [],
"online": true,
"lastSeenAt": "2026-11-06T03:00:00.000Z",
"detail": {
"cover": "closed",
"cardInFeeder": true,
"ribbon": {
"label": "Color YMCKO",
"remaining": 85,
"capacity": 300,
"percent": 28,
"state": "in_use",
"uid": "RBN-0001",
"updatedAt": "2026-11-06T03:00:00.000Z"
},
"totalCards": 629,
"cardsUntilCleaning": 371,
"cleaningCount": 2,
"source": "cli"
},
"lastPrint": {
"printId": "J20261105-000008",
"state": "completed",
"result": "completed",
"createdAt": "2026-11-05T14:53:35.000Z",
"finishedAt": "2026-11-05T14:54:55.000Z"
},
"currentPrint": null,
"recent30Days": {
"prints": 12,
"completed": 11,
"cards": 13
},
"lastRibbon": {
"value": 85,
"uid": "RBN-0001",
"at": "2026-11-05T14:54:55.000Z",
"printId": "J20261105-000008"
}
}
],
"nextCursor": null
}응답 칸의 형과 뜻입니다.
| 칸 | 형 | 뜻 |
|---|---|---|
ok | true, false | 성공하면 늘 true. 늘 true. |
items[] | 배열 | 프린터. |
items[].serial | 문자열 | 프린터 시리얼. 예: 10001400142. |
items[].model | 문자열 | 모델 이름. 예: KC Prime. |
items[].registered | true, false | 이 라이선스의 프린터 목록에 있음(목록에 나오면 늘 true). |
items[].activated | true, false | 프로그램이나 웹에서 한 번이라도 썼음. |
items[].activatedAt | 문자열 | 처음 쓴 시각. null 가능. |
items[].state | 문자열 | 상태 값(ready, printing, blocked, cleaning, offline, unknown 중 한 가지). 값: ready, printing, blocked, cleaning, offline, unknown. |
items[].reasons[] | 배열 | 막힌 이유 code(cover_open, ribbon_out 등). 없으면 빈 배열. |
items[].online | true, false | 최근 2분 안에 소식이 있었음(또는 출력 화면이 잡고 있음). |
items[].lastSeenAt | 문자열 | 마지막 소식 시각. null 가능. |
items[].detail | 객체 | 센서 값(마지막 소식 기준, 모르면 null). |
items[].detail.cover | 문자열 | 덮개(open, closed). null 가능. 예: closed. |
items[].detail.cardInFeeder | true, false | 공급기에 카드가 있음. null 가능. |
items[].detail.ribbon | 객체 | 리본(센서 값). 리본이 없거나 모르면 null. null 가능. |
items[].detail.ribbon.label | 문자열 | 리본 종류. null 가능. 예: Color YMCKO. |
items[].detail.ribbon.remaining | 숫자 | 남은 면. 새 리본(칩 값 20000 = 안 쓴 새 리본 표시)이면 capacity 와 같고, 칩 값이 용량보다 커 알 수 없으면 null. null 가능. 예: 85. |
items[].detail.ribbon.capacity | 숫자 | 한 롤의 면 수. null 가능. 예: 300. |
items[].detail.ribbon.percent | 숫자 | 남은 비율(%). 새 리본이면 100, 알 수 없으면 null. null 가능. 예: 28. |
items[].detail.ribbon.state | 문자열 | 리본 상태: new 새 리본(안 쓴 것), in_use 쓰는 중, unknown 남은 양을 알 수 없음(값이 없거나 용량보다 큼). 값: new, in_use, unknown. |
items[].detail.ribbon.uid | 문자열 | 리본 고유 번호. null 가능. |
items[].detail.ribbon.updatedAt | 문자열 | 리본 값을 마지막으로 받은 시각. null 가능. |
items[].detail.totalCards | 숫자 | 프린터가 센 전체 카드 장수. null 가능. 예: 629. |
items[].detail.cardsUntilCleaning | 숫자 | 다음 청소까지 남은 카드 수. null 가능. 예: 371. |
items[].detail.cleaningCount | 숫자 | 프린터가 센 청소 횟수. null 가능. |
items[].detail.source | 문자열 | 값을 보낸 곳(cli, web). null 가능. |
items[].lastPrint | 객체 | 마지막 출력(없으면 null). null 가능. |
items[].lastPrint.printId | 문자열 | 출력 번호. |
items[].lastPrint.state | 문자열 | 출력 상태. null 가능. |
items[].lastPrint.result | 문자열 | 최종 결과(completed, failed, unknown), 진행 중이면 null. null 가능. |
items[].lastPrint.createdAt | 문자열 | 만든 시각. null 가능. |
items[].lastPrint.finishedAt | 문자열 | 끝난 시각. null 가능. |
items[].currentPrint | 객체 | 지금 진행 중인 출력(이 라이선스의 것). 없으면 null. 값이 없는 칸은 빠짐. null 가능. |
items[].currentPrint.printId | 문자열 | 출력 번호. 예: J20261106-000001. |
items[].currentPrint.state | 문자열 | 출력 상태(ready, sending, printing, blocked, recovering). |
items[].currentPrint.stage | 문자열 | 진행 단계. 빠질 수 있음. |
items[].currentPrint.createdAt | 문자열 | 만든 시각. 빠질 수 있음. |
items[].currentPrint.startedAt | 문자열 | 시작 시각. 빠질 수 있음. |
items[].currentPrint.lastEventAt | 문자열 | 마지막 진행 소식 시각. 빠질 수 있음. |
items[].currentPrint.bytesSent | 숫자 | 보낸 바이트. 빠질 수 있음. |
items[].currentPrint.totalBytes | 숫자 | 전체 바이트. 빠질 수 있음. |
items[].currentPrint.reasons[] | 배열 | 막힌 이유 code(막혔을 때만). 빠질 수 있음. |
items[].recent30Days | 객체 | 최근 30일. |
items[].recent30Days.prints | 숫자 | 출력 수. |
items[].recent30Days.completed | 숫자 | 끝까지 나온 수. |
items[].recent30Days.cards | 숫자 | 쓴 카드 수. |
items[].lastRibbon | 객체 | 출력 결과로 받은 마지막 리본 값(없으면 null). null 가능. |
items[].lastRibbon.value | 숫자 | 남은 면. null 가능. |
items[].lastRibbon.uid | 문자열 | 리본 고유 번호. null 가능. |
items[].lastRibbon.at | 문자열 | 받은 시각. null 가능. |
items[].lastRibbon.printId | 문자열 | 그 출력 번호. |
nextCursor | null | 늘 null(한 쪽에 다 나옴). |
오류 code
이 요청이 돌려줄 수 있는 오류 code입니다.
| HTTP 상태 | code | 뜻 |
|---|---|---|
| 401 | license_key_invalid | 라이선스 키가 없거나 올바르지 않습니다(재발급 전 키 포함) |
| 429 | api_capacity_exceeded | API 전체 호출이 오늘 한도에 닿았습니다 |
| 429 | api_rate_daily_exceeded | 오늘 쓸 수 있는 API 호출 수(고객마다, 매일 오전 9시 한국 시간에 초기화)에 닿았습니다 |
| 429 | rate_limited | 1분 한도를 넘었습니다(API 호출은 고객마다 1분 60번, AI 이미지 만들기는 웹, 프로그램 합쳐 고객마다 1분 10건). Retry-After 머리의 초만큼 기다린 뒤 다시 보냅니다 |
| 500 | internal_error | 서버 오류입니다 |
오류 모양(ok, code, message, action)과 전체 code는 공통 규칙에 있습니다.