WhatsApp Cloud API生成测试号后无法激活的问题求助
WhatsApp Cloud API测试号发送消息报错:Account does not exist
错误详情
{"error": {"message": "The account is not registered","type": "OAuthException","code": 133010,"error_subcode": 2593006,"is_transient": false,"error_user_title": "Account does not exist","error_user_msg": "Account does not exist in Cloud API. Please use/register API to create an account first.","fbtrace_id": "Avju9R0h5nI7P8EYGmhLtMe"}}
已执行操作
- 通过WhatsApp Cloud API成功生成测试号
- 确认拥有权限:
whatsapp_business_messaging、whatsapp_business_management - 验证访问令牌(access token)有效性
- 尝试通过
/messages端点发送消息
操作步骤
- 在Meta Developer Console生成测试号
- 在Meta Business Manager的WhatsApp设置中查看测试号
- 验证API权限
- 使用以下请求发送消息:
代码示例(发送消息API请求)
curl -X POST "https://graph.facebook.com/v18.0/YOUR_PHONE_NUMBER_ID/messages" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "RECIPIENT_PHONE_NUMBER", "type": "text", "text": { "body": "Hello, this is a test message from WhatsApp Cloud API!" } }'
问题与解答
1. 如何激活测试号使其能够收发消息?
- 测试号生成后,需完成号码验证:在Meta Business Manager的WhatsApp设置页面找到对应测试号,点击"验证",按提示发送验证码到测试号绑定的手机号,或通过WhatsApp客户端完成确认。
- 确保测试号已关联到正确的Meta Business Account,且该账号已完成基础验证(如邮箱验证)。
2. 在使用Cloud API前是否需要手动注册测试号?
是的,测试号生成后需手动完成注册绑定:
- 在Meta Developer Console生成测试号后,进入Meta Business Manager的WhatsApp管理界面,将测试号添加到你的WhatsApp Business账户下,并完成系统引导的注册确认流程,本质是将测试号与你的Cloud API账户绑定,否则API无法识别该号码。
3. 生成测试号后还需哪些额外步骤才能成功发送消息?
- 完成号码注册激活:按上述步骤完成测试号的验证与账户绑定。
- 添加测试联系人:在WhatsApp测试号设置中,将接收消息的手机号添加到"允许的测试联系人"列表(测试号仅能向已添加的联系人发送消息)。
- 确认访问令牌权限:确保access token已包含
whatsapp_business_messaging权限,且令牌所属应用已关联到对应Business Account。 - 核对Phone Number ID:确认请求URL中的
YOUR_PHONE_NUMBER_ID是测试号对应的ID,而非Business Account ID或其他ID。
4. Meta Business Manager中是否有需要启用的设置才能让测试号正常工作?
- 启用WhatsApp Business Platform:在Business Manager的"业务设置"中,确保已启用WhatsApp Business Platform服务,并将你的Meta应用关联到该服务。
- 确认账户状态:确保你的Meta Business Account无限制,且已完成必要身份验证(测试阶段通常完成个人身份验证即可)。
- Webhook配置(可选):若需接收消息回调,需配置Webhook端点并订阅
messages等事件,仅发送消息可暂时跳过。
内容的提问来源于stack exchange,提问作者Jay
相关产品推荐
相关产品推荐

