Integrate WhatsApp Business with HAP
With the WhatsApp Business integration in nocoly HAP, you can send template messages, receive customer replies, and track message delivery status in message records. This guide walks you through setting up a test number, testing two-way messaging using a single phone, and transitioning to a production account.
Contents
- 1 Prepare Your Account and Understand Message Rules
- 2 Connect Meta to HAP
- 3 Create Templates and Obtain Meta Approval
- 4 Configure Sender Numbers, Credentials, and the Webhook
- 5 Verify the First Send/Receive and Receipts
- 6 Send Various Message Types and Automation
- 7 Switch to the Production Environment and Hand Over to Colleagues
- Technical Reference
1 Prepare Your Account and Understand Message Rules
Prerequisites
- Meta developer account and business assets. Make sure you have permission to manage your enterprise's Business Portfolio and access to the corresponding Meta app and WhatsApp Business Account (WABA). A WABA stores enterprise sender numbers and templates, and the interface may also refer to it as a Messaging account. Meta developer registration · Business settings
- Test number and phone. Use the test sender phone number provided by Meta and a phone that can send and receive WhatsApp messages, with the phone user's consent to participate in testing. Before going live, switch to a business phone number that has been verified and registered with the Cloud API, and complete business verification, account review, and payment setup as required by Meta.
- Management permission for the target HAP organization. Make sure you have permission to install apps or connections, manage apps, and publish workflows in the target HAP organization. To receive customer replies and message status updates, you need a public HTTPS webhook URL accessible to Meta. Obtain this URL from a published HAP trigger.
When to Use Templates
- Obtain customer consent first. Before initiating contact with a customer, make sure they have opted in to receive messages from your business and honor any opt-out requests. WhatsApp business messaging policy
- Send an approved template when proactively initiating a conversation or after the service window closes. Templates can be sent only after approval and must use the approved language and content structure. For testing, start with
hello_worldunder the Meta test account. - Reply with a standard message once the customer sends a message. When a customer sends a message first, or replies after receiving a template, the 24-hour service window opens. Each new customer message resets the window. Within the window, you can send text, media, and interactive messages. Sending a template alone does not start the window; timing begins only after the customer replies. Meta's explanation of the 24-hour reply window
For testing, use the short-lived access token from API Setup. In production, use a system user token with access to the production numbers and WABA. Store test and production credentials separately. Before subscribing, also verify that the production callback returns a non-200 HTTP status for invalid signatures and invalid tokens and does not write business records.
2 Connect Meta and HAP
Start by obtaining a set of test assets from Meta, then run number and template queries in HAP. Once the target number and an approved template appear, you are ready to send.
1 Create an App in Meta and Enable WhatsApp
Open the App Dashboard in Meta for Developers.
If you already have an enterprise WhatsApp app, open the WhatsApp use case in Use cases on this app. To create a new one, follow the three steps below. Meta's creation steps
-
Click Create App, then enter the App name and App contact email.

Figure 1 App name and App contact email on the Create an app page.
-
In Add use cases, select Connect with customers through WhatsApp, click Next, and choose your enterprise's Business Portfolio. If the wizard does not display this use case, review the use cases available to the account or select an existing WhatsApp app owned by your enterprise.

Figure 2 Connect with customers through WhatsApp in Add use cases.
-
In Overview, verify the app, use case, and enterprise, then click Create app. After creation, open the WhatsApp use case from the dashboard.

Figure 3 The WhatsApp use case in Meta App Dashboard.
2 Verify App Permissions
In the WhatsApp use case, open Permissions and features and verify the required permissions and their Status.
whatsapp_business_messagingsends messages.whatsapp_business_managementqueries numbers and templates and manages subscriptions.
After each enterprise installs the Demo, it uses the Meta app and WABA that it manages itself. When integrating only your own enterprise assets, a direct developer can use Standard Access. Pending App Review in the figure is an example status. If a Meta app that you manage integrates with a customer enterprise's WhatsApp assets, verify permissions and review requirements for Tech Provider access. Meta review requirements

Figure 4 The two WhatsApp permissions and statuses in Permissions and features.
3 Select the Number and Copy the ID and Token in API Setup
Open Quickstart → Start using the API → API Setup. For an app that is already configured, open API Setup directly from the left navigation.

Figure 5 The Quickstart page of the WhatsApp use case and the API Setup entry on the left.
-
Select the test account and number. In Messaging account, select the test account, or click Create a WhatsApp Business account to create one. In From, select Meta's test sender number. In To, select the test phone's country code and enter the number, then follow the on-screen prompts to receive and enter the verification code on the phone. After verification, the number can be used as a test recipient.

Figure 6 The sender number, test recipient number, and Access Token in API Setup.
-
Copy the sender number ID. Click the copy icon next to Phone number ID. This Phone Number ID is used in API calls and differs from the phone number displayed on the device.

Figure 7 Phone number ID and the copy button in API Setup.
-
Generate a test token. On the same page, click Generate access token, select the test Messaging account you used above in the authorization window, confirm authorization, return to API Setup, click Copy next to the token, and store the temporary access token securely.
-
Copy the account ID. Save the Messaging account ID (which may also appear as WhatsApp Business Account ID) as the WABA ID. If API Setup does not show it, open the same messaging account in Business Settings → Accounts → Messaging accounts and copy the ID from the details. Older menus may label this WhatsApp accounts.

Figure 8 The account ID in Messaging accounts details.
Keep the WABA ID, the Phone Number ID, and the temporary token authorized for that account together under the same test account. You will use the WABA ID to query templates and the Phone Number ID to send messages.
4 Install the WhatsApp Business Demo
- Log in to nocoly HAP and open the WhatsApp Business Demo app library details.
- Click Install, select the enterprise organization to use, and confirm. Installation also adds the WhatsApp Business connection.
- Return to the home page and open WhatsApp Business Demo → Getting started. HAP app library installation instructions
Install the connection in an existing HAP app
Verify the Connection Version, App Authorization, and Actions
-
In Integration → My Connections → Install, open WhatsApp Business, go to Connection Settings → Connection Parameters, and check
api_version. -
If a working configuration already exists, reuse it. If the field is empty or the version has been discontinued, check Meta's version list and discontinuation dates and select a version that supports the required WhatsApp APIs. Click Edit to update the parameters, then click Save and Continue.

Figure 9 View and edit the API version in Connection Settings.
-
Open Authorize to Application and confirm that the current app appears in the authorization list. If the target app is missing, click Select Applications to add it and click Confirm.
After authorization, WhatsApp Business should appear under the app's Call Integrated API → Select API → Install. If a preset node reports that the API cannot be found, reselect the action with the same name from the installed connection and verify the original parameter bindings. When calling Meta, use the Access Token of the corresponding account.

Figure 10 WhatsApp Business Demo in Authorize to Application.
-
In WhatsApp Business → API Management, verify that the actions are enabled. If an action is missing, check the installation scope and authorization. The Demo's Refresh template requires Get message template.

Figure 11 The API Management page of the installed connection, where you can check whether actions are enabled.
5 Query Test Numbers and Templates
When using the Demo, open Workflows → PBP → Verify WhatsApp assets. A PBP (Packaged Business Process) is a packaged business process that can be tested independently and called by other HAP workflows. If you use your own app, first configure the query processes as described in the technical reference below.
Configure number and template queries in a custom app
Run the Test and View the Results
Click Test at the top of the workflow. On first entry, confirm the prompt and click Continue. In the test window, enter the same set of test credentials. Get test credentials
- For
bearer_token, enter the original test access token generated in Meta API Setup. Test history retains run inputs, so use a short-term test token for integration testing. - For
waba_id, enter the Messaging account ID of the same test account. Enter it as text and keep the full number.

Figure 12 The Access Token and WABA ID input boxes in the PBP test window.
Click Test at the bottom of the window. Open the run in History, select the corresponding node, and click View Output Data.
Locate the target sender number in data of Phone number query. The id in that row is the Phone Number ID you will use later to send messages.

Figure 13 Find the target number in the phone number query result and read data[].id of that row.
Locate hello_world in data of Template query and confirm that language is en_US and status is APPROVED. If it is missing, confirm that you are querying the test WABA. If you specified a template name, check the spelling or clear it and query again.

Figure 14 hello_world, en_US, and APPROVED in the template query result.
3 Create Templates and Obtain Meta Approval
Before an enterprise proactively contacts a customer, prepare an approved template in the WABA that owns the sender number. Use Meta's existing test template for integration testing and a template that matches the actual business for production notifications.
1 Determine Which Template to Use
Use hello_world for test sends. If you found hello_world with en_US and APPROVED in Chapter 2, you can use it. You can also switch to the test WABA in WhatsApp Manager → Message templates to verify. This template has no variables.

