CRADالمطوّرون
العربية

Read campaign recipient outcomes

قبل الاستخدام الفعلي — افحص القدرات المنشورة والصلاحيات وجاهزية ربطك.

تحقّق من القدرات المنشورة وصلاحيات المفتاح وجاهزية النشاط في بيئتك. أمثلة HTTP مسجّلة من اختبارات معزولة؛ وصفها local-unreleased لا يعني أن API غير عامل ولا يُثبت جاهزية ربطك. في مسار العميل يُتحقق من الهاتف بقالب واتساب أعدّه النشاط؛ SMS غير مدعوم. التسجيل بواسطة مسؤول مخوّل عملية منفصلة دون رمز.

GET/v1/management/campaigns/{campaignId}/recipients

راجعوا مستلمًا واحدًا واحتفظوا بنية إرسال واحدة

للمستند، تأكدوا أولًا من جاهزيته للعميل المقصود. يجب أن يكون الموعد الذي أنشأه الموظف بحالة CONFIRMED وأن يظل مطابقًا للموعد الذي تمت مراجعته. تستخدم الموافقة على طلب عميل بحالة PENDING تأكيد CRAD التلقائي بدل هذا الإرسال المنفصل.

اعرضوا معاينة لملف CRAD حقيقي واحد، واشترطوا هذا المستلم وحده دون مستلمين تم تخطيهم، واعرضوا نص الرسالة قبل موافقة الموظف الصريحة. قبل POST /campaigns احفظوا draft نفسه وETag من نوع cp بعلامتي اقتباس وUUID واحدًا في حدث outbox فريد لنية الإرسال. يكون تأكيد موعد أنشأه الموظف فريدًا بحسب العيادة والغرض والموعد؛ ويشمل إرسال المستند أيضًا sendIntentId صريحًا.

إعادة إرسال مستند عمدًا بعد معرفة نتيجة الإرسال السابق تنشئ sendIntentId وUUID جديدين، بعد مراجعة نسخة التقرير المحفوظة والمستلم. يخص sendIntentId سجل outbox في موقعكم، وليس جسم طلب CRAD. تحتفظ النقرات المتزامنة وإعادة محاولة الإجراء نفسه بالنية وUUID الأصليين. لا تبرر حالة queued أو انتهاء المهلة أو not_found أو unknown إنشاء نية جديدة.

بعد انتهاء المهلة استخدموا /campaign-operations/{savedUuid}. لا تلغي not_found طلبًا قيد التنفيذ: استعيدوا النتيجة أو أعيدوا صراحةً UUID/body/ETag نفسها؛ لا تنشئوا UUID إرسال جديدًا ولا تعيدوا إرسال نتيجة unknown تلقائيًا. تابعوا /campaigns/{campaignId}/recipients؛ تعني sent قبول المزوّد، وليس التسليم. فشل الرسالة أو منعها لا يلغي موعدًا أو مستندًا محفوظًا.

صلاحيات هذه الخطوة

campaigns:read

تابع خطوات رسائل العيادة

Behavior

Reads retained campaign recipient history. unknown means an attempted send may have succeeded and must not be automatically retried. A deleted contact can have profileId:null. Follow nextCursor for remaining recipients; a partial page is not the full campaign.

Authentication

ManagementCredential

Credential rules

One server-only owner-issued wbm_ API key can carry both management and integration permissions. Additional permissions require an explicit owner-issued grant. GET /v1/management returns the management discovery view, which may be empty for a booking-only key. For credentials with appointments:read, this discovery view omits whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write to preserve calendar-client compatibility. Discover these grants through GET /v1/management/messaging-capabilities. Template/profile command authorization still uses the stored grants. Server-only owner-issued Management authority with explicit application permissions. Calling this API does not expand a credential's grants. contacts:read/write/block/sync/fields:read/fields:write are separate approvals for canonical business contacts; fields also require current typed owner grants. contacts:record remains contact recording/recovery only. These grants create no customer phone proof, booking authority, messaging consent or automatic synchronization. Hours/blocks retain their independent resource grants. booking-policy:read/write separately delegate whole-business booking settings, without schedule/provider grants; write requires read. They preserve existing appointments and create no duration-rewrite authority. Provider duration policy additionally requires explicit provider-booking-policy:read/write and exact current providerIds; booking-duration:rewrite is separately approved and does not itself grant policy read/write. Service catalogue requires explicit services:read/write, independent of provider/calendar/schedule resources; write requires read. These operations do not expand an existing credential's grants. Public presentation and reviewed service selection require explicit website-content:read/write; write requires read, independently from services:* and provider resources. Existing provider metadata/activity/assignment additionally requires providers:read/write and a nonempty explicit current providerIds grant; write requires read. This grants no provider creation, deletion, login, invitation or schedule authority. WhatsApp template/profile management requires separate whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write application scopes. Write requires its matching read scope. These grants require explicit owner approval; Meta OAuth permissions remain separate.

