Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
Shortcut: /, ⌘K or Ctrl+K

Graph API reference

Send Meta Cloud API requests to Polymorfa by changing the base URL and token.

View as Markdown

The Graph API accepts Meta Cloud API requests for your Polymorfa Connections. Keep your existing request bodies, response handling and error parsing; change the base URL and send a Polymorfa credential instead of a Meta access token. It is part of the Messaging API.

Base URL
https://api.polymorfa.com/graph/whatsapp/v26.0

Each task guide shows the Graph request beside the Messaging API request and states what the Graph API supports for that task on each kind of Connection. Choose Graph API in a code block's language selector. For example, see Send messages, Message templates, Download media and Flows.

Choose an API#

Messaging APIGraph API
Paths/messaging/{connection}/…/graph/whatsapp/{version}/{phoneNumberId}/… and /graph/whatsapp/{version}/{wabaId}/…
Request and error shapePolymorfa envelopeMeta's shape and error envelope
VersioningPolymorfa-Version headerVersion segment in the URL; Polymorfa-Version does not apply
FeaturesThe complete Polymorfa catalogThe methods in this reference
CredentialsTeam keys, project tokens and client tokensTeam keys and project tokens; client tokens and Test keys are refused

Use the Graph API to move an existing Meta Cloud API integration. Use the Messaging API for new integrations, for the full event catalog, and for actions the Graph API cannot perform on Linked Devices Connections, such as marking messages read and showing typing. Use the Platform API for Connection management, projects and other team resources. For the steps, see Move a Meta Cloud API integration.

Address a Connection #

Shell
curl -X POST "https://api.polymorfa.com/graph/whatsapp/v26.0/$PHONE_NUMBER_ID/messages" \
  -H "Authorization: Bearer $POLYMORFA_PROJECT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "to": "15551234567",
    "type": "text",
    "text": { "body": "Hello from Polymorfa" }
  }'

The Connection named by {phoneNumberId} decides which connection handles the request. Credential scopes and project ownership are checked before any media, upload, template or Connection effect.

  • A Meta Cloud API Connection uses the phone number ID and WhatsApp Business Account ID that Meta assigned to it. List phone numbers returns the Connections of an account.
  • A Linked Devices Connection uses a phone number ID that Polymorfa assigns. The Connection object exposes phoneNumberId separately from connectionId when available. Webhook deliveries in Meta's format carry it in metadata.phone_number_id.

Versions#

The version segment is required and must match vNN.0. v26.0 is the recommended version. Polymorfa forwards the URL version on operations it sends to Meta and does not replace it. The version does not change Polymorfa's media, phone-number or business-profile methods, or Linked Devices operations. Each method's reference page lists its supported versions.

Connections and capability errors#

Each guide's Graph API statement says whether the task works on Meta Cloud API Connections and on Linked Devices Connections. Those statements describe behavior when the connection and feature are available to your project. They do not grant access.

An operation the selected connection cannot perform returns a Meta-compatible capability error, usually 131026, instead of a Polymorfa envelope. A Graph-shaped route does not add a capability the connection lacks. Check the error before retrying through another connection. Test Connections behave like Linked Devices Connections for business profiles.

Endpoint families#

FamilyPaths
Messages and media/{phoneNumberId}/messages, /{phoneNumberId}/media, /{mediaId}, /{mediaId}/download
Connections and profiles/{wabaId}/phone_numbers, /{phoneNumberId}/whatsapp_business_profile
Templates/{wabaId}/message_templates
Calling and QR codes/{phoneNumberId}/calls, /{phoneNumberId}/message_qrdls
Automation and blocking/{phoneNumberId}/conversational_automation, /{phoneNumberId}/block_users
Commerce and marketing/{phoneNumberId}/whatsapp_commerce_settings, /{wabaId}/product_catalogs, /{phoneNumberId}/marketing_messages, /{wabaId}/marketing_messages/status
Registration/{phoneNumberId}/register, /{phoneNumberId}/deregister, /{phoneNumberId}/request_code, /{phoneNumberId}/verify_code
Uploads and diagnostics/{appId}/uploads, /{uploadId}, /debug_token
WhatsApp Business Account apps and Flows/{wabaId}/subscribed_apps, /{wabaId}/flows

Every path starts with /graph/whatsapp/{version}. The sidebar lists each method with its parameters, bodies, and Meta-shaped responses and errors.

Webhooks in Meta's format#

The Graph API does not create Polymorfa webhooks. Create a webhook with format: "meta" to receive events in Meta's object/entry/changes/value envelope, signed with X-Hub-Signature-256. See Delivery formats.

See also#