Figure 15 The hello_world template and language in Message templates.
Custom templates. Determine the purpose and language first, then write the body. Template names use lowercase English letters, numbers, and underscores. When sending, use the exact approved name and language code.
| Category | Purpose | Example |
|---|---|---|
| Utility | Notifications about an existing transaction or service with the customer | Time change for a scheduled service |
| Marketing | Promotion, event invitation, or re-engagement | Member discount notification |
| Authentication | Identity verification | One-time verification code, using Meta's specified verification template format |
How to write variables. For positional parameters, write {{1}}, {{2}} in order. For named parameters, use lowercase names, for example {{first_name}}, {{appointment_time}}. Use one style consistently within a template. For example, with Hi {{1}}, your appointment is at {{2}}., provide the samples Alex and 10:30 AM when submitting. When sending, fill in the customer name and actual appointment time by position. For named parameters, fill each placeholder by name. Meta template and placeholder rules · Supported language codes
2 Create a Template and View Its Review Status
- In WhatsApp Manager → Message templates, select the WABA that owns the sender number and click Create template. Select the category and language, then fill in the template name, body, and variable examples. If you need buttons, a header, or a footer, add the components allowed by the selected category.
- On the editing page, click Submit for review. Return to the template list and verify the name, language, and Status. Meta instructions for creating templates
- After approval, record the template name, language, and Template ID. Once you configure the HAP sender number and token in the next chapter, you can sync templates in HAP.
| Meta status | What to do next |
|---|---|
PENDING (Pending) | Wait for review. The template cannot be sent or edited while under review. |
APPROVED (Approved) | Can be sent according to the template definition. Editing editable content may trigger re-review. |
REJECTED (Rejected) | Review the rejection reason, modify the editable content, resubmit, and wait for the review result. |
The template name and language cannot be changed through the update action, and approved templates cannot change category. To modify components, submit the complete component definition. Meta template update rules
Read template status in a custom HAP app
4 Configure Sender Numbers, Credentials, and the Webhook
The Demo includes four preset worksheets. Add sender numbers and templates as described in this chapter, and add test contacts for test sends.
- WhatsApp Numbers manages sender numbers. Use WABA ID and Phone Number ID to map each record to the Meta account and number, then assign it to a sender.
- WhatsApp Templates manages message templates. Verify Template name, Language, and Meta status.
- WhatsApp Contacts manages customers. Find customers by Contact name and WhatsApp number, and send messages or view Chat history from the contact details.
- WhatsApp Messages stores messages. Find a record by Message ID and view its Content and Status. Drafts, Inbox, and Outbox display draft, inbound, and outbound messages respectively.
1 Configure Sender Numbers and Credentials
Add a Sender Number
- On the left side of the Demo, open WhatsApp Numbers and click + Record in the upper right corner.
- Enter an easily recognizable Name for the number, for example
Meta test sender. Copy the Messaging account ID (or WhatsApp Business Account ID) from Meta API Setup into WABA ID, and enter the ID of the number you selected in From into Phone Number ID. - In Assigned member, select the member who will click Send message. If you are sending the test yourself, select yourself. Select Enabled and click Submit to enable the number. Each member uses one enabled sender number.

The new record form of WhatsApp Numbers. Fill in the number ID, assign a member, and check Enabled.

Figure 16 In WhatsApp Numbers, save the WABA ID, Phone Number ID, and enabled status for each sender number.
Set Global Variables
In the Demo's App Management → Global Variables, fill in the preset variables and save. To complete the full send and receive test, fill in the first three variables. For test sending only, fill in wa_access_token.
- Sending messages requires
wa_access_token. Enter a Meta access token with permission to use the sender number. - Receiving replies and receipts requires
wa_app_secretandwa_verify_token. The former comes from Meta's App settings → Basic → App secret and verifies signatures. The latter is a value you define to verify callbacks; enter the same value in HAP and Meta. - To automatically save attachments sent by customers, also fill in
wa_hap_attachment_app_keyandwa_hap_attachment_sign. Next to the Demo app name in HAP, open API Developer Docs → Authorization Management → Create Authorization Key. Create an authorization that can update WhatsApp Messages records, and copy the AppKey and Sign from the same authorization group. Configure attachment saving
A custom app can store these credentials per Meta app. When integrating multiple Meta apps, configure credentials and receiving workflows for each app, and also scope number queries to the owning app. HAP global variables
2 Sync Approved Templates in HAP
A custom app can use the template name and language returned by the query directly. When using the Demo, sync Meta's templates to WhatsApp Templates so customer service can select from Approved template.
-
Open WhatsApp Templates → + Record. For testing, enter
hello_worldas Template name anden_USas Language. Scroll down to Sender number, select the test number you just configured, and click Submit.
The upper part of the new record form of WhatsApp Templates. Fill in Template name and Language.

The lower part of the new record form of WhatsApp Templates. Scroll to Sender number and select the configured sender number.
-
Open the template record and click Find templates. In Query results JSON, locate the result with the same name and language, copy its
idinto Template ID, and save. If a Template ID already exists, you can refresh directly. -
Click Refresh template and confirm that Meta status shows
APPROVED. If the template is not found, verify the WABA, token, and template language for the Sender number. If the query or refresh fails, check Operation error.
Create and modify templates in the Demo
3 Configure Sending and Attachment Upload
The Demo includes a preconfigured message sending workflow that sends messages using the sender phone number assigned to the member and uploads attachments from the form. A custom app must configure the send action and result write-back first.
Configure the sending process in a custom app
4 Configure the Receiving Process
The webhook is the entry point through which Meta sends customer messages and status changes to HAP. Receiving a customer message starts the 24-hour reply window; receiving sent, delivered, or read updates the corresponding outbound message.
Open Workflows → Receive WhatsApp events and confirm that the Demo's receiving workflow is enabled and published. If you are building your own workflow, follow the technical reference below to configure the trigger, signature verification, and logic for saving records to the worksheet. Then configure the synchronous response and publish the workflow.
Configure the webhook, signature verification, and receipt handling in a custom app
If you need to automatically save attachments sent by customers, configure attachment save settings.
5 Verify the Callback and Subscription in Meta
Obtain the Published HAP Callback URL
Open the app's published webhook trigger and click Copy Link. Use this address both for the initial callback configuration and for setting the test account's dedicated callback.
Synchronous response configuration for custom processes
Configure the App Callback for the First Time
A newly created Meta app can set the default callback here. If a default callback already exists, set an independent address as described in the test account access instructions.
-
In Meta, open WhatsApp → Configuration; you can also navigate from Use cases → Customize → Configuration. In Callback URL, enter the published HAP callback URL. In Verify token, enter the value bound to
expected_tokenin the HAP signature verification node. Click Verify and save. Once verification passes, return to Webhook fields, findmessages, turn on the Subscribe switch, and confirm that the row shows Subscribed.
Figure 17 Meta's WhatsApp → Configuration. In Callback URL, fill in the HAP Webhook URL that just passed GET verification.
-
In the HAP administrator test PBP, call List account webhook subscriptions using the test token of the same Meta app and the target test WABA ID. If
dataalready contains this app, verify the effective callback URL. -
If the target WABA is not yet subscribed and uses the app callback you just configured, run Subscribe application to account. Use the same
bearer_tokenandwaba_idinputs as the previous step and leave the override parameters empty. Clicking Test creates an actual subscription in Meta. Once the response returnssuccess=true, run the query again and verify that the current app appears indata.
Access a test account when a Meta callback already exists
After Verify and save, check that Meta's messages shows Subscribed, the WABA subscription result contains the current app, and the effective address points to this HAP app. The next chapter uses real messages and receipts to verify that events arrive.
5 Verify the First Send/Receive and Receipts
Use the same test phone verified in Meta to receive the template and send a reply, then quote and reply from HAP. Finally, verify the receipts of both outbound messages. Before you start, confirm that the test sender number is saved, the template is approved, and the receiving workflow and Meta subscription are ready.
1 Send a Test Template
-
In the Demo, open WhatsApp Contacts → Conversations and search for the verified test phone using digits only, including the country code. If no record exists, click create, enter a Contact name (for example
Test contact) and the WhatsApp number, and click Submit to save. If the system reports that the number already exists but you cannot find the record, ask the administrator to authorize the original contact in Manage contact access.
The new record form of WhatsApp Contacts. Fill in Contact name and WhatsApp number with country code.
-
Open the contact details and click Send message. Set Message format to Template and select
hello_world(en_US) in Approved template. The form displays a Hello World preview with no variables to fill. You can enterWhatsApp test templatein Message. -
Click Submit, view the new outbound record in Chat history, and confirm that the test phone receives Hello World.

Figure 18 The test phone receives the Hello World template.
For a custom app, create a Template outbound record, select an enabled Sender number, and enter the test recipient number, hello_world, and en_US. Trigger the template branch with Send message in the message table, and verify that the outbound record writes back the Message ID.
If the template is not received, first check whether Meta has verified the recipient number. The sender number must be Enabled, and the Demo's Assigned member must be the person who clicked send. If the status is invalid or failed, check Send error. If the error code is 131030, verify that the test recipient is on Meta's allow list. If the status is check result, review the workflow History, confirm the previous result, and then decide whether to retry.
2 Reply from the Test Phone
On the test phone, send a text message in the same WhatsApp conversation, for example I received the test message.. This incoming message opens the 24-hour reply window.

