Skip to content

Instantly share code, notes, and snippets.

@ritik1009
Created December 5, 2022 01:15
Show Gist options
  • Save ritik1009/79b2fe70b6f8971ddaecaf37fe056fc3 to your computer and use it in GitHub Desktop.
Save ritik1009/79b2fe70b6f8971ddaecaf37fe056fc3 to your computer and use it in GitHub Desktop.
graph_url = 'https://graph.facebook.com/v15.0/'
def post_reel(caption='', media_type ='',share_to_feed='',thumb_offset='',video_url='',access_token = '',instagram_account_id):
url = config.graph_url + instagram_account_id + '/media'
param = dict()
param['access_token'] = access_token
param['caption'] = caption
param['media_type'] = media_type
param['share_to_feed'] = share_to_feed
param['thumb_offset'] = thumb_offset
param['video_url'] = video_url
response = requests.post(url,params = param)
print("\n response",response.content)
response =response.json()
return response
############################################ OUTPUT ############################################
{
"id": "17889455560051444"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment