首页 > 解决方案 > 获取商业帐户转换前发布的媒体的覆盖面指标时出现异常[无效参数]

问题描述

这是商业帐户转换之前发布的媒体的情况。问题是我在 Facebook graph api explorer 中得到了正确的响应。

"insights": {
        "data": [
          {
            "values": [
              {
                "value": 8
              }
            ],
            "id": "xxxxxxxxxxxxxxxxx/insights/reach/lifetime"
          }
        ]
      },

但是当尝试使用 api 调用时,xxxxxxxxx/media?fields=media_url,caption,comments_count,permalink,media_type,like_count,timestamp,username,thumbnail_url,insights.metric(reach){values}我得到了

dev.ERROR:工作 >> FacebookInstagramBackTrackOwned >> 异常 >> 无效参数。

'error_subcode' => 2108006,
'is_transient' => false,
'error_user_title' => 'Media Posted Before Business Account Conversion',
'error_user_msg' => 'The media was posted before the most recent time that the user\'s account was converted to a business account from a personal account.'

标签: phpfacebook-graph-apifacebook-php-sdklaravel-5.7

解决方案


我所做的是在捕获异常部分,我检查了错误代码2108006和error_user_title,Media Posted Before Business Account Conversion然后在没有到达参数的情况下进行了调用,这样我就得到了所有其他数据。


推荐阅读