curl --get 'https://graph.facebook.com/v21.0/oauth/access_token' \ -d 'client_id=<APP_ID>' \ -d 'client_secret=<APP_SECRET>' \ -d 'code=<CODE>'
| Placeholder | Description | Example value |
|---|---|---|
<APP_ID> | Required. Your app ID. This is displayed at the top of the App Dashboard. | 236484624622562 |
<APP_SECRET> | Required. Your app secret. You can get this from the App Dashboard > App Secret > Basic panel. | 614fc2afde15eee07a26b2fe3eaee9b9 |
<CODE> | Required. The code returned by Embedded Signup when the customer successfully completed the flow. | AQBhlXsctMxJYbwbrpybxlo9tLPGy-QAmjBJA03jxLos43wxlBlrYozY5C33BXJULd133cOJf_5y6EkJZYMrAmW-EMj3Wdap9-NUM2nS4s8tC-ES7slBhh6QpCFM7-SzpI-iqsjqTGyxbUUW3AeaEyLkeZFIkBgcQ_SOxo9HShm20SDR5_n7AT9ZJ5dcgpqBQykNT-pQ8V7Ne9-sr6RLAWtJMF7-Zx6ABudRcWIN53tUTtquDVNuq3lrco4BlVQAv-54tR83Ae0ODN9Uet6j-BVLuetXhQCM3sz9RdgedlbxkidMbkztvYX1j7baOrJxyLyYGWYgbnUrKRQKCtWTsO5ekIGFgtbpS8UPJNqV6j8E5XKPJ8QA7ZFqzkB0s2O__J5FrjHzc_rDo1EuRbw98ihHDzQnvuXeHapEyfhLDJct0A |
<BUSINESS_TOKEN>
| Placeholder | Description | Example value |
|---|---|---|
<BUSINESS_TOKEN> | The customer’s business token. | EAAAN6tcBzAUBOwtDtTfmZCJ9n3FHpSDcDTH86ekf89XnnMZAtaitMUysPDE7LES3CXkA4MmbKCghdQeU1boHr0QZA05SShiILcoUy7ZAb2GE7hrUEpYHKLDuP2sYZCURkZCHGEvEGjScGLHzC4KDm8tq2slt4BsOQE1HHX8DzHahdT51MRDqBw0YaeZByrVFZkVAoVTxXUtuKgDDdrmJQXMnI4jqJYetsZCP1efj5ygGscZBm4OvvuCYB039ZAFlyNn |
curl -X POST 'https://graph.facebook.com/<API_VERSION>/<WABA_ID>/subscribed_apps' \ -H 'Authorization: Bearer <ACCESS_TOKEN>'
| Placeholder | Description | Example value |
|---|---|---|
<BUSINESS_TOKEN> | Required. The customer’s business token. | EAAAN6tcBzAUBOwtDtTfmZCJ9n3FHpSDcDTH86ekf89XnnMZAtaitMUysPDE7LES3CXkA4MmbKCghdQeU1boHr0QZA05SShiILcoUy7ZAb2GE7hrUEpYHKLDuP2sYZCURkZCHGEvEGjScGLHzC4KDm8tq2slt4BsOQE1HHX8DzHahdT51MRDqBw0YaeZByrVFZkVAoVTxXUtuKgDDdrmJQXMnI4jqJYetsZCP1efj5ygGscZBm4OvvuCYB039ZAFlyNn |
<WABA_ID> | Required. The customer’s WABA ID. | 102290129340398 |
{ "success": true }
whatsapp_credit_sharing_and_attach, you would need to add your System User to the shared WhatsApp Business Accounts as a pre-requisite. Please refer to this doc for steps.curl -X POST 'https://graph.facebook.com/<API_VERSION>/<EXTENDED_CREDIT_LINE_ID>/whatsapp_credit_sharing_and_attach?waba_currency=<CUSTOMER_BUSINESS_CURRENCY>&waba_id=<CUSTOMER_WABA_ID>' \ -H 'Authorization: Bearer <SYSTEM_TOKEN>'
| Placeholder | Description | Example value |
|---|---|---|
<CUSTOMER_BUSINESS_CURRENCY> | Required. The business’s currency, as a three-letter currency code. Support values are:
This currency is used for invoicing and corresponds to pricing rates. | USD |
<CUSTOMER_WABA_ID> | Required. The customer’s WABA ID. | 102290129340398 |
<EXTENDED_CREDIT_LINE_ID> | Required. Your extended credit line ID. | 1972385232742146 |
<SYSTEM_TOKEN> | Required. Your system token. | EAAAN6tcBzAUBOZC82CW7iR2LiaZBwUHS4Y7FDtQxRUPy1PHZClDGZBZCgWdrTisgMjpFKiZAi1FBBQNO2IqZBAzdZAA16lmUs0XgRcCf6z1LLxQCgLXDEpg80d41UZBt1FKJZCqJFcTYXJvSMeHLvOdZwFyZBrV9ZPHZASSqxDZBUZASyFdzjiy2A1sippEsF4DVV5W2IlkOSr2LrMLuYoNMYBy8xQczzOKDOMccqHEZD |
{ "allocation_config_id": "<ALLOCATION_CONFIGURATION_ID>", "waba_id": "<CUSTOMER_WABA_ID>" }
| Placeholder | Description | Example value |
|---|---|---|
<ALLOCATION_CONFIGURATION_ID> | The extended credit line’s allocation configuration ID. Save this ID if you want to verify that your credit line has been shared with the customer. | 58501441721238 |
<CUSTOMER_WABA_ID> | The customer’s WABA ID. | 102290129340398 |
curl 'https://graph.facebook.com/v21.0/<BUSINESS_PHONE_NUMBER_ID>/register' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <BUSINESS_TOKEN>' \ -d ' { "messaging_product": "whatsapp", "pin": "<DESIRED_PIN>" }'
| Placeholder | Description | Example value |
|---|---|---|
<BUSINESS_PHONE_NUMBER_ID> | Required. The customer’s business phone number ID returned. | 106540352242922 |
<BUSINESS_TOKEN> | Required. The customer’s business token. | EAAAN6tcBzAUBOwtDtTfmZCJ9n3FHpSDcDTH86ekf89XnnMZAtaitMUysPDE7LES3CXkA4MmbKCghdQeU1boHr0QZA05SShiILcoUy7ZAb2GE7hrUEpYHKLDuP2sYZCURkZCHGEvEGjScGLHzC4KDm8tq2slt4BsOQE1HHX8DzHahdT51MRDqBw0YaeZByrVFZkVAoVTxXUtuKgDDdrmJQXMnI4jqJYetsZCP1efj5ygGscZBm4OvvuCYB039ZAFlyNn |
<DESIRED_PIN> | Required. Set this value to a 6-digit number. This will be the business phone number’s two-step verification PIN. | 581063 |
{ "success": true }
curl 'https://graph.facebook.com/v21.0/<BUSINESS_PHONE_NUMBER_ID>/messages' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <BUSINESS_TOKEN>' \ -d ' { "messaging_product": "whatsapp", "recipient_type": "individual", "to": "<WHATSAPP_USER_NUMBER>", "type": "text", "text": { "body": "<BODY_TEXT>" } }'
| Placeholder | Description | Example value |
|---|---|---|
<BODY_TEXT> | Required. Message body text. Supports URLs. Maximum 4096 characters. | Message received, loud and clear! |
<BUSINESS_PHONE_NUMBER_ID> | Required. The customer’s business phone number ID. | 106540352242922 |
<BUSINESS_TOKEN> | Required. The customer’s business token. | EAAAN6tcBzAUBOwtDtTfmZCJ9n3FHpSDcDTH86ekf89XnnMZAtaitMUysPDE7LES3CXkA4MmbKCghdQeU1boHr0QZA05SShiILcoUy7ZAb2GE7hrUEpYHKLDuP2sYZCURkZCHGEvEGjScGLHzC4KDm8tq2slt4BsOQE1HHX8DzHahdT51MRDqBw0YaeZByrVFZkVAoVTxXUtuKgDDdrmJQXMnI4jqJYetsZCP1efj5ygGscZBm4OvvuCYB039ZAFlyNn |
<WHATSAPP_USER_NUMBER> | Required. Your WhatsApp phone number that can send and receive messages from other WhatsApp numbers. Note that this cannot be a business phone number already registered for use with Cloud API. | +16505551234 |
{ "messaging_product": "whatsapp", "contacts": [ { "input": "<WHATSAPP_USER_NUMBER>", "wa_id": "<WHATSAPP_USER_ID>" } ], "messages": [ { "id": "<WHATSAPP_MESSAGE_ID>" } ] }
| Placeholder | Description | Example value |
|---|---|---|
<WHATSAPP_MESSAGE_ID> | WhatsApp message ID. | wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA |
<WHATSAPP_USER_ID> | Your WhatsApp user ID. | 16505551234 |
<WHATSAPP_USER_NUMBER> | Your WhatsApp phone number that the message was sent to. | +16505551234 |