Figure 19 Example of the phone effect. Send I received the test message. in the Test Number conversation.
-
Return to WhatsApp Contacts and open the same contact.
-
In Chat history, find the message the phone just sent and confirm the body and the
receivedstatus. A custom app can check the inbound message and its Message ID directly in WhatsApp Messages → Inbox.
Figure 20 The current Inbox view of WhatsApp Messages. Open the inbound text record to view the complete body, status, and message ID.
If Chat history has no new entry, go to WhatsApp Messages → Inbox and search for the recipient phone number. If an inbound record exists, verify the Contact association and conversation permissions. The Demo's Link WhatsApp messages to contacts matches contacts by Customer number against the contact's WhatsApp number; when no contact is found, it creates one and writes Contact.
If Inbox is also empty, check Receive WhatsApp events → History. If an inbound callback exists, check the signature verification, WABA ID, and number record. If you see only receipts or no new runs, verify Meta's effective callback URL and conversation routing.
Delivery receipts arrive but phone replies do not
3 Quote the Customer Message in HAP and Send a Reply
Within 24 hours of the customer's most recent message, you can send a text reply directly.
-
In the same contact details, click Send message and set Message format to Text. Enter
WhatsApp test replyin Message andThanks. We received your reply.in Content. -
In Quote message, select the customer message you just received and click Submit. For a custom app, fill in Content on the outbound text record and bind the inbound Message ID to
contextMessageId. -
Return to Chat history and find the reply. On the test phone, the reply bubble should show the customer's original text above it.

Figure 21 Example of the phone effect. Customer service quotes the customer's original text and replies Thanks. We received your reply.
If the reply is not sent, check Send error. Confirm that the incoming message was received inbound, is still within the 24-hour window, and that the reply uses the same sender number. If 131070 is returned, verify conversation routing and receiving rights as described in the previous troubleshooting step.
4 View Receipts for Both Outbound Messages
Check the Status of both outbound messages in the contact's Chat history. accepted means Meta accepted the message, sent means sent, delivered means delivered, and read means read. The test passes when both outbound messages reach delivered or read. If WhatsApp does not return read receipts, use delivered to confirm delivery.
Administrators can open both outbound records in WhatsApp Messages → Outbox and view their Message ID. If the status has not updated for a long time, confirm in Receive WhatsApp events → History that statuses[].id in Meta's receipt matches the message's Message ID. If a receipt arrives but the status does not change, review the run of Project WhatsApp delivery status. For failure codes, see errors[].code in the receipt.

Figure 22 The current Outbox view. Find the outbound message and open the record to view Message ID and Status.
6 Send Various Message Types and Automation
Send Manually from Contact Details
- Open WhatsApp Contacts, enter the customer details, and click Send message. The recipient number comes from the current contact's WhatsApp number, and the sender number comes from the number configuration assigned to you.
- In Message format, select a type, complete the fields as described below, and click Submit.
- Check Status in Chat history. Administrators can also go to WhatsApp Messages → Outbox to view the message's Message ID.
Send Automatically from a Business Workflow
For example, when an appointment time changes, use a business record to trigger Call Integrated API → Send template message. Map the customer name and new appointment time to approved template variables, and take the number and token from the enterprise's sender configuration.
- Select the customer and confirm sending eligibility. Read the contact from the trigger record and confirm that the customer has agreed to receive this type of message. Normalize the number to digits only, including the country code. If the customer cannot be found, the number does not match, or there is no sending permission, end the run.
- Select the message type. Use the customer's most recent inbound message to the current sender number to calculate the 24-hour window. To send proactively outside the window, select an approved template under this WABA. Inside the window, send standard messages as needed.
- Prevent duplicates per business event. Use the business record and event identifier to check whether a message has already been sent for the same event. If an outbound Message ID already exists or a submission is in progress, skip. If simultaneous triggers are possible, process the same event serially or save a pending-send record with a unique identifier first. If the result is unclear, check History and do not resend until you confirm.
- Call the API and write back. Map
phone_number_idfrom the sender number configuration, takebearer_tokenfrom managed credentials, and bindtoto the verified customer number. Add body or media parameters as required by the message type. Whenmessages[0].idis returned, write back the Message ID and update the status from receipts later. On send failure, recorderror.code. Custom send node configuration
Message Type Quick Reference
- Notifications and conversations: Template message · Text message
- Media and attachments: Image message · Video message · Audio message · Document message · Sticker message
- Profile cards: Location message · Contact message
- Interactive messages: Reply button message · Option list message · URL button message · Message reaction
For media messages, upload a file in File or enter a public HTTPS link that Meta can access directly in Media URL. A custom workflow can bind a HAP attachment field directly to Upload media and then use the returned Media ID. The Demo records the Media ID automatically, and the receiving process fills the inbound Media MIME type. The sending form only requires a file or link. For large files, first verify the size and format limits of the selected media type, along with HAP's attachment processing limit. Configure attachment upload · Meta media formats and size limits
Notifications and Conversations
Template Message
Select Message format → Template, then select an approved template of the WABA that owns the sender number in Approved template. The form displays the required variables and examples based on the template. After completing them, verify the actual content in Message preview. Templates without variables can be verified directly in the preview. Sync templates
API parameters and workflow configuration
Text Message
Select Message format → Text and enter the body in Content, for example Thanks. We received your reply.. To quote a message in your reply, select the original message from the same conversation in Quote message.
API parameters and workflow configuration
Media and Attachments
Image Message
Select Message format → Image, add an image to File, or enter a Media URL. Enter the caption in Caption.
API parameters and workflow configuration

Figure 23 Example of the phone effect: a package image, video thumbnail, and PDF attachment in the conversation.
Video Message
Select Message format → Video, add a video to File, or enter a Media URL. Enter Packing update in Caption.
API parameters and workflow configuration

Figure 24 Example of the phone effect: cover, play button, and duration on the video card.
Audio Message
Select Message format → Audio, add audio to File, or enter a Media URL.
API parameters and workflow configuration

Figure 25 Example of the phone effect: audio playback bar and sticker in the conversation.
Document Message
Select Message format → Document, add a file such as a PDF to File, or enter a Media URL. Enter sample-invoice.pdf in Media filename and add a Caption as needed.
API parameters and workflow configuration

Figure 26 Example of the phone effect: the received PDF shows the file name and download button, with the document caption below.
Sticker Message
Select Message format → Sticker, add a compliant WebP to File, or enter a Media URL.
API parameters and workflow configuration

Figure 27 Example of the phone effect: the sticker is displayed directly in the conversation and does not use a normal text bubble.
Profile Cards
Location Message
Select Message format → Location, enter Latitude and Longitude, and optionally Place name and Address. Use decimal values for latitude and longitude, for example pickup point latitude 37.7936 and longitude -122.3958.
API parameters and workflow configuration

Figure 28 Location card and contact card in the conversation.
Contact Message
Select Message format → Contact. On the business card, enter First name, Display name, and Contact phone. Last name and Contact email can be left empty. Enter the business card number in Contact phone; the recipient is still the current contact.
A Meta contact message can contain multiple business cards and can also include an address, company information, or a website. The API requires name.formatted_name, and the Demo additionally requires first_name and the business card phone number. wa_id in the business card is the contact's WhatsApp ID. The Demo writes the business card number into phone, so the recipient sees Invite to WhatsApp. When a known wa_id is provided, Meta can display Message and Save contact. Meta contact fields and button rules
API parameters and workflow configuration

Figure 29 Contact card in the conversation; when wa_id is not provided, Invite to WhatsApp is displayed.
Interactive Messages
Reply Button Message
Select Message format → Reply buttons, enter How can we help? in Content, and configure buttons using fields such as Button 1 ID and Button 1 title. In the example, the button IDs are track_order and contact_support, and the display titles are Track order and Contact support. When adding buttons or changing titles, see Meta's limits on button count and title length.
API parameters and workflow configuration

Figure 30 Example of the phone effect: reply buttons, list entry, URL button, and message reaction in the conversation.
Verify the Selected Reply
On the test phone, tap Track order or Contact support. In WhatsApp Messages → Interactive replies, find the corresponding record with status received, verify that Choice ID is track_order or contact_support, and check the original button message via Related message ID. Button replies appear as button_reply in the callback, and option list replies appear as list_reply. Meta reply buttons

Figure 31 The current Interactive replies view. Button and list replies each display Content, Choice ID, and Status.
Option List Message
Select Message format → Option list. Enter Choose a delivery slot. in Content and View slots in Open list button text. Define sections and options in Sections JSON. The option count is the total across all sections; see Meta's section and option limits.
[{"title":"Delivery slots","rows":[{"id":"tomorrow_am","title":"Tomorrow morning"},{"id":"tomorrow_pm","title":"Tomorrow afternoon"}]}]
API parameters and workflow configuration

