Open mkantautas opened 5 years ago
I got the same issue here. Even though we grant all the right for system user, the call still fail afterwards.
same problem...but if i run outside php on Insomnia it returns 200 with expected data... i'm trying with instagram graph...
problem solved for me....i was using extra curl options that was returning an error....
before - returning error
$baseUrl = "https://graph.instagram.com/me";
$ch = curl_init();
$query = ['fields' => 'id, username', 'access_token'=> $user_token];
curl_setopt($ch, CURLOPT_URL, $Url);
//curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type" => "application/json; charset=UTF-8") );
curl_setopt($ch, CURLOPT_POSTFIELDS , http_build_query($query));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
$user_data = curl_exec($ch);
After - works like a charm
$Url = "https://graph.instagram.com/me?fields=id,username&access_token=". $user_token;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $Url);
$user_data = curl_exec($ch);
My app is set to development status and I generate a fb access token for ads_read scope permission, but when trying to use it to view ad_accounts I get this strange error:
If I do everything the same, but switch the app to production, then I get this error:
Which is even more bizzare, because I don't need ads_management permission to do this request:
me?fields=id,name,adaccounts{name,account_id,id}
, but even though I've tried adding that permission and recreated a new fb access token and then on the same attempt I got the same issue about not havingads_management
permission.Any ideas or leads how can I resolve this? I kinda feel this might be a bug on facebook end. I have tried generating a fb access token from a different fb user, which only has one fb ad account and everything worked without any issues. It seems this issue only appears with this one facebook account which has access to 400++ facebook ad accounts.