-
Notifications
You must be signed in to change notification settings - Fork 242
Open
Description
Description
When attempting to create an AdSet that redirects to WhatsApp using the Marketing API, I encounter the following error:
{
"error": {
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 1487246,
"is_transient": false,
"error_user_title": "Campaign Creation Failed",
"error_user_msg": "Campaign Creation Failed: This WhatsApp phone number is not linked to your account",
"fbtrace_id": "Ax6DXy6ZeHArDiB5HZhK-Tt"
}
}
The same configuration works perfectly fine when created via Meta Ads Manager. However, it fails when trying to create it programmatically through the API. Below are the details of the request being sent and other relevant context.
Steps to Reproduce
- Retrieve WhatsApp numbers using the following endpoint:
GET /me/businesses?fields=name,owned_whatsapp_business_accounts{phone_numbers{verified_name,display_phone_number,status,name_status}}
- Use the retrieved
whatsapp_phone_number
and other necessary information to create an AdSet with the following payload:{ "campaign_id": "12021406212175....", "name": "test - Ad Set 1", "status": "ACTIVE", "optimization_goal": "LINK_CLICKS", "billing_event": "IMPRESSIONS", "bid_strategy": "LOWEST_COST_WITHOUT_CAP", "bid_amount": "", "targeting": { "genders": [1, 2], "age_min": 25, "age_max": 65, "age_range": [25, 40], "flexible_spec": [/* Object */], "geo_locations": {"cities": [/* Array */]}, "targeting_automation": {"advantage_audience": 1}, "custom_audiences": [] }, "promoted_object": { "page_id": "1044616118...", "whatsapp_phone_number": "5730535...." }, "daily_budget": 1000, "destination_type": "WHATSAPP" }
- The API responds with the error described above, indicating that the WhatsApp phone number is not linked to the account.
Expected Behavior
The AdSet should be successfully created using the API with the same configuration that works when created through Meta Ads Manager.
Actual Behavior
The API returns an error stating:
"Campaign Creation Failed: This WhatsApp phone number is not linked to your account"
.
Additional Context
- API Scopes Used:
[ "pages_show_list", "ads_management", "ads_read", "business_management", "instagram_basic", "instagram_content_publish", "whatsapp_business_management", "pages_read_engagement", "whatsapp_business_messaging", "public_profile" ]
- The phone number is correctly retrieved using the
owned_whatsapp_business_accounts
field of theme/businesses
endpoint and is linked to the same business account used for the ad campaign. - When I check the AdSet created through Meta Ads Manager in the Graph API Explorer, the structure matches the payload sent through the API.
Steps Tried to Resolve
- Confirmed that the phone number is linked to the correct business account.
- Verified that the access token has all necessary permissions.
- Successfully created an AdSet using the same phone number via Meta Ads Manager.
- Compared the structure of the AdSet created via Ads Manager and the payload sent via the API.
Request
- Please confirm if there are additional steps required to link the WhatsApp phone number to the ad account when using the API.
- Verify if this is a known bug or limitation in the API.
- Provide guidance on resolving this issue programmatically.
Metadata
Metadata
Assignees
Labels
No labels