Search code examples
facebook-graph-apifacebook-marketing-api

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.


Solution

  • 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.)