همهٔ سیستم‌ها عملیاتی‌اند

مرجع API · نسخهٔ v1

API تیکت پشتیبانی

ثبت، پاسخ و بستن تیکت‌های پشتیبانی. این گروه با شناسهٔ tickets در فایل OpenAPI آمده و ۵ endpoint دارد.

نمونه‌های curl توکن را از متغیر محیطی IRANCLAUD_TOKEN می‌خوانند؛ ساخت توکن و تنظیم این متغیر در راهنمای شروع سریع آمده است.

GET /api/v1/tickets #

List your support tickets

دسترسی لازم: tickets:read محدودیت نرخ: خواندن
پارامترهای Query (۴)
status string
اختیاری open | customer_reply | staff_reply | closed
q string
اختیاری Substring match on the subject
page integer
اختیاری Page number (default 1)
per_page integer
اختیاری Items per page (1-200, default 50)
پاسخ‌ها (۴)
  • 200 Page object inside data (items, page, per_page, total, pages); open tickets first data: itemspageper_pagetotalpages
  • 401 unauthenticated — Authorization header missing or not "Bearer …"; token_invalid — token unknown, expired, revoked or the account is not active
  • 403 scope_missing — the token lacks tickets:read (details.required_scope)
  • 429 rate_limited — read limit reached; wait Retry-After seconds (details.retry_after_sec)
نمونهٔ curl
curl
curl \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/tickets"

بازگشت به فهرست این بخش

POST /api/v1/tickets #

Open a support ticket

دسترسی لازم: tickets:write محدودیت نرخ: تغییر
فیلدهای بدنه (JSON) (۴)
subject string
الزامی min 1 chars; max 200 chars
body string
الزامی First message — min 10 chars
category string
اختیاری one of: technical | billing | general; default: general
priority string
اختیاری Unknown values fall back to normal — one of: normal | high; default: normal
نمونهٔ بدنهٔ درخواست (JSON)
application/json
{
    "subject": "Server 203.0.113.10 unreachable",
    "body": "Since 10:00 the server does not answer on port 22.",
    "category": "technical",
    "priority": "high"
}
پاسخ‌ها (۵)
  • 200 Ticket created (status open) data: uuidsubjectcategoryprioritystatuscreated_atupdated_atclosed_at
  • 401 unauthenticated — Authorization header missing or not "Bearer …"; token_invalid — token unknown, expired, revoked or the account is not active
  • 403 scope_missing — the token lacks tickets:write (details.required_scope)
  • 422 validation_failed — details.fields names subject, body or category
  • 429 rate_limited — write limit reached; wait Retry-After seconds (details.retry_after_sec)
نمونهٔ curl
curl
curl -X POST \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"subject":"Server 203.0.113.10 unreachable","body":"Since 10:00 the server does not answer on port 22.","category":"technical","priority":"high"}' \
  "https://iranclaud.ir/api/v1/tickets"

بازگشت به فهرست این بخش

GET /api/v1/tickets/{uuid} #

Get a ticket with its replies

دسترسی لازم: tickets:read محدودیت نرخ: خواندن
پارامترهای مسیر (۱)
uuid string
الزامی Ticket UUID
پاسخ‌ها (۵)
  • 200 Ticket plus replies[] (internal staff notes are never included) data: uuidsubjectcategoryprioritystatuscreated_atupdated_atclosed_atreplies
  • 401 unauthenticated — Authorization header missing or not "Bearer …"; token_invalid — token unknown, expired, revoked or the account is not active
  • 403 scope_missing — the token lacks tickets:read (details.required_scope)
  • 404 not_found — unknown UUID, or owned by another account
  • 429 rate_limited — read limit reached; wait Retry-After seconds (details.retry_after_sec)
نمونهٔ curl
curl
curl \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/tickets/YOUR_UUID"

بازگشت به فهرست این بخش

POST /api/v1/tickets/{uuid}/replies #

Reply to a ticket

دسترسی لازم: tickets:write محدودیت نرخ: تغییر
پارامترهای مسیر (۱)
uuid string
الزامی Ticket UUID
فیلدهای بدنه (JSON) (۱)
body string
الزامی min 5 chars
نمونهٔ بدنهٔ درخواست (JSON)
application/json
{
    "body": "Thanks, it works again."
}
پاسخ‌ها (۶)
  • 200 Reply created; ticket status becomes customer_reply data: idauthor_rolebodycreated_at
  • 401 unauthenticated — Authorization header missing or not "Bearer …"; token_invalid — token unknown, expired, revoked or the account is not active
  • 403 scope_missing — the token lacks tickets:write (details.required_scope)
  • 404 not_found — unknown UUID, or owned by another account
  • 422 validation_failed — body shorter than 5 characters, or the ticket is closed (details.fields.ticket)
  • 429 rate_limited — write limit reached; wait Retry-After seconds (details.retry_after_sec)
نمونهٔ curl
curl
curl -X POST \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"body":"Thanks, it works again."}' \
  "https://iranclaud.ir/api/v1/tickets/YOUR_UUID/replies"

بازگشت به فهرست این بخش

POST /api/v1/tickets/{uuid}/close #

Close a ticket

دسترسی لازم: tickets:write محدودیت نرخ: تغییر
پارامترهای مسیر (۱)
uuid string
الزامی Ticket UUID
پاسخ‌ها (۵)
  • 200 Closed ticket (idempotent) data: uuidsubjectcategoryprioritystatuscreated_atupdated_atclosed_at
  • 401 unauthenticated — Authorization header missing or not "Bearer …"; token_invalid — token unknown, expired, revoked or the account is not active
  • 403 scope_missing — the token lacks tickets:write (details.required_scope)
  • 404 not_found — unknown UUID, or owned by another account
  • 429 rate_limited — write limit reached; wait Retry-After seconds (details.retry_after_sec)
نمونهٔ curl
curl
curl -X POST \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/tickets/YOUR_UUID/close"

بازگشت به فهرست این بخش

همهٔ گروه‌های API