可以使用图谱api在视频中标记朋友吗? [英] Is it possible to tag friends in video with graph api?
问题描述
我没有发现任何相关信息.可能是我会错误地进行搜索. 我想在视频中标记朋友.
I haven't find anything related. Might be i would have searched wrongly. I want to tag friends in video.
我该如何在Facebook中使用图形API?
How do i do that using graph api in facebook?
推荐答案
可以在视频中标记朋友,但不在文档中.我已经搜索了很长时间,但无济于事,但随后尝试了几件事并使其起作用.
It is possible to tag friends in a video, but it's just not in the documentation. I've searched quite some time myself to no avail, but then tried a couple of things and got it working.
您需要的两个权限是publish_actions和user_videos.
The two permissions you need are publish_actions and user_videos.
它的工作原理与标记照片非常相似,这是通过/{photo_id}/tags
端点完成的.尽管在文档中找不到等效的视频/{video_id}/tags
,但显然确实存在.
对于照片,您可以将参数tags
作为数组提供.视频标记每次使用tag_uid
参数仅支持一个标记.因此,如果您想标记多个人,则必须撰写多个帖子.
It works quite similar to tagging photos, which is done with the /{photo_id}/tags
endpoint. Although the video equivalent /{video_id}/tags
is nowhere to be found in the documenation, it apparently does exist.
With photos you can supply the parameter tags
as an array. Video tagging only supports one tag at a time with the tag_uid
parameter. So if you want to tag multiple people, you'll have to do multiple posts.
这是PHP SDK的最终工作解决方案:
This is the final working solution with the PHP SDK:
$facebook = new Facebook(array('[YOUR_APP_ID]', '[YOUR_APP_SECRET]'));
$response = $facebook->api('/me/videos', 'POST', array(
'access_token' => $facebook->getAccessToken(),
'title' => '[YOUR_TITLE]',
'description' => '[YOUR_DESCRIPTION]',
'source' => '@' . realpath('[PATH_TO_YOUR_VIDEO')
));
$facebook->api('/' . $response['id'] . '/tags', 'POST', array(
'access_token' => $facebook->getAccessToken(),
'tag_uid' => '[FRIENDS_FACEBOOK_ID]'
));
这篇关于可以使用图谱api在视频中标记朋友吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!