2017-04-22 140 views
0

我正嘗試在我的粉絲頁中創建一個新帖子,並附上已上傳和發佈的視頻。進入頁面菜單 - >「發佈工具」 - >「視頻庫」可以點擊已發佈的視頻並創建新帖子,但是我不知道如何使用Facebook API創建這個新的發佈+視頻。如何使用Facebook API「使用視頻創建帖子」?

+0

https://developers.facebook.com/docs/graph-api/video-uploads#crosspostedvideos – CBroe

+0

非常感謝您! –

回答

0

解決!

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) 
相關問題