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.

Tag:facebook-graph-api, facebook-marketing-api

4 comments.

  1. C3roe

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

    1. Naufal Shabir

      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.

    2. C3roe

      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?

  2. Dantas

    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

Add a new comment.