رفتن به محتوا
cloudhostمستندات
مرجع API

تغییر اندازهٔ تصویر

تنظیمات تغییر اندازهٔ تصویر هر برنامه: منبع‌های مجاز، اندازه‌ها، کش و مصرف.

توضیح هر مسیر به انگلیسی است، همان متنی که مرجع از کد ساخته می‌شود. مسیرها، نام فیلدها و کدها همان‌اند که در درخواست می‌نویسید.
GET/v1/apps/{name}/images

Image settings and usage#

The app's image resizing settings, its limits, this month's transformations and cache hits, the cache against the team's limit, and whether Hobby's free amount is used up (originals are served).

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • namestringمسیرالزامی

    the app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

پاسخ

200object

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/apps/my-api/images" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/apps/{name}/images

Change image settings#

Change any of enabled, hosts, widths, qualities, formats and ttl_seconds; live within seconds. Errors 400 image_bad_*, 409 image_limit.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

پارامترها

  • namestringمسیرالزامی

    the app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

بدنهٔ درخواستapplication/json

  • enabledboolean
  • hostsstring[]

    host names (img.example.com) or wildcards (*.example.com); https only, never addresses

  • widthsinteger[]
  • qualitiesinteger[]

    0–10 items

  • formatsstring[]
  • ttl_secondsinteger

    60–2678400

پاسخ

200object

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

نمونه

curl -X PATCH "https://api.ibel.ai/v1/apps/my-api/images" \
  -H "Authorization: Bearer $KEY" \
  -d '{"enabled":true,"hosts":["…"],"widths":[1],"qualities":[1],"formats":["webp"],"ttl_seconds":60}'
GET/v1/apps/{name}/images/usage

Image usage by day#

Per day: transformations (billed per 1,000), cache hits, originals served unchanged, bytes in and out.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • namestringمسیرالزامی

    the app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • daysintegerکوئری

    1–90 · default 30

پاسخ

200object

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/apps/my-api/images/usage" \
  -H "Authorization: Bearer $KEY"
DELETE/v1/apps/{name}/images/cache

Clear the image cache#

Forget every cached result of the app; each is made, and counted, again on its next request.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

پارامترها

  • namestringمسیرالزامی

    the app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

پاسخ

200object

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

نمونه

curl -X DELETE "https://api.ibel.ai/v1/apps/my-api/images/cache" \
  -H "Authorization: Bearer $KEY"
GET/v1/images

The team''s image resizing#

Every app's transformations this month and its cache, and the team's cache against its plan limit.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پاسخ

200object

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/images" \
  -H "Authorization: Bearer $KEY"