How to resolve "Unknown path components" error when updating Facebook campaign status via API?
I am trying to change the status of a Facebook campaign using their Marketing API as documented here. However, I keep encountering the following error:
{ "error": { "message": "Unknown path components: /<campaignId>", "type": "OAuthException", "code": 2500, "fbtrace_id": "AZruauHBbtO4IzLuRmF90c-" } }
Here is the full API request I'm making:
https://graph.facebook.com/v19.0/act_<accountId>/campaigns/<campaignId>?access_token=<token>&status=PAUSED
I've tried double-checking my IDs and access token, and they are correct.
Can anyone help me understand what might be going wrong and how to fix this error?
What I've tried:
Verifying that the campaign ID and access token are correct.
Checking if the endpoint and parameters are correctly formatted.
Quote right from the place that you linked to:
You can update a Campaign by making a POST request to /{campaign_id}.
- so the act_<accountId>/campaigns/ part you had in your request URL, doesn't belong in there. (That is only necessary when creating a campaign under a specific account, or modifying the relation between account and campaign.)
Thanks for the help! Your suggestion worked, and I was able to change the campaign status from active to paused. But now I'm running into another issue. I can pause the campaign, but I can't change it back to active. Even though the response says success, the status doesn't actually update.
Documentation says, "If it is set to PAUSED, its active child objects will be paused and have an effective status CAMPAIGN_PAUSED." - so I'm guessing you might need to re-activate those child objects explicitly then, or something?
I could update the campaigns (PAUSE/ACTIVE) using the following URL structure:
https://graph.facebook.com/v20.0/<<CPG_ID>>?access_token=<<YOUR_TOKEN>>&status=ACTIVE