Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Facebook graph api 如何";使用“视频”创建帖子;使用Facebook API?_Facebook Graph Api_Video - Fatal编程技术网

Facebook graph api 如何";使用“视频”创建帖子;使用Facebook API?

Facebook graph api 如何";使用“视频”创建帖子;使用Facebook API?,facebook-graph-api,video,Facebook Graph Api,Video,我正在尝试在我的粉丝页面上创建一个新帖子,其中包含一个已经上传和发布的视频。进入页面菜单->“发布工具”->“视频库”可以单击已发布的视频并制作新帖子,但我不知道如何使用Facebooks API创建新的帖子+视频。解决了 url = "https://graph.facebook.com/v2.9/me/videos" title = "some title" #post title description = "some description" #post

我正在尝试在我的粉丝页面上创建一个新帖子,其中包含一个已经上传和发布的视频。进入页面菜单->“发布工具”->“视频库”可以单击已发布的视频并制作新帖子,但我不知道如何使用Facebooks API创建新的帖子+视频。

解决了

url = "https://graph.facebook.com/v2.9/me/videos"
title = "some title"               #post title
description = "some description"   #post description
crossposted_video_id = "12344444"  #get the video ID and grab it here!
content_category = "LIFESTYLE"     #there are some more categories to use in fb
scheduled_publish_time = ""        #in unix format
published = "false"                #if you want to schedule, set "false"
token = "page access token"        #you can get one in Graph API Explorer

param = {
    "crossposted_video_id": crossposted_video_id,
    "title": title,
    "description": description,
    "content_category": content_category,
    "scheduled_publish_time": scheduled_publish_time,
    "published": published,
    "access_token": token 
}
r = requests.post(url, json=param)