문서로 건너뛰기
API

템플릿 이미지 올리기

이미지를 저장하고 템플릿에 쓸 공개 주소를 받습니다.

POST/templates/images

워크스페이스에 실제 호출을 실행합니다.

POST /templates/images

이미지를 저장하고 템플릿에 쓸 공개 주소를 받습니다.

예시

templates:write가 필요합니다. 이미지 바이트를 본문으로 보내고 종류를 Content-Type에 적습니다. PNG, JPEG, WebP, GIF, SVG, 최대 5MB입니다. 1200×1800픽셀에 맞추고 모든 메일 클라이언트가 보여 주는 형태로 저장합니다. 201로 응답합니다.

curl
curl -X POST "$OE/templates/images" -H "$AUTH" -H "Content-Type: image/png" \  --data-binary @hero.png
응답
{  "object": "template_image",  "id": "5f0c9a8e-2b7d-4c1e-9a3f-8d6b2e4c7a10",  "url": "https://cdn.openemail.uk/templates/images/8a9c35f0/5f0c9a8e-2b7d-4c1e-9a3f-8d6b2e4c7a10.png",  "size": 48213,  "width": 1200,  "height": 630}

다른 종류의 이미지, 5MB를 넘는 이미지, 읽을 수 없는 이미지는 422 invalid_image입니다. 이미지 서비스가 바쁘면 503 image_busy, 저장에 실패하면 502 image_not_stored로 응답합니다.

레퍼런스