facebook - 无法通过API获取instagram新增企业账号
问题描述
我正面临从 API 检索 Instagram 商业帐户的问题。
客户已经授权我的应用程序,一段时间后他们将 Instagram 个人帐户转换为企业帐户。
当我尝试获取新添加的 Instagram 业务帐户时,它们未显示在 API 响应中。
每次我必须从帐户中删除应用程序并重新授权。我重新验证了应用程序仍然没有获得新添加的业务帐户。
伙计们有什么解决办法吗??
这是更多信息的屏幕截图http://nimb.ws/zfwl7e
function fb_reauthenticate_relink()
{
$helper = $this->fb->getRedirectLoginHelper();
$permissions = ['email', 'public_profile', 'manage_pages', 'read_insights', 'publish_pages', 'instagram_basic', 'instagram_manage_comments', 'instagram_manage_insights'];
$loginUrl = $helper->getReAuthenticationUrl('facebook_reauthenticate_callback', $permissions);
redirect($loginUrl);
}
function facebook_reauthenticate_callback()
{
$helper = $this->fb->getRedirectLoginHelper();
try
{
$accessToken = $helper->getAccessToken();
} catch (Facebook\Exceptions\FacebookResponseException $e)
{
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch (Facebook\Exceptions\FacebookSDKException $e)
{
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$raw_accessToken = (string) $accessToken;
$oAuth2Client = $this->fb->getOAuth2Client();
$longLivedAccessToken = (string) $oAuth2Client->getLongLivedAccessToken($raw_accessToken);
$url = "https://graph.facebook.com/v3.1/me/accounts?fields=instagram_business_account,connected_instagram_account,global_brand_page_name,access_token&access_token=" . $longLivedAccessToken;
$request_response = $this->curl_request($url);
// In $request_response didn't get newly added business profile
}
解决方案
推荐阅读
- c# - XF UWP - MVVM - 如何在嵌套对象中绑定选取器选定项?
- json - 用于在地图上使用 Json 响应的 Future Builder
- python - 无法将站点部署到heroku,显示错误
- sql-server - 实体框架核心中的触发器批量
- ios - 本地通知正文的最大字符数 - React Native iOS
- laravel - 我尝试插入具有多个类别的选择标签数据
- amazon-web-services - 我在 cloudWatch 中的日志大小是多少?
- asp.net-web-api - WebApi 中的 Microsoft Graph Api
- c# - 将 MemoryStream 转换为数组 C#
- bash - 检查文件的十六进制转储是否具有模 4 长度