리소스 · 폰트 API
Resource API는 상품 정보 추출, 리소스 토큰 발행, 템플릿 패키지 등록·조회를 제공합니다.
- Resource API Base URL:
https://resource-dot-edicusbase.appspot.com - Font API Base URL:
https://api-dot-edicusbase.appspot.com - 모든 요청에
edicus-api-key헤더 필요. 고객사 서버에서만 호출.
상품(Product)
섹션 제목: “상품(Product)”상품 목록
섹션 제목: “상품 목록”/resapi/product/list Edicus Manager에 등록된 모든 Product와 Product Category 정보를 얻습니다. 카테고리별 분류는 직접 처리합니다.
{ "prodCates": [ /* Category */ ], "products": [ /* Product */ ] }주요 타입(요약):
interface Product { prodCode: string; dpName: string; cateCode: string; editor: string; // 'template' | 'print' sizes: ProductSize[];}interface ProductSize { sizeCode: string; dpName: string; lowDPI: number; // 화질 경고 판단 기준 editorMargin_mm: { width: number; height: number }; pageInfos: ProductPageInfo[]; printInfo: ProductPrintInfo;}TemplateProductOption(cover/doubleSide/multiPage, 각종 탭·기능 옵션)과 PrintProductOption(paperType/rendition 등)도 포함됩니다.
개별 상품
섹션 제목: “개별 상품”/resapi/product/:prod_code 특정 상품 정보를 얻습니다. 응답 구조는 상품 목록의 Product와 같습니다.
상품 userData 갱신
섹션 제목: “상품 userData 갱신”/resapi/product/userdata/:product_id 특정 상품의 userData를 갱신합니다. body: { "userdata": "string" }.
템플릿 등록
섹션 제목: “템플릿 등록”리소스 토큰 발행
섹션 제목: “리소스 토큰 발행”/resapi/token 템플릿을 식별하기 위한 토큰을 발행합니다. 토큰은 템플릿 최초 등록 시 발급받아 이후 업데이트에 계속 사용합니다.
{ "token": "eyJhbGciOiJI..." }이 토큰 문자열을 그대로 저장해 token.jwt 파일로 만듭니다.
템플릿 패키지 등록
섹션 제목: “템플릿 패키지 등록”/resapi/package 템플릿과 사용된 모든 리소스 파일을 Multipart Form Data로 한 번에 등록합니다.
| 파일 필드 | 타입 | 설명 |
|---|---|---|
token | token.jwt | Resource Token |
doc | template.json | InDesign에서 export한 JSON |
meta | metadata.json | Edicus Doc 변환 파라미터 |
dp | template-dp.png | 템플릿 썸네일(긴 축 200px 이하 권장, 초과 시 자동 축소) |
dp | layout-dp-n.png | Layout 썸네일. metadata의 generate_layout=true일 때 Page 수만큼 필요 |
res | res-file | 이미지 리소스(SVG/PNG/JPG). 파일 이름이 page-item-id여야 함(예: 234.png) |
metadata.json 주요 필드:
| 이름 | 타입 | 기본값 | 설명 |
|---|---|---|---|
template_type | string | mot1-indd-json | |
partner_code | string | mot1 | |
ps_codes | string[] | — | 템플릿이 사용될 수 있는 ps_code들 |
tags | string[] | — | 등록 시 사용할 tags |
generate_layout | boolean | false | layout도 함께 등록할지 여부(layout-dp 필요) |
cell_movable | boolean | false | cell movable 기본값 |
sticker_movable | boolean | false | sticker movable 기본값 |
sticker_selectable | boolean | true | sticker selectable 기본값 |
post_layers | string[] | — | 후가공 레이어 명칭(예: ["Scodix"]) |
응답에는 template_uri, template_dp_url, layout_uris, res_uris가 반환됩니다. 이 template_uri를 편집기 입력으로 사용합니다.
미등록 폰트를 사용하면 응답의 unregistered_fonts_found / unresolved_font-group_ids에 항목이 담깁니다. 두 배열이 모두 비어 있어야 정상입니다.
대용량 템플릿 업로드 (32MB 초과)
섹션 제목: “대용량 템플릿 업로드 (32MB 초과)”| 단계 | 타입 | 설명 |
|---|---|---|
GET /resapi/pkg-upload-url | — | 업로드 URL 발급(10분 유효). 응답: { upload_url, filename } |
PUT {upload_url} | — | zip 파일 업로드. Content-Type: application/x-zip-compressed |
POST /resapi/pkg-uploaded | — | filename을 전달해 등록 완료. 응답은 /resapi/package와 동일 |
템플릿 미리보기
섹션 제목: “템플릿 미리보기”/resapi/preview InDesign 템플릿을 edicus-doc으로 변환하고 미리보기용 SVG를 받습니다. Multipart Form Data로 전송.
| 이름 | 타입 | 기본값 | 설명 |
|---|---|---|---|
meta | file | — | metadata.json |
doc | file | — | template.json |
dir | string | — | template.json이 있는 로컬 절대 폴더 경로 |
dpi | string | 300 | SVG 생성 DPI |
bound_mode | string | show | RenderBound 처리: show / cut / none |
응답은 페이지별 svg와 layers를 포함합니다. unresolved_font_group_ids에 값이 있으면 fontclass-div-lang 패턴의 font group이 Edicus Manager에 생성되어 있지 않은 경우입니다.
리소스 조회
섹션 제목: “리소스 조회”리소스 쿼리
섹션 제목: “리소스 쿼리”/resapi/query 검색 조건으로 리소스를 조회합니다.
{ "option": { "type": "template", "visibilities": ["public", "private"], "order": "asc", "limit": 30, "tags": [], "psCodes": ["150x300@MB"]} }| 이름 | 타입 | 기본값 | 설명 |
|---|---|---|---|
type | string | — | template / layout / background / sticker / deco / mask / guide / token |
visibilities | string[] | — | private / public / deleted |
order | string | asc | 시간 정렬 asc / desc |
limit | number | 0 | 갯수 제한(0이면 무제한) |
tags | string[] | — | 검색할 tag |
psCodes | string[] | — | 검색할 psCode |
응답은 { items: Resource[] }이며, 각 Resource는 id, type, visibility, psCodes, dpUri, resUri, tags 등을 가집니다.
리소스 갯수
섹션 제목: “리소스 갯수”/resapi/query/count 요청·응답 모두 /resapi/query와 동일합니다.
사용자 이미지 목록
섹션 제목: “사용자 이미지 목록”/manapi/project/get_user_rsc_urls 프로젝트에 사용된 사용자 이미지 리스트를 얻습니다.
| 이름 | 타입 | 기본값 | 설명 |
|---|---|---|---|
user_id * | string | — | 에디쿠스 사용자 ID |
project_id * | string | — | 에디쿠스 프로젝트 ID |
size_tag | string | org | org / edit / tnl / tn (원본, 900, 256, 128) |
limit | number | 0 | 갯수 제한(0이면 전체) |
폰트 API
섹션 제목: “폰트 API”폰트 그룹 목록
섹션 제목: “폰트 그룹 목록”/api/font/group_id_list 등록된 모든 font-group-id 리스트를 가져옵니다.
{ "list": ["banner-basefont", "default-basefont", "default-host-ja", "default-host-ko"] }그룹별 폰트 목록
섹션 제목: “그룹별 폰트 목록”/api/font/group/:font-group-id/list font-group-id로 폰트 리스트를 가져옵니다.
{ "font_group_id": "default-host-ko", "list": [ { "key": "ArnoPro-Regular", "family": "Arno Pro", "style": "Regular", "byteLength": 251412, "issue": "BkhfSGHKf", "url": "https://.../ArnoPro-Regular.woff" } ]}