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

اعلان‌ها

مرکز اعلان‌ها و تنظیمات اعلان هر شخص.

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

The unsubscribe link in a notification email#

No auth: the signed token names one person and one event. Answers an HTML page with one button that posts back.

دسترسی
بدون اعتبارنامه

پارامترها

  • tstringکوئریالزامی

    the token from the email

پاسخ

200stringtext/htmlThe page with the button

خطاها

وضعیتتوضیح
400The token does not check out (an HTML page)

نمونه

درخواست
curl "https://api.ibel.ai/v1/unsubscribe?t=t"
POST/v1/unsubscribe

Turn one event's email off (the button, or one-click unsubscribe, RFC 8058)#

No auth: the signed token names one person and one event. The dashboard notification and SMS stay as they were.

دسترسی
بدون اعتبارنامه

پارامترها

  • tstringکوئریالزامی

    the token from the email

بدنهٔ درخواستapplication/x-www-form-urlencoded

string

پاسخ

200stringtext/htmlDone (an HTML page)

خطاها

وضعیتتوضیح
400The token does not check out (an HTML page)

نمونه

درخواست
curl -X POST "https://api.ibel.ai/v1/unsubscribe?t=t" \
  --data-binary @file
GET/v1/notifications

Your notifications, newest first#

دسترسی
فقط نشست داشبورد (کلید API پذیرفته نمی‌شود)
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • limitintegerکوئری

    1-100, default 20

  • beforeintegerکوئری

    an id: the next page

  • unreadstringکوئری

    1: unread only

    one of 1

پاسخ

200object

  • itemsNotification[]الزامی
  • unreadintegerالزامی
  • next_beforeinteger | nullالزامی

خطاها

وضعیتتوضیح
400Bad request: bad_param
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: session_only
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/notifications" \
  -H "Authorization: Bearer $SESSION"
POST/v1/notifications/read

Mark notifications read#

دسترسی
فقط نشست داشبورد (کلید API پذیرفته نمی‌شود)
نقش‌ها
همهٔ نقش‌ها

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

  • idsinteger[]

    1-500 ids

  • allboolean

    every unread one

پاسخ

200object

  • markedintegerالزامی
  • unreadintegerالزامی

خطاها

وضعیتتوضیح
400Bad request: bad_request, bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: session_only
500internal: an unexpected failure

نمونه

curl -X POST "https://api.ibel.ai/v1/notifications/read" \
  -H "Authorization: Bearer $SESSION" \
  -d '{"ids":[1],"all":true}'
GET/v1/me/notification-settings

Which events go to the centre, email or SMS#

دسترسی
فقط نشست داشبورد (کلید API پذیرفته نمی‌شود)
نقش‌ها
همهٔ نقش‌ها

پاسخ

200object

  • has_phonebooleanالزامی
  • eventsNotificationSetting[]الزامی
    • typestringالزامی
    • groupstring

      one of deploys, alerts, billing, team, support

    • channelsstring[]الزامی

      the channels this event can use

    • title_keystring
    • centrebooleanالزامی
    • emailbooleanالزامی
    • smsbooleanالزامی

خطاها

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

نمونه

curl "https://api.ibel.ai/v1/me/notification-settings" \
  -H "Authorization: Bearer $SESSION"
PUT/v1/me/notification-settings

Change them#

A channel left out keeps its value; a channel the event does not use is refused.

دسترسی
فقط نشست داشبورد (کلید API پذیرفته نمی‌شود)
نقش‌ها
همهٔ نقش‌ها

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

  • eventsobject[]الزامی
    • typestringالزامی
    • centreboolean
    • emailboolean
    • smsboolean

پاسخ

200object

  • has_phonebooleanالزامی
  • eventsNotificationSetting[]الزامی
    • typestringالزامی
    • groupstring

      one of deploys, alerts, billing, team, support

    • channelsstring[]الزامی

      the channels this event can use

    • title_keystring
    • centrebooleanالزامی
    • emailbooleanالزامی
    • smsbooleanالزامی

خطاها

وضعیتتوضیح
400Bad request: bad_request, bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: session_only
500internal: an unexpected failure

نمونه

curl -X PUT "https://api.ibel.ai/v1/me/notification-settings" \
  -H "Authorization: Bearer $SESSION" \
  -d '{"events":[{"type":"…","centre":true,"email":true,"sms":true}]}'