Figure 32 Example of the phone effect: Tomorrow morning is selected in the View slots list, with the Send button below.
URL Button Message
Select Message format → URL button and enter Content, Button title, and Button URL. In the example, the body is Track your order. and the button title is Track order. Before testing, replace the link with a page the phone can open.
API parameters and workflow configuration

Figure 33 Example of the phone effect: the Track order external link button below an order notification.
Message Reaction
In the customer details, click Send message and select Message format → Reaction. In Quote message, select the message to react to, and enter 👍 in Emoji. To remove a reaction, select the original message again in the same conversation and leave the emoji empty. Before sending, see Meta's limits on target message types and time ranges.
API parameters and workflow configuration

Figure 34 Example of the phone effect: the like mark is attached below the corresponding message, indicating a reaction to this message.
7 Switch to the Production Environment and Hand Over to Colleagues
First confirm the production account, numbers, and permissions as described below, then switch the production credentials and verify the callback. Finally, hand the app over to enterprise colleagues.
1 Verify the Enterprise Account, Numbers, and Publishing Status
-
In Business Settings, confirm that the app and the production WhatsApp business account belong to this enterprise. Complete business verification as required on the page. Business Settings · Business verification
-
Open WhatsApp Manager → Phone numbers. Confirm that the production number is verified, registered with Cloud API, and shows Connected.

Figure 35 A test number showing Connected in WhatsApp Manager.
-
If the number is in use in the phone app, follow Meta's migration or coexistence process. Cloud API number registration
Verify the production account's health status and messaging limits. In Billing Hub, confirm that the production account's payment method is valid.
If the Meta app needs to be published, review its requirements in App Dashboard → Publish. Complete the app profile, privacy policy, and any applicable review as indicated on the page, perform Go live, and then check the publishing status. The actual app type and the controls provided by the backend take precedence.

Figure 36 The WhatsApp use case and publishing status on the Publish page.
2 Generate a Production System User Token
-
In Meta Business Settings → Users → System users, select a system user for the enterprise that owns the production account, or create one.
-
Open Assigned assets. Assign Manage app or Full control for the target app, and grant the corresponding WhatsApp account and Messaging account permissions. Meta Business Settings

Figure 37 Assigned assets and the Generate token button in System users.
-
Click Generate token and select the production app. In Set expiration, choose a validity period that meets enterprise requirements. Generate system user token

Figure 38 Select the validity period of the system user Token in Set expiration.
-
In Assign permissions, select
whatsapp_business_messagingandwhatsapp_business_management. If you need to query apps and accounts under the enterprise through the API, also selectbusiness_managementas required.
Figure 39 The two WhatsApp permissions in Assign permissions.
-
Save the generated token to the production app's credential configuration and record its validity period.

Figure 40 The Permanent token area in WhatsApp Configuration.
3 Configure Send and Receive Processes in the Production App
Prerequisites for the Production Callback
The current Demo rejects invalid requests and skips business writes but still returns HTTP 200, so this callback configuration is for testing only.
Before production integration, use HAP Send API Request → Test API to check the actual HTTP status. A valid GET should return HTTP 200 and the original challenge; a valid POST should return HTTP 200. An invalid token or signature should return a non-200 status and must not add records to business tables. Once these requirements are met, subscribe the production account.
Generate a callback test signature in HAP
- Make the production app use the connection. Add the production app in HAP's Authorize to Application. In the production app, replace
wa_access_tokenwith the system user token, and fill in the production Meta app'swa_app_secretand callback verification valuewa_verify_tokenseparately. In the number table, enter the WABA ID and Phone Number ID for each production sender number. When using the Demo, assign the members who use the number in Assigned member. Verify connection and authorization · Configure send and receive workflows - Verify production numbers and templates. Use List business phone numbers to confirm that the sender number belongs to the production account. Before sending templates, confirm in List message templates that the template for the required language is
APPROVED. - Verify the production recipient scope. Before sending, locate the customer from the business record or draft, normalize both the draft number and the customer number to digits only with the country code, and compare them. Confirm that you have permission and that the customer has agreed to receive this type of message. If automatic sending is required, verify message selection, deduplication, and write-back as described in the business workflow sending steps.
- Verify and subscribe the production callback. First verify the signature and HTTP status as described in production callback verification, then confirm that
messagesis enabled for the production app, the production WABA is subscribed, and the effective address points to the production process. - Run production acceptance. With an approved recipient, send a message, receive a reply, and send a reply. Verify the outbound Message ID, the reply's Related message ID, and the actual receipts. Confirm that duplicate events are processed only once and that all events in the same batch are written to the table, then enable automatic sending.
4 Hand Over to Internal Users
How Administrators Enable Access
- Confirm that colleagues have HAP organization accounts. Members already in the organization can be added directly. For new employees, the organization administrator opens the avatar menu → Org Admin → User & Department → Add User, sends an invitation to join the organization, and waits for the employee to activate the account. Invite organization members
- Add an application role. Open the installed WhatsApp Business Demo, go to User, select WhatsApp Agent → Add Users, and add the colleagues responsible for replying. Configure role members
- Assign sender numbers. In WhatsApp Numbers, open an enabled enterprise number and select the customer service representative responsible for it in Assigned member. Each member uses one enabled number. To hand over, change the assigned member on the same number record; the workflow then syncs access to historical messages under that number.
- Share the app entry with colleagues. Send the link to the Demo installed by the enterprise to authorized colleagues. After they log in to HAP, they can open the app from the home page. On first entry, use a customer service account to confirm that it can open contacts for its own number, view Chat history, and click Send message.
New incoming messages are associated with an existing contact or create a new one. If an existing customer cannot be found, the administrator searches for the customer number in WhatsApp Contacts → Manage contact access and adds the customer service representative to Conversation members. Assigned member determines which sender number is used, and Conversation members determines who can open the contact record.
How Customer Service Sends and Receives Messages
- Find customers and new messages. Open WhatsApp Contacts → Conversations and search for the customer by number with the country code. View inbound messages in the contact details' Chat history. Administrators can also open WhatsApp Messages → Inbox to view inbound records.
- Reply to the customer. In the same contact details, click Send message. Within 24 hours of the customer's most recent message, select Text and write the body; to quote, select the original message in Quote message. To send images, files, or interactive messages, follow the form instructions for each type.
- Contact customers proactively or continue a closed conversation. Select Template, then choose a company-approved template from Approved template. Complete the variables as prompted, review Message preview, and click Submit.
- Check receipts. Return to Chat history and verify Status:
deliveredmeans delivered andreadmeans read. On failure, open the message to view Send error. Status and troubleshooting
Technical Reference
Open the relevant step when you need to configure this integration in an existing HAP app or troubleshoot callbacks.
Connection and Template Management
Install the Connection in an Existing HAP App
-
Log in to nocoly and switch to the enterprise organization that will integrate WhatsApp.
-
Open Integration → API Library → Public, search for WhatsApp Business, and open the connection details.

Figure 41 Search for WhatsApp Business in the Public category of API Library.
-
Click Install Now and select the actions your custom process needs. For initial send and receive, select List business phone numbers, List message templates, Get message template, Send template message, Send text message, Subscribe application to account, and List account webhook subscriptions. To upload attachments, also select Upload media; to save inbound attachments, also select Get media download URL.

Figure 42 The action list of WhatsApp Business and the Install Now entry.
Configure Number and Template Queries in a Custom App
- In the test app, open Workflows → PBP → Create New PBP and create a standalone query process. Add two Text inputs,
bearer_tokenandwaba_id, on the start node and leave their default values empty. Create PBP - Add Call Integrated API to the canvas. Under Select API → Install → WhatsApp Business, select List business phone numbers. Add another node and select List message templates.

Figure 43 The phone number query and template query actions in Select API.
Open Pass Parameters for List business phone numbers. Click the value button next to each required field and select PBP → bearer_token and PBP → waba_id respectively. During initial verification, you can leave fields, filtering, sort, limit, and the pagination cursor empty. After mapping, click Save.

Figure 44 The phone number query uses bearer_token and waba_id provided by PBP.
Open List message templates and map the same two required parameters. To query a known template, enter its exact name in name, for example hello_world. To browse account templates for the first time, leave name empty; the result may then show only one page. When finished, click Save.

