0

I'm new to the Facebook Marketing API and I'm trying to run the example custom_audience_utils.py script only to have it return an error message displaying "Invalid appsecret_proof provided in the API argument". I turned off appsecret_proof in my app. What am I don't wrong?

  • 1
    Turning it of in app settings only means that it is not _mandatory_ for all API requests; but if you _do_ send an app-secret proof with your request, it still has to be valid. I don’t know that example script you are talking about – but most likely either you have configured it wrong, or it is calculating the proof in a wrong way. – CBroe Oct 18 '15 at 02:50
  • Yeah, the problem is almost certainly that you're hardcoding an access token which was generated for a different app ID than the one whose secret you're using to generate the appsecret_proof – Igy Oct 26 '15 at 20:41

1 Answers1

4

I was getting the same error. It turned out that I was using the wrong access token. You might want to check that.

I had generated the access token using the Graph API Explorer. By default the Graph API explorer generates a token for itself (see the application selection pull down on the top right of the page). I was using the app id for my own app (and hence the token was incorrect).

Once I generated a new token for my own app - and used it in the code - the appsecret_proof error went away.

Hope this helps.

Mayank R Jain
  • 3,127
  • 1
  • 29
  • 43
  • I'm pretty sure you're right about this. The token shouldn't even work for the Ads API if it's generated from the Graph API Explorer app. – Paul Bain Oct 22 '15 at 08:43
  • Also because that's the recommended option to get an access token, if you are using Python or anything that's not PHP. – Andor Feb 01 '16 at 15:11