I am doing some development for my app and am trying to retrieve leads created using the leads testing tool. I have tested with page access token and its working fine. However, when I try to fetch lead data using app access token, I hit this error.
"(#3) Apps in dev mode should only access leads submitted from App special roles (testers, developers, admin)",
The app itself is already in live mode, so I don't see any reason why we are hitting this error.
What I did: Sent a GET request using the endpoint https://graph.facebook.com/v17.0/ using app access token.
What I expected: To receive lead data as specified in the documentation - https://developers.facebook.com/docs/marketing-api/guides/lead-ads/retrieving/
What I received:
{ "error": { "message": "(#3) Apps in dev mode should only access leads submitted from App special roles (testers, developers, admin)", "type": "OAuthException", "code": 3, "fbtrace_id": } }
I was struggling with the same issue and I managed to figure out the solution
tldr; for the API call to succeed, you need to make a call with the user access token.
So I submitted the lead using the Lead Ads Testing Tool but was not able to retrieve it with the Marketing API because of the exact error
(#3) Apps in dev mode should only access leads submitted from App special roles (testers, developers, admin)This quote is more for the context. The Meta Lead Ads guide reads the following:
The Retrieving Leads docs says:
I then generated an access token with the permissions mentioned above using Graph API Explorer as noted on the Authentication page for Marketing API:
Then I made a call to the Marketing API with the generated user token and managed to retrieve the lead by its id.
Hope this helps!