douyu0845 2019-03-16 21:07
浏览 97

facebook php api Param“place”必须是有效的地方标签ID

Question is about tagging other pages in a video upload via facebook api

I'm trying to create a facebook post via the php API. I'm able to upload videos or photos, but when I want to "tag" (the equivalent of "with") in a post I'm unable to...

I'm able to get the place ID via

https://graph.facebook.com/search?q=name_of_place_&type=place&access_token=token

$videoData = array( 'description' => $facebook_caption, 
                        'source' => $fb->videoToUpload($media_path) , 
                        'title' => $facebook_title,
                        'place' => ['id'=>'place_ID','name'=>'placeName'],
                        'tags' => 'facebookpageuser1,facebookpageuser2'
                       );
    $response = @$fb->post('/me/videos',$videoData,$pageAccessToken);
    $graphNode = $response->getGraphNode(); 

I get an error : "Param place must be a valid place tag ID"

Fatal error: Uncaught Facebook\Exceptions\FacebookAuthenticationException: (#100) Param place must be a valid place tag ID in .../vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php on line 115

is someone know how to add a "valid place tage ID" ?

Thanks

  • 写回答

1条回答 默认 最新

  • duanqizao6492 2019-03-17 09:05
    关注

    Place tag has no name parameter. See in the documentation: Place Tag But according to the documentation, the post method uses a parameter referring to Place. There, this parameter occurs - Place Also note that the correct identifier is a number string.

    Solution 1, Try without the name parameter. Maybe the error is in the documentation.:

    'place' => ['id'=>'place_ID'],
    

    Solution 2, I'm not sure if the parameter should be an array (The documentation does not show this). Therefore, if solution 1 does not work, try using json:

    'place' => json_encode(['id'=>'place_ID']),
    
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?