Aboneler API Referansı

Aboneleri getirin

Uç nokta:

GET /v2/:page_id/subscribers?page=:page&per_page=:per_page&search=:search_query
  • Varsayılan sayfa numarası 1'dir.
  • Varsayılan per_page değeri 50'dir; sayfa başına en fazla 100 öğedir.
  • İsteğe bağlı arama sorgusu, aboneleri e-posta adresine veya telefon numarasına göre filtrelemek için kullanılır.

Örnek yanıt

[
{
"id": "cm1111x6ofgsd5666mzxcw978qh",
"email": "ali@instatus.com",
"phone": null,
"webhook": null,
"webhookEmail": null,
"confirmed": false,
"all": true,
"components": []
},
{
"id": "cm1111x6ofgsd5666mzxcw978qh",
"email": null,
"phone": "5417543010",
"webhook": null,
"webhookEmail": null,
"confirmed": false,
"all": true,
"components": []
}
]

Abone ekleyin

Uç nokta:

POST /v1/:page_id/subscribers

Biri abone olduğunda doğrulama davranışı, sayfanın subscriberConfirmationMode ayarını izler. Bu davranışı tek bir abone için geçersiz kılmak amacıyla bu uç noktada autoConfirm kullanın.

Örnek istek

{
"email": "sarah@instatus.com",
"all": true,
"autoConfirm": false
}
  • autoConfirm — isteğe bağlı. true olduğunda, sayfa ayarından bağımsız olarak aboneyi doğrulama veya karşılama e-postası göndermeden hemen ekler. Yalnızca Pro.

Örnek yanıt

{
"id": "cm1111x6ofgsd5666mzxcw978df",
"name": null,
"email": "sarahs@instatus.com",
"phone": null,
"confirmed": false,
"all": true,
"createdAt": "2024-10-01T03:48:41.474Z",
"updatedAt": "2024-10-01T03:48:41.474Z",
"siteId": "cm1111x6ofgsd5666mzxcw978qh",
"unsubscribeToken": "e3b51de6-1234-4664-zxyv-1679gg524260",
"webhook": null,
"webhookEmail": null,
"discord": null,
"discordTeam": null,
"slack": null,
"slackTeam": null,
"language": "en",
"company": null,
"microsoftTeamsWebhook": null,
"googleChatWebhook": null,
"googleChatSpace": null,
"failedAttempts": 0,
"approved": true,
"importedFrom": null,
"hideUnsubLink": false,
"webhookIncidentBody": null,
"webhookMaintenanceBody": null,
"webhookComponentBody": null,
"webhookHttpMethod": "POST",
"webhookHeaders": null,
"site": {
"id": "cm1111x6ofgsd5666mzxcw978qh"
}
}

Belirli bileşenlere abone olun

Örnek istek

{
"email": "adam@instatus.com",
"all": false,
"components": ["cl2xv23rl0119e7jlk2mweepd"],
"autoConfirm": false
}

Örnek yanıt

{
"id": "cl09gt11151422bjluflghewx",
"email": "adam@instatus.com",
"site": {
"id": "ckg8a112344s5v86wrn",
"name": "Test",
"logoUrl": null,
"subdomain": "test",
"publicEmail": null,
"language": "en"
}
}

Birden fazla abone ekleyin

Uç nokta:

POST /v1/:page_id/subscribers/bulk

Bu uç nokta, tek bir istekte birden fazla abone oluşturmanızı sağlar.

Örnek istek

{
"subscribers": [
{
"email": "sarah@instatus.com",
"all": true
},
{
"email": "john@instatus.com",
"components": ["cl2xv23rl0119e7jlk2mweepd"]
},
{
"name": "Jane Doe",
"phone": "5417543010",
"all": true
}
],
"autoConfirm": false
}
  • autoConfirm, gruptaki her aboneye uygulanır. Yalnızca Pro.

Örnek yanıt

{
"success": true,
"created": 3,
"failed": 0,
"results": {
"created": [
{
"id": "cm1111x6ofgsd5666mzxcw978df",
"email": "sarah@instatus.com",
"phone": null,
"confirmed": false,
"all": true,
"site": {
"id": "cm1111x6ofgsd5666mzxcw978qh"
}
},
{
"id": "cm2222x6ofgsd5666mzxcw978df",
"email": "john@instatus.com",
"phone": null,
"confirmed": false,
"all": false,
"site": {
"id": "cm1111x6ofgsd5666mzxcw978qh"
}
},
{
"id": "cm3333x6ofgsd5666mzxcw978df",
"email": null,
"phone": "5417543010",
"name": "Jane Doe",
"confirmed": false,
"all": true,
"site": {
"id": "cm1111x6ofgsd5666mzxcw978qh"
}
}
],
"failed": []
}
}

Bazı aboneler eklenemediğinde yanıt

Bazı aboneler oluşturulamazsa (örneğin mükerrer e-posta, hatalı biçim), yanıt bu hatalara dair ayrıntıları içerir:

{
"success": false,
"created": 2,
"failed": 1,
"results": {
"created": [
{
"id": "cm1111x6ofgsd5666mzxcw978df",
"email": "sarah@instatus.com",
"site": {
"id": "cm1111x6ofgsd5666mzxcw978qh"
}
},
{
"id": "cm2222x6ofgsd5666mzxcw978df",
"email": "john@instatus.com",
"site": {
"id": "cm1111x6ofgsd5666mzxcw978qh"
}
}
],
"failed": [
{
"index": 2,
"subscriber": {
"email": "duplicate@instatus.com",
"all": true
},
"error": {
"code": "creation_failed",
"message": "Subscriber with this email already exists"
}
}
]
}
}

Notlar:

  • İstek başına en fazla 100 abone
  • Her abone nesnesi, tekil abone uç noktasıyla aynı alanları içerebilir
  • Kısmi başarı desteklenir; bazıları başarısız olsa bile başarıyla oluşturulan aboneler döndürülür

Doğrulama davranışı

Durum sayfaları, yeni abonelerin nasıl ele alınacağını Durum sayfasını güncelleyin uç noktasındaki subscriberConfirmationMode ile denetler:

DeğerDavranış
REQUIREDAboneler güncellemeleri almadan önce e-posta ile doğrulama yapmalıdır. Varsayılan.
WELCOMEAboneler hemen eklenir ve bir karşılama e-postası alır. Yalnızca Pro.
NONEAboneler e-posta gönderilmeden hemen eklenir. Yalnızca Pro.

Oluşturma uç noktalarındaki autoConfirm parametresi, o istek için sayfa ayarını geçersiz kılar ve NONE gibi davranır.

Aboneyi kaldırın

Uç nokta:

DELETE /v1/:page_id/subscribers/:subscriber_id

Örnek yanıt

{
"id": "cm1zvzm3434dlp9255d6jgy8",
"name": null,
"email": "sarah@instatus.com",
"phone": null,
"webhook": null,
"webhookEmail": null,
"discord": null,
"microsoftTeamsWebhook": null,
"company": null,
"site": {
"id": "cm180slpo000g9343478qh"
}
}