Figure 45 The template query uses the two PBP parameters, with name left empty.
Read Template Status in a Custom HAP App
In the query PBP from Chapter 2, use List message templates to query templates by waba_id and name. Locate the correct version by name and language and note the id of that row. If the ID already exists, select Get message template in Call Integrated API, bind the same Meta app's bearer_token, and enter the ID in template_id. Check status in History → View Output Data and send only the APPROVED version.
Create and Modify Templates in the Demo
- Create a record in WhatsApp Templates. Select the configured Sender number and enter Template name, Language, and Category. When using variables, complete Parameter format (
positionalornamed) and Definition components JSON according to the definition. For example, set Parameter format topositionaland enter[{"type":"BODY","text":"Hi {{1}}, your appointment is at {{2}}.","example":{"body_text":[["Alex","10:30 AM"]]}}]in Definition components JSON. The actual name and time are provided at send time. Meta template component structure - After saving, click Create template in the record. This submits the template to Meta. Once Template ID is returned, use Refresh template to check the review status until it shows
APPROVED. - If a Template ID already exists and Meta allows editing, update the component definition in the record, click Update template, then use Refresh template to confirm the latest review status. If the operation fails, open Operation error for details.
- To prepare a draft first, administrators can use Prepare message draft to write the template name and language into the draft. For daily sending, select an approved template directly from the contact details.
Sending and Receiving Workflows
Configure the Sending Process in a Custom App
-
Create a send button. In WhatsApp Messages → Form Settings → Custom Action → Add Button, create Send message and select Execute a workflow directly → Single Record. The button is available only for outbound records with status
draftand an empty message ID. After saving, create two branches, Template and Text, based on Message format. Add one Call Integrated API node to each branch and select Send template message and Send text message respectively from the installed WhatsApp Business. Configure custom actions
Figure 46 In the Install category of Select API, select send actions from WhatsApp Business.
-
Read the sender number and bind parameters. Before the branch, add Get Single Data → Get Related Records. Select the trigger record as the source, select Sender number as the related field, and filter by Enabled → Selected. If no enabled number is found, stop sending. Then fill in Pass Parameters for both send actions using the sources below. Read related records
bearer_tokencomes from the original Meta access token with permission to use the sender number.phone_number_idcomes from the Phone Number ID found in the previous step. When replying to a customer, use the number associated with the inbound record.tois the recipient's number in digits only, including the country code, for example12025550123. For integration testing, use a test recipient verified by Meta.- If the action provides
messagingProductandrecipientType, enterwhatsappandindividualrespectively. To quote a message in a reply, pass the Message ID of the customer's inbound message tocontextMessageId.
-
Fill in the message content. In the template branch, set
type=templateandtemplateLanguagePolicy=deterministic, and bindtemplateNameandtemplateLanguageCodeto the record's Template name and Template language code. For a test send, enterhello_worldanden_USin the record and leave components empty. In the text branch, settype=text, bindtextBodyto Content, and bindcontextMessageIdto Related message ID. -
Upload first when attachments are required. Call Upload media with the same token and sender number ID. Bind
fileto the HAP attachment field and setmessaging_producttowhatsapp. Use the returnedidas the Media ID for the subsequent send action. When sending media, provide either the ID or a public link.
Figure 47 Upload media takes the attachment from the draft and the Phone Number ID from the selected number configuration.
-
Save the send result. After the send action, add Update Record and select the message record from the trigger button. When
messages[0].idexists, write the Message ID, set Message type to this branch's type, and set Status toaccepted. When the server explicitly returns a failure, writeerror.codeinto Send error and set Status tofailed. If the result is unclear, check the run details in History before deciding whether to retry. Update records
If you use your own message table, set Record kind to Message, Direction to outbound, and Status to draft when creating an outbound draft. After publishing, Send message appears on pending-send records. Continue to associate Sender number with the number record so that replies and receipts are processed by the corresponding number. HAP table view · Submit and stash draft
Configure the Webhook, Signature Verification, and Receipt Handling in a Custom App
Generate Input Fields with a Sample Request
Send a sample request first so the trigger can generate bindable query parameters, request headers, and the raw body used for signature verification.
-
In Workflows, create a receiving workflow and select Trigger by Webhook as the trigger method. Open the trigger and select Generate from Request Example. In the panel waiting for requests, select Generate Full Body Parameters, click Copy Link to copy the sampling address, and keep the panel open. Send the sample request in the next step before the countdown ends. After sampling, copy the address again from the published trigger to enter in Meta.

Figure 48 HAP's Webhook sampling window. Copy the Webhook URL here and check Generate Full Body Parameters.
-
In another HAP administrator test workflow, click + below the trigger and add Send API Request → Send Custom Request. Select POST as the method and clear Custom status codes. Fill in the following three items and click Test API. HAP API request node
-
For API URL, enter the Webhook URL copied in the previous step and append the line below to the end of the address. If the address already has query parameters, replace the leading
?with&.?hub.mode=subscribe&hub.verify_token=sample&hub.challenge=001234 -
In Headers, add
X-Hub-Signature-256and set the value tosha256=sample. -
For Body, select raw → JSON and enter
{"object":"whatsapp_business_account","entry":[]}. These placeholder values only help HAP recognize the fields.

Figure 49 HAP's Send custom request node. Fill in the POST address, Headers, and raw JSON body, and then click Test API below.
-
-
Switch back to the sampling panel of the receiving workflow and confirm that
hub.mode,hub.verify_token,hub.challenge,X-Hub-Signature-256, and Full Body appear. Keep these inputs as optional Text and save. The signature header uses the name shown by HAP sampling and may appear in lowercase.
Validate Meta Requests
After the trigger, add Code → JavaScript. In Define input object, enter the variable name on the left and select the field source on the right.
mode,token, andchallengemap tohub.mode,hub.verify_token, andhub.challengeunder Trigger by webhook → Request Params respectively.bodymaps to Request Body → Full Body (the interface may also label this Body Full Text), andsignaturemaps to Request Header → X-Hub-Signature-256.expected_tokenmaps to the configured Verify Token, andsecretmaps to App Secret. If you use app-level variables, select the corresponding variable from the value menu on the right.

Figure 50 The input of the signature verification node includes query parameters, raw body, signature header, and verification credentials.
Paste the following script into Code Block.
const crypto = require("crypto");
function equalText(left, right) {
if (!left || !right) return false;
const leftBytes = Buffer.from(String(left), "utf8");
const rightBytes = Buffer.from(String(right), "utf8");
return leftBytes.length === rightBytes.length &&
crypto.timingSafeEqual(leftBytes, rightBytes);
}
function handle(request) {
const rejected = { response_body: "REJECTED", signature_valid: false, challenge: "" };
if (request.mode === "subscribe") {
if (!equalText(request.token, request.expected_token) ||
typeof request.challenge !== "string" || !request.challenge) return rejected;
return { response_body: request.challenge, signature_valid: false, challenge: request.challenge };
}
if (request.mode || typeof request.body !== "string" || !request.secret) return rejected;
const signature = "sha256=" + crypto.createHmac("sha256", request.secret)
.update(request.body, "utf8").digest("hex");
if (!equalText(signature, request.signature)) return rejected;
let payload;
try {
payload = JSON.parse(request.body);
} catch {
return rejected;
}
if (!payload || payload.object !== "whatsapp_business_account" || !Array.isArray(payload.entry)) return rejected;
return { response_body: "EVENT_RECEIVED", signature_valid: true, challenge: "" };
}
output = handle(input);
Test the Signature Verification Node First
POST signature verification tests and event parsing tests both use the single-line body below. Enter the example values in the Test dialog and keep the dynamic mappings above when saving. Keep body exactly as copied; spaces and line breaks change the signature.
{"object":"whatsapp_business_account","entry":[{"id":"waba-test","changes":[{"field":"messages","value":{"metadata":{"phone_number_id":"phone-test"},"messages":[{"id":"wamid.inbound-test","from":"12025550123","type":"text","text":{"body":"Hello"},"timestamp":"1796020000","context":{"id":"wamid.outbound-test"}}],"statuses":[{"id":"wamid.outbound-test","status":"delivered","timestamp":"1796020001"}]}}]}]}
-
Verify GET. Click Test in the signature verification node, enter the following inputs, and leave the rest empty.
- Set
modetosubscribe. - Set both
tokenandexpected_tokentodemo-verify. - Set
challengeto001234.
Expected result:
response_bodyreturns001234unchanged. - Set
-
Verify the POST signature. Click Test again in the same node, clear the previous inputs, and enter the following three items.
- Paste the single-line body above into
body. - Set
secrettowebhook-test-secret. - Paste the following line into
signature.
sha256=b9cd8d0de88ada1357424856c0c7cac6937055269a95bf110b798ca0c90ebf82Expected result:
response_bodyreturnsEVENT_RECEIVEDandsignature_validistrue. - Paste the single-line body above into
After both tests pass, save the signature verification node. The signature verification node's response_body should then appear in the parsing node's input selector.
Extract Customer Messages and Delivery Receipts
After the signature verification node, add a second Code → JavaScript and set the following inputs in Define input object.
bodystill maps to Trigger by webhook → Request Body → Full Body.modemaps to the trigger'shub.mode.response_bodymaps to the same-named output of the signature verification node. The script parses only POST requests that pass signature verification; GET verification and rejected requests return an empty array.