Required application permissions

campaigns:read

An owner must separately grant campaign access to the whole business or selected active providers. Calendar and customer grants do not imply campaign access. A provider-scoped campaign uses one granted provider and appointment customers. Keep this Management key on your backend.

Request

  • campaignIdpath · stringRequired
    Format and constraints
    campaignId schema
    {
      "type": "string",
      "format": "uuid"
    }
  • statequery · stringOptional
    Format and constraints
    state schema
    {
      "type": "string",
      "enum": [
        "pending",
        "sending",
        "sent",
        "failed",
        "unknown"
      ]
    }
  • limitquery · integerOptional
    Format and constraints
    limit schema
    {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 50
    }
  • cursorquery · stringOptional

    Use the prior nextCursor with the same query. Omit on the first page; an invalid cursor requires restarting the read.

    Format and constraints
    cursor schema
    {
      "type": "string",
      "maxLength": 4096,
      "pattern": "^[A-Za-z0-9_-]+$"
    }

Successful responses

200 · BusinessCampaignRecipientPage

Current authorized result.

Cache-Control
Cache-Control schema
{
  "const": "no-store"
}

application/json · BusinessCampaignRecipientPage

  • itemsarrayRequired

    maxItems: 100

    View nested fields
    • []objectArray item

      Retained campaign-purpose history. A deleted contact may have profileId:null. unknown means a send may have occurred and is never eligible for automatic retry.

      View nested fields
      • recipientIdstring · uuidRequired
      • profileIdanyOf (string | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1string · uuidSchema branch
        • anyOf 2nullSchema branch
      • fullNameanyOf (string | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1stringSchema branch

          maxLength: 1024

        • anyOf 2nullSchema branch
      • phoneNumberstringRequired

        maxLength: 64

      • languageanyOf (string | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1stringSchema branch

          maxLength: 16

        • anyOf 2nullSchema branch
      • languageSentanyOf (string | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1stringSchema branch

          maxLength: 16

        • anyOf 2nullSchema branch
      • statestringRequired

        Allowed values: ["pending","sending","sent","failed","unknown"]

      • erroranyOf (string | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1stringSchema branch

          maxLength: 2048

        • anyOf 2nullSchema branch
      • errorCodeanyOf (integer | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1integerSchema branch

          minimum: -9007199254740991maximum: 9007199254740991

        • anyOf 2nullSchema branch
      • sentAtanyOf (string | null)Required

        At least one of these variants must match.

        View nested fields
        • anyOf 1string · date-timeSchema branch
        • anyOf 2nullSchema branch
      • updatedAtstring · date-timeRequired
      • additionalPropertiesno value allowedSchema rule
  • nextCursoranyOf (string | null)Required

    At least one of these variants must match.

    View nested fields
    • anyOf 1stringSchema branch

      maxLength: 4096pattern: "^[A-Za-z0-9_-]+$"

    • anyOf 2nullSchema branch
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "recipientId": {
            "type": "string",
            "format": "uuid"
          },
          "profileId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "fullName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ]
          },
          "phoneNumber": {
            "type": "string",
            "maxLength": 64
          },
          "language": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ]
          },
          "languageSent": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "sent",
              "failed",
              "unknown"
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "errorCode": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "recipientId",
          "profileId",
          "fullName",
          "phoneNumber",
          "language",
          "languageSent",
          "state",
          "error",
          "errorCode",
          "sentAt",
          "updatedAt"
        ],
        "description": "Retained campaign-purpose history. A deleted contact may have profileId:null. unknown means a send may have occurred and is never eligible for automatic retry."
      },
      "maxItems": 100
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 4096,
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "items",
    "nextCursor"
  ]
}

Errors and recovery

Error responses declared in the contract (7)

The pinned contract shares generic error definitions across operations. This list is not an exhaustive list of runtime errors.

401 · Missing, invalid or expired Management credential.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
403 · Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
404 · Campaign or resource is not available under the current grant. A missing operation lookup returns 200 with status:not_found.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
405 · Unsupported method.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
422 · Invalid request, UUID, query, cursor or precondition format.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
429 · Request rate limit; honor Retry-After.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
503 · Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}