跳转到主要内容
POST
Send WhatsApp conversion event

请求规范

  • 方法与路径: POST /apis/v1/social/messaging/whatsapp/conversions
  • 可用状态: enabled
  • 请求 URL 模板: https://api.aisa.one/apis/v1/social/messaging/whatsapp/conversions
  • connectionId: query; 必填
完整 OpenAPI 定义 有效请求声明(包括认证和引用的 schema):

费用与请求规则

此操作不另收费。

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

查询参数

connectionId
string
必填

Your messaging connection (msc_...), from GET /apis/v1/social/messaging/connections. On a request with a JSON body it may be sent as a top-level body member instead.

Pattern: ^msc_[0-9A-Za-z]+$

请求体

application/json

In addition to the required list, at least one of conversationId or phoneE164 must be supplied (used to resolve the originating CTWA conversation). The route enforces this at the Zod boundary; OpenAPI's required cannot express OR-required cleanly.

eventId
string
必填

Stable dedup key. Reuse to suppress duplicate events (Meta dedupes against pixel events with the same id).

Minimum string length: 1
eventName
enum<string>
必填

Event names accepted by Meta's CAPI for Business Messaging. Other standard pixel events including Lead, CompleteRegistration, Subscribe, Schedule, Contact, StartTrial, AddPaymentInfo, Search, and SubmitApplication are rejected with subcode 2804066 ("Messaging Event Invalid Event Type") on action_source = business_messaging events. Custom event names are also rejected.

Use LeadSubmitted (NOT Lead) when a lead comes in and QualifiedLead once your team qualifies it.

可用选项:
LeadSubmitted,
QualifiedLead,
Purchase,
AddToCart,
InitiateCheckout,
ViewContent,
OrderCreated,
OrderCanceled,
OrderReturned
connectionId
string

The connection, when not sent as the connectionId query parameter.

Pattern: ^msc_[0-9A-Za-z]+$
contentIds
string[]

Optional product / content identifiers.

currency
string

ISO 4217 currency code (e.g. USD).

Required string length: 3
email
string<email>

User email. Normalized + SHA-256 hashed before sending to Meta.

eventTime
number

Unix seconds. Defaults to the time of the request when omitted. Meta's attribution window is 7 days from click; events older than that lose attribution.

externalId
string

Stable customer identifier. Lowercased + SHA-256 hashed before sending to Meta.

phoneE164
string

Contact phone number, digits only with no '+'. When used in lieu of conversationId, the handler resolves to the most recent CTWA-attributed conversation for this phone on the supplied account.

Minimum string length: 1
testCode
string

Meta test_event_code passthrough, sent at the request root (a root-level test_event_code is accepted as an alias). The event shows in Events Manager's Test Events tab for the dataset whose current test code matches. Meta still processes it like any other event, so remove it in production.

value
number

Conversion value (e.g. order total).

响应

Success

eventsFailed
integer

Events rejected by Meta (see failures).

eventsReceived
integer

Events accepted by Meta.

failures
object[]

Per-event failure detail. Empty when all events were accepted.

platform
enum<string>
可用选项:
metaads
testCode
string | null

The test code sent to Meta, or null when the request carried none.

traceId
string

Meta fbtrace_id for debugging. Surface in support tickets.