Figure 51 The parsing node binds the raw body, hub.mode, and the signature verification node's response_body.
function items(value) {
return Array.isArray(value) ? value : [];
}
function textValue(value) {
return value == null ? "" : String(value);
}
function normalize({ body, mode, response_body }) {
const result = { messages: [], statuses: [] };
if (mode || response_body !== "EVENT_RECEIVED") return result;
let payload;
try {
payload = JSON.parse(body);
} catch {
return result;
}
if (!payload || payload.object !== "whatsapp_business_account") return result;
for (const entry of items(payload.entry)) {
if (!entry || !entry.id) continue;
for (const change of items(entry.changes)) {
if (!change || change.field !== "messages") continue;
const value = change.value;
if (!value || !value.metadata || !value.metadata.phone_number_id) continue;
const scope = {
waba_id: textValue(entry.id),
phone_id: textValue(value.metadata.phone_number_id)
};
for (const msg of items(value.messages)) {
if (!msg || !msg.id || !msg.type) continue;
const content = Object.prototype.hasOwnProperty.call(msg, msg.type) ? msg[msg.type] : null;
const fields = content || {};
const media = ["image", "video", "audio", "document", "sticker"].includes(msg.type) ? fields : {};
const choice = fields.button_reply || fields.list_reply || {};
result.messages.push({
...scope,
message_id: textValue(msg.id),
from: textValue(msg.from),
message_type: textValue(msg.type),
timestamp: textValue(msg.timestamp),
text: textValue((msg.text && msg.text.body) || media.caption || choice.title),
related_message_id: textValue((msg.context && msg.context.id) || (msg.reaction && msg.reaction.message_id)),
choice_id: textValue(choice.id || (msg.button && msg.button.payload)),
media_id: textValue(media.id),
content_json: content == null ? "" : JSON.stringify(content)
});
}
for (const status of items(value.statuses)) {
if (!status || !status.id || !status.status) continue;
const firstError = items(status.errors)[0];
result.statuses.push({
...scope,
message_id: textValue(status.id),
status: textValue(status.status),
timestamp: textValue(status.timestamp),
error_code: textValue(firstError && firstError.code)
});
}
}
}
return result;
}
output = normalize(input);
After pasting and saving the script in the parsing node, click Test. Paste the same single-line body into body, leave mode empty, and set response_body to EVENT_RECEIVED.
Expected result: each of the two output groups contains one record, and every row has waba_id set to waba-test and phone_id set to phone-test.
- In
messages,message_idiswamid.inbound-test, andtextisHello. - In
statuses,message_idiswamid.outbound-test, andstatusisdelivered.
After confirming that each output group has one row, save. Subsequent nodes can then select these two output groups.
Write Messages and Receipts into Worksheets
The Demo includes preconfigured workflows for saving incoming messages to worksheets and processing message status updates. Follow the steps below if you are building your own inbound message workflow.
Add two Get Multiple Data nodes to the receiving workflow, select From Code as the source, and select the parsing node's messages and statuses respectively. Create one PBP to save inbound messages and another to save receipts, and define the following Text inputs on the start node.
- For inbound messages:
waba_id,phone_id,message_id,from,message_type, andtext. To also save quotes, choices, or media, add the corresponding fields. - For receipts:
waba_id,phone_id,message_id,status, anderror_code.
Configure and publish both PBPs using the rules below. Return to the receiving workflow and add Call PBP after each Get Multiple Data. Select the corresponding PBP, execute one by one according to the record count of that data node, and map the same-named column of the current row as input. Configure PBP inputs and calls
At the beginning of the subprocess, add Get Single Data → WhatsApp Numbers. Set three query conditions.
- WABA ID equals the current row's
waba_id. - Phone Number ID equals the current row's
phone_id. - Enabled is Selected.
When using multiple Meta apps, also add the owning app condition. If no number record is found, end processing for that row.

Figure 52 When processing callbacks one by one, find the number configuration by WABA ID, Phone Number ID, and Enabled → Selected.
- Customer message: use the found Sender number and
message_idto look for an existing record, and add one only when none exists. In Add Record → WhatsApp Messages, write the current row'smessage_id,from,message_type, andtextinto Message ID, Customer number, Message type, and Content respectively. Set Message toInbound WhatsApp message, Record kind toMessage, Direction toinbound, Status toreceived, and associate Sender number with the found number record. Refresh Inbox to see the message and its ID. A unique constraint on Message ID prevents duplicate delivery and concurrent writes. - Quotes and other types: save
related_message_id(the original message quoted by the customer),choice_id(button or list option),media_id, orcontent_json(structured content) as needed. Thetimestampfor received time is in Unix seconds. When customer service sends a quoted reply, use the inbound record's ownmessage_id. - Delivery receipt: save the receipt to WhatsApp Messages as a separate record. When adding a receipt record, set Record kind to
Receipt, leave Processed empty initially, and select it after processing. The receipt uses the same Sender number and writesmessage_id,status, anderror_codeinto Related message ID, Status, and Send error respectively. Configure conversation views such as Inbox and Outbox to display onlyMessage. - Create a scheduled trigger workflow to process receipts waiting to be matched. In Get Multiple Data, filter Record kind as
Receiptand Processed as unchecked. Create a PBP to process a single receipt, then use Call PBP to pass pending receipts one by one. The PBP queriesoutboundmessages by the same Sender number and matches the outbound Message ID with the receipt's Related message ID. If no match is found, keep the receipt pending; once the sending process writes the Message ID, the next run can match it. - After matching an outbound message, decide whether to update based on the current Status. Status advances as
accepted → sent → delivered → read; earlier statuses or failure receipts do not overwritedeliveredorread. On failure, saveerror_code, for example131030. After completing the status decision, select the receipt's Processed. To verify, first write a test receipt, click Execute Now on the scheduled trigger, and confirm that the receipt is still pending. Then enter the outbound message ID, run once, and confirm that the status has updated. Finally, add an earlier receipt and confirm that the status is not downgraded.
Concurrent receipts. This process writes back statuses one by one, so set Strict Serial Execution. When the same receipt arrives repeatedly, still decide based on the current outbound status. HAP workflow configuration
HAP Webhook trigger · Meta callback verification and signatures
Attachment Save Settings
Enable attachment saving when you need to open images, videos, audio, documents, or stickers that customers send in Chat history.
- As an administrator, open API Developer Docs → Authorization Management → Create Authorization Key from the menu next to the app name. Limit the permission scope to the update-record capability of WhatsApp Messages. HAP app API authorization
- In the app's Global Variables, enter this authorization group's AppKey and Sign in
wa_hap_attachment_app_keyandwa_hap_attachment_signrespectively. Use masked variables for credentials. Downloads also use the existingwa_access_token. - After installing to a new app, in Store WhatsApp event → Download and save the WhatsApp attachment, verify that the
worksheet_idinput points to this app's WhatsApp Messages andfile_field_idpoints to File. You can view the ID on the worksheet page in API Developer Docs. Save the changes and publish the process.
The Demo saves attachments that customers send to the message's File, up to 7 MB per inbound attachment. Send an image from an approved test phone and open it in the contact's Chat history to verify. If an attachment exceeds the limit or saving fails, the message record and Media ID are still retained, and Content shows the reason. HAP attachment API limits
Synchronous Response Configuration for Custom Processes
Configure the synchronous response in Configure → API Capabilities. For Request Authentication, select No authorization required so the signature verification node validates Meta requests. For Response Method, select Directly return the field value of the process node to the request address, return the signature verification node's response_body as Text, then save and publish.

