WhatsApp Cloud API
Overview
Readme
Cloud API Overview
Message Throughput
Rate Limits
Available Metrics
Scaling
Data Privacy & Security
Get Started
Readme
Step 1: Set up Developer Assets and Platform Access
Step 2: Send a Test Message
Step 3: Configure a Webhook
Step 4: Receive a Test Message
Next Steps
Get Started for BSPs
Prepare and Plan
Set up Assets
Sign Contracts
Build Integration
Step 1: Get System User Access Token
Step 2: Set up Webhooks
Step 3: Subscribe to your WABA
POST
Step 4: Get Phone Number ID
GET
Step 5: Register Phone Number
POST
Step 6: Receive a Message from Consumer App
VIEW
Step 7: Send a Test Message
POST
Guides
Readme
Mark Messages as Read
Sell Products and Services
API Reference
Readme
Account Migration
Block Users
Business Compliance
Business Profiles
Registration
Media
Messages
Phone Numbers
Two-Step Verification
WhatsApp Business Accounts (WABAs)
WABA Subscriptions
Payments API - SG
Payments API - IN
Typing indicators
Examples
Send Sample Issue Resolution Template
POST
Webhooks
Readme
Understanding Webhooks
Generate Endpoint for Webhook Testing
Components
Message Status Types
Status: Transaction Status - Order Details Message
VIEW
Support and Troubleshooting
Support
Errors
Technical Implementation FAQs
Data Privacy & Security FAQs
Regulatory Compliance FAQs
Readme
创建时间: 2025-05-28 16:39

In the Getting Started tab:

  1. Select your test phone number in the From field. (Unless you have registered other phone numbers, this will be the only phone number in From.)
  2. Enter the phone number you would like to message in the To field. Ensure the number is correct, and that you want to add it to your list of 5 possible message recipients —as you add phone numbers, follow the prompts on the screen to verify you have access to them. Once this number has been added, it cannot be removed from your list. Note: This limitation is only for WhatsApp-provided test phone numbers. Real phone numbers that you register do not have a limit on the number of recipients.
  3. Once you enter a recipient phone number, the code sample on the page will be updated to demonstrate an API call that sends a test message to that number. The code sample will look like this:
curl -i -X POST \
https://graph.facebook.com/{{Version}}/FROM_PHONE_NUMBER_ID/messages \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{ "messaging_product": "whatsapp", "to": "TO_PHONE_NUMBER", "type": "template", "template": { "name": "hello_world", "language": { "code": "en_US" } } }'Copy Code

4. Click Send message to send the first message. As an alternative, you can copy the code sample provided and execute it in your Terminal or in Postman. You have just sent a test message!

The code sample on the page is formatted for use in Unix-style terminal shells, and is expected to work on MacOS and distributions of Gnu/Linux. If you use Windows, we suggest you perform your first API call using Postman, to avoid platform-related cURL formatting concerns. If you are a Windows 10 user, cURL is available, but requires a different syntax than the one shown in the Getting Started tab to execute in PowerShell or cmd.exe. For more information, see cURL Comes to Windows or cURL for Windows. If you have access to the Windows Subsystem for Linux (WSL), you can also consider launching a Linux distribution and using its terminal.

最后更新: -