Figure 53 In the receiving workflow's Configure → API Capabilities, select directly return the node field value.
To verify the callback URL separately, add Send API Request → Send Custom Request in the HAP administrator test workflow and select GET as the method. In API URL, enter the published address and append ?hub.mode=subscribe&hub.verify_token=YOUR_VERIFY_TOKEN&hub.challenge=001234. If the address already has query parameters, join with &. Replace YOUR_VERIFY_TOKEN with the value configured in HAP, URL-encoding it if it contains special characters. Click Test API; the response should be HTTP 200 with 001234 returned unchanged.
Access a Test Account When a Meta Callback Already Exists
If the same Meta app already sends messages to another system, you can specify a separate HAP receiving address for an independent test WhatsApp Business Account (WABA). The Callback URL and Verify token in Configuration remain the app's default settings.
-
Confirm that Meta sends the test account's messages to this app.
- In Meta's WhatsApp → Configuration → Webhook fields, find
messages. If it is not yet subscribed, the app administrator clicks Subscribe on that row. - In the HAP administrator test workflow, call List account webhook subscriptions. Enter the same Meta app's test access token (
bearer_token) and the test account's WABA ID (waba_id), and check whether the current Meta app appears in the list. Only if the list does not contain this app, use Subscribe application to account with the same two inputs, and query again aftersuccess=true. If the app ID is unclear in the result, confirm it with the administrator query method at the end of this section.
- In Meta's WhatsApp → Configuration → Webhook fields, find
-
Connect the test account's messages to HAP. In HAP's Call Integrated API, select Subscribe application to account and fill in the following four items.
bearer_token: the test access token from the previous step.waba_id: the test WABA ID from the previous step.override_callback_uri: the webhook address copied from the published Receive WhatsApp events trigger.verify_token: the value of the HAP global variablewa_verify_token.
Verify the inputs, then click Test.
success=truemeans Meta accepted the configuration. If you later resubscribe on the same WABA with empty override parameters, Meta clears the dedicated address you just set. -
Verify the effective address. Use List account webhook subscriptions to query the target WABA again, and use the administrator query method below if needed to verify the override address. If the test number has its own dedicated address, the number-level address takes precedence. Meta callback URL precedence
How Administrators View the Callback Address Saved by Meta
When the query action returns only the app list and you need to verify the specific address, add Send API Request → Send Custom Request in the HAP administrator test workflow.
- Select GET for Method.
- For API URL, enter
https://graph.facebook.com/{api_version}/{waba_id}/subscribed_apps. Replace the two placeholders in braces with the API version from the connection settings and the test account's WABA ID. - In Headers, add
Authorizationand set the value toBearer, a space, and the test access token from step 1.
Click Test API. In data of the response, find this app by Meta App ID and verify that its override_callback_uri is the HAP address you entered. Meta subscription query API
Receiving Troubleshooting
Delivery Receipts Arrive but Phone Replies Do Not
- Open Meta Business Suite → Settings → Integrations → Conversation Routing and review the routing settings for the current WhatsApp number. When conversation routing is enabled, verify Customer sends a message and the utility or marketing template reply actually in use, and confirm that the primary receiver is the party connected to HAP. Meta conversation routing settings
- If you recently switched from another system, send a message from a verified test phone that has never chatted with this enterprise number. After confirming that HAP receives it, send a reply from HAP. Existing conversations may still be handled by the previous system. If sending a text reply returns error code
131070, the current app does not have permission to reply to that conversation. To continue handling the conversation in HAP, request a handover from the system currently handling it. Meta conversation handover instructions
API Mapping for Each Message Type
Template Message API Configuration
- In the template branch, select Call Integrated API → Send template message. In Pass Parameters, set
type=templateandtemplateLanguagePolicy=deterministic. - Click the value button next to
templateNameand select Outbound record → Template name. BindtemplateLanguageCodeto Template language code in the same way. - Bind
templateComponentsto the same draft's Template components JSON.
hello_world has no variables, so leave templateComponents empty.
The Demo assembles the variable values from the form into the components the API requires. For a custom workflow, provide component values that match the approved template definition. The example below sets the first body variable to Alex. For named variables, also provide parameter_name.
[{"type":"body","parameters":[{"type":"text","text":"Alex"}]}]

Figure 54 The template name, language, and components are taken from the current draft, and the sender number is taken from the number configuration.
Text Message API Configuration
- In the text branch, select Call Integrated API → Send text message, and set
type=text. - In Pass Parameters, bind
textBodyto Outbound record → Content andcontextMessageIdto Outbound record → Related message ID. When sending text without a quote, leave the original message ID empty. - Send from the test number and view the Message ID in the current record.

Figure 55 The text body and quote message ID are taken from the draft, and the Phone Number ID is taken from the selected number configuration.
Image Message API Configuration
-
In the image branch, select Call Integrated API → Send image message, and set
type=image. -
In Pass Parameters, bind draft fields.
-
imageIdmaps to Media ID, or useimageLinkto map to Media URL. -
imageCaptionmaps to Caption.
Figure 56 The image's media ID, link, and caption are taken from the draft.
-
-
After the test send, confirm on the test phone that the image and caption are correct.
When a customer sends an image, the inbound record saves image.id, the available MIME type, and the caption. After completing the attachment save configuration, open the image in Chat history. Meta media formats and limits
Video Message API Configuration
-
In the video branch, select Call Integrated API → Send video message, and set
type=video. -
In Pass Parameters, bind draft fields.
-
videoIdmaps to Media ID, or usevideoLinkto map to Media URL. -
videoCaptionmaps to Caption.
Figure 57 The video's media ID, link, and caption are taken from the draft.
-
-
After the test send, confirm on the test phone that the video plays.
When a customer sends a video, the inbound record saves video.id, the available MIME type, and the caption. After completing the attachment save configuration, open the video in Chat history. Meta media formats and limits
Audio Message API Configuration
-
In the audio branch, select Call Integrated API → Send audio message, and set
type=audio. -
In Pass Parameters, bind draft fields.
audioIdmaps to Media ID, or useaudioLinkto map to Media URL.
-
After the test send, confirm on the test phone that the audio plays.
When a customer sends audio, the inbound record saves audio.id and audio.mime_type, and also saves audio.voice when present. After completing the attachment save configuration, open the audio in Chat history. Meta audio formats and limits

Figure 58 The audio's audioId and audioLink bind to the media ID and link in the draft respectively.
Document Message API Configuration
-
In the document branch, select Call Integrated API → Send document message, and set
type=document. -
In Pass Parameters, bind draft fields.
documentIdmaps to Media ID, or usedocumentLinkto map to Media URL.documentCaptionmaps to Caption, anddocumentFilenamemaps to Media filename.
-
After the test send, confirm on the test phone that the file name is correct and the attachment opens.
When a customer sends a document, the inbound record saves document.id and the returned file name, MIME type, or caption. After completing the attachment save configuration, open the document in Chat history. Meta document formats and limits

Figure 59 The document's media ID, link, caption, and file name bind to draft fields respectively.
Sticker Message API Configuration
-
In the sticker branch, select Call Integrated API → Send sticker message, and set
type=sticker. -
In Pass Parameters, bind draft fields.
stickerIdmaps to Media ID, or usestickerLinkto map to Media URL.
-
After the test send, confirm on the test phone that the sticker displays correctly.
When a customer sends a sticker, the inbound record saves sticker.id and the returned file information. After completing the attachment save configuration, open the sticker file in Chat history. Meta sticker messages

Figure 60 The sticker's stickerId and stickerLink bind to the media ID and link in the draft respectively.
Location Message API Configuration
- In the location branch, select Call Integrated API → Send location message, and set
type=location. - In Pass Parameters, bind
locationLatitudeandlocationLongitudeto Outbound record → Latitude and Longitude respectively. Latitude ranges from −90 to 90 and longitude from −180 to 180.0is a valid coordinate. - Bind
locationNameandlocationAddressto the same draft's Place name and Address respectively. Both can be left empty. After sending, click the location card on the test phone to verify the map.
When a customer sends a location, the inbound message's Content shows a readable summary, and Details JSON stores the latitude and longitude along with the returned name and address. Meta location messages

Figure 61 The location message's address, latitude, longitude, and name bind to draft fields respectively.
Contact Message API Configuration
- In the contact branch, select Call Integrated API → Send contacts message, and set
type=contacts. - Use this branch's Code to organize the name, business card number, and optional email into row arrays. Configure Get Multiple Data for
contactsandcontactsPhoneswith Code as the source. For branches that include Contact email, also mapcontactsEmails. - In Pass Parameters, bind
contactsto the business card rows andcontactsPhonesto the phone rows. When an email exists, bindcontactsEmailsto the email rows withparentKeyandemail. Both phone and emailparentKeyvalues use the corresponding business card'srowKey. If no email is provided, omit the email parameter.
When a customer sends a contact card, the process writes the business card information from contacts[] to Details JSON. Meta contact messages
Configure Contact Row Transformation
Map Display name, First name, Last name, Contact phone, and Contact email from the outbound record to display_name, first_name, last_name, contact_phone, and contact_email respectively. For single-node testing, use Sample Contact, Sample, 12025550123, and contact@example.com. Last name can be left empty.
The output contains ready, validation_error, and five groups of rows. contacts provides rowKey, nameFormattedName, nameFirstName, and nameLastName. contactsPhones provides parentKey and phone, and contactsEmails provides parentKey and email. Populate address and URL fields only when the corresponding data exists.
First, click Test in the Code node using the example below. Each group contains one row, which generates the columns for the five output groups. Once the columns are generated, replace the example with the run script below and keep these output columns when saving. The example is used only during node testing.
output = { ready: "yes", validation_error: "", ...{"contacts": [{"rowKey": "contact-1", "birthday": "2000-01-01", "nameFirstName": "Sample", "nameFormattedName": "Sample Contact", "nameLastName": "Contact", "nameMiddleName": "Example", "namePrefix": "Ms.", "nameSuffix": "Jr.", "orgCompany": "Example Company", "orgDepartment": "Support", "orgTitle": "Advisor"}], "contactsAddresses": [{"parentKey": "contact-1", "city": "Example City", "country": "United States", "countryCode": "US", "state": "CA", "street": "1 Example Street", "type": "WORK", "zip": "00000"}], "contactsEmails": [{"parentKey": "contact-1", "email": "contact@example.com", "type": "WORK"}], "contactsPhones": [{"parentKey": "contact-1", "phone": "+15550100001", "type": "WORK", "waId": "15550100001"}], "contactsUrls": [{"parentKey": "contact-1", "type": "WORK", "url": "https://example.com"}]} };
The run script generates the business card and related rows from the current draft.
function text(value) {
return value == null ? '' : String(value).trim();
}
const rowKey = 'contact-1';
const first = text(input.first_name);
const display = text(input.display_name);
const email = text(input.contact_email);
const phone = text(input.contact_phone).replace(/[\s()+-]/g, '');
let validation_error = '';
if (!display || !first) validation_error = 'Enter the display name and first name.';
else if (!/^[1-9]\d{1,14}$/.test(phone)) validation_error = 'Contact phone must contain the country code and number.';
else if (email && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) validation_error = 'Enter a valid contact email address.';
output = {
ready: validation_error ? 'no' : 'yes', validation_error,
contacts: validation_error ? [] : [{ rowKey: rowKey, nameFirstName: first, nameFormattedName: display, nameLastName: text(input.last_name) }],
contactsAddresses: [],
contactsEmails: email && !validation_error ? [{ parentKey: rowKey, email: email }] : [],
contactsPhones: validation_error ? [] : [{ parentKey: rowKey, phone: '+' + phone }],
contactsUrls: [],
};

Figure 62 contacts are passed row by row by business card, and rowKey is used to associate phone, email, and other sub-items.
Reply Button Message API Configuration
- In the button branch, select Call Integrated API → Send reply buttons, and set
type=interactiveandinteractiveType=button. - In Pass Parameters, bind
interactiveBodyText,interactiveHeaderText, andinteractiveFooterTextto the original draft's Content, Header text, and Footer text respectively. LeaveinteractiveHeaderTypeempty. - Use this branch's Code to organize each button's ID and title into
buttonsrows. Add Get Multiple Data to select the array, then use this node to bindinteractiveActionButtons. Expand the parameter and selecttype,replyId, andreplyTitle. Each row'stypeisreply.
Configure Button Row Transformation
button_1_id/button_1_title through button_3_id/button_3_title map to the corresponding button IDs and titles. Use the two buttons above as single-node test values, and save after ready = yes and buttons rows appear.
function text(value) {
return value == null ? "" : String(value).trim();
}
function required(value, label) {
const result = text(value);
if (!result) throw new Error(`${label} is required.`);
return result;
}
function replyButtons(input) {
const buttons = [];
const ids = new Set();
const titles = new Set();
for (let i = 1; i <= 3; i++) {
const id = text(input[`button_${i}_id`]);
const title = text(input[`button_${i}_title`]);
if (i !== 1 && !id && !title) continue;
if (!id || !title) throw new Error(`Button ${i} needs an ID and title.`);
if (ids.has(id) || titles.has(title)) throw new Error("Give every reply button a different ID and title.");
ids.add(id);
titles.add(title);
buttons.push({ type: "reply", reply: { id, title } });
}
return buttons;
}
function prepareRows(input) {
const buttons = replyButtons(input).map(button => ({
type: button.type, replyId: button.reply.id, replyTitle: button.reply.title
}));
return { buttons };
}
try { output = { ready: 'yes', validation_error: '', ...prepareRows(input) }; }
catch (error) { output = { ready: 'no', validation_error: error.message }; }

Figure 63 The body text and button row array of reply buttons are configured in the same branch.
Option List Message API Configuration
- In the list branch, select Call Integrated API → Send option list, and set
type=interactiveandinteractiveType=list. - In Pass Parameters, bind
interactiveBodyTextandinteractiveActionButtonto the original draft's Content and Open list button text respectively. If header or footer text exists, also select the original draft fields forinteractiveHeaderTextandinteractiveFooterText. LeaveinteractiveHeaderTypeempty. - Use this branch's Code to split Sections JSON into
sectionsandrows. Add two Get Multiple Data nodes and select section rows and option rows respectively. Use the first node to bindinteractiveActionSectionsand the second to bindinteractiveActionSectionsRows. - Expand sections and bind
rowKeyandtitle. Expand options and bindparentKey,id,title, and optionaldescription. Each option'sparentKeyuses its section'srowKey.
After the test send, click View slots on the test phone, select Tomorrow morning, and click Send. Open HAP's Interactive replies and confirm that Choice ID is tomorrow_am and Status is received. The record's Related message ID should match the list message's Message ID. Meta option lists
Configure List Row Transformation
Bind sections_json to the original draft's Sections JSON. Test the node with this section's example, and save after ready = yes, one sections group, and two rows appear.
function text(value) {
return value == null ? "" : String(value).trim();
}
function required(value, label) {
const result = text(value);
if (!result) throw new Error(`${label} is required.`);
return result;
}
function optional(target, key, value) {
const result = text(value);
if (result) target[key] = result;
}
function jsonArray(value, label) {
try {
const array = Array.isArray(value) ? value : JSON.parse(required(value, label));
if (!Array.isArray(array)) throw new Error();
return array;
} catch {
throw new Error(`${label} must be a JSON array.`);
}
}
function listSections(value) {
const sections = jsonArray(value, "Sections JSON");
if (!sections.length) throw new Error("Enter at least one list section.");
const rowIds = new Set();
const normalized = sections.map(section => {
if (!section || !Array.isArray(section.rows) || !section.rows.length) {
throw new Error("Each list section needs a rows array with at least one row.");
}
const rows = section.rows.map(row => {
if (!row || typeof row !== "object") throw new Error("Each list row needs an ID and title.");
const id = required(row.id, "List row ID");
if (rowIds.has(id)) throw new Error("Give each list row a different ID.");
rowIds.add(id);
const result = { id, title: required(row.title, "List row title") };
optional(result, "description", row.description);
return result;
});
const result = { rows };
if (sections.length > 1) result.title = required(section.title, "List section title");
else optional(result, "title", section.title);
return result;
});
if (rowIds.size > 10) throw new Error("A WhatsApp list can contain at most 10 rows.");
return normalized;
}
function prepareRows(input) {
const source = listSections(input.sections_json);
const sections = source.map((section, idx) => ({ rowKey: String(idx + 1), title: section.title || '' }));
const rows = source.reduce((all, section, idx) => all.concat(section.rows.map(row => ({
parentKey: String(idx + 1), id: row.id, title: row.title, description: row.description || ''
}))), []);
return { sections, rows };
}
try { output = { ready: 'yes', validation_error: '', ...prepareRows(input) }; }
catch (error) { output = { ready: 'no', validation_error: error.message }; }

Figure 64 Option sections and option rows are bound separately and associated through parentKey.
URL Button Message API Configuration
- In the URL button branch, select Call Integrated API → Send URL button message. Set
type=interactive,interactiveType=cta_url, andinteractiveActionName=cta_url. - In Pass Parameters, bind
interactiveBodyText,interactiveActionParametersDisplayText, andinteractiveActionParametersUrlto the original draft's Content, Button title, and Button URL respectively. The link must be a public HTTPS address reachable from the phone. To add a footer, bindinteractiveFooterTextto Footer text. - To display header text, bind
interactiveHeaderTextto Header text. LeaveinteractiveHeaderTypeempty.
After a successful send, click the button on the phone to verify the page. Opening a webpage does not generate button_reply; customer messages sent afterward are still written to the message table by the receiving flow. Meta URL buttons

Figure 65 The URL button's title, URL, and footer are taken from the current draft.
Message Reaction API Configuration
- In the reaction branch, select Call Integrated API → Send reaction message, and set
type=reaction. - In Pass Parameters, bind
reactionMessageIdto Outbound record → Related message ID andreactionEmojito Emoji. To remove a reaction, use the same target ID with an empty string. - Emoji reactions receive only a
sentreceipt. Check the target message on the test phone and confirm that the emoji appeared or was removed. Meta emoji reaction receipts
When a customer adds or removes a reaction, the process adds a new inbound record to the same message table, links the original message through Related message ID, and retains the emoji data returned by the event. Meta message reactions

Figure 66 The message reaction's emoji and target message ID are taken from the current draft.
Production Callback Verification
Generate a Callback Test Signature in HAP
Add only Code → JavaScript in the administrator test workflow. For the body input, enter the original single-line JSON to test; for secret, enter or reference the target app's App Secret (in the Demo, the global variable wa_app_secret). Paste the following script.
const crypto = require("crypto");
if (typeof input.body !== "string" || !input.secret) {
throw new Error("Provide the unchanged raw body and the target App Secret.");
}
output = {
body: input.body,
signature: "sha256=" + crypto.createHmac("sha256", input.secret)
.update(input.body, "utf8").digest("hex")
};
Then add Send API Request, select POST as the method, and enter the synchronous callback address to verify as the URL. Bind Body → raw to Code → body, set Content-Type to application/json, and bind X-Hub-Signature-256 to Code → signature. Do not reformat the body. After a valid request passes, append a single space to the end of the body in the request node only, keeping the old signature, then check the actual HTTP status of the invalid request and whether any records were written. For the test body, use {"object":"whatsapp_business_account","entry":[]} so you can verify the HTTP response without generating business messages. The test workflow and its history, which contain credentials, are accessible only to administrators.
Was this document helpful?