Skip to content

Instantly share code, notes, and snippets.

@nhunsaker
Last active March 14, 2019 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhunsaker/ed21c1e26bdf101ff57eea214d731b4e to your computer and use it in GitHub Desktop.
Save nhunsaker/ed21c1e26bdf101ff57eea214d731b4e to your computer and use it in GitHub Desktop.
instagram_video_publish_now_curl
curl -X POST \
http://dev.buzzfeed.io:33005/pubhub/drafts \
-H 'Content-Type: application/json' \
-H 'Postman-Token: e4f660d9-bbd6-416f-9968-97fb4559527b' \
-H 'X-Auth-Token: {insert token}' \
-H 'X-Forwarded-Email: your.email@buzzfeed.com' \
-H 'X-Forwarded-User-Id: 1' \
-H 'X-Send-To-Platform: true' \
-H 'cache-control: no-cache' \
-d '{
"title": "this video to publish now is for instagram",
"metadata": {},
"source": "hive",
"type": "instagram_video",
"uuid": 1551729736832,
"content_id": "bfn:gateway::hive:artifacts:12341231",
"content_authored_by": "your.email@buzzfeed.com",
"platform_data": {
"media": {
"video_url": "https://s3.amazonaws.com/video-api-stage/assets/0b23116b013a46f380ba745a3d6456f6/test-pattern-59.mp4"
}
},
"video_url": "https://s3.amazonaws.com/video-api-stage/assets/0b23116b013a46f380ba745a3d6456f6/test-pattern-59.mp4",
"channel_id": 248,
"published_at": "2019-03-04T20:02:28"
}'
@nhunsaker
Copy link
Author

Replace {insert token} with auth token. Set your.email@buzzfeed.com to your email. To schedule remove X-Send-To-Platform: true header. Remove published_at. Set scheduled_at to a future date.

@nhunsaker
Copy link
Author

Get the Draft.id from the returned payload then look up your draft via the API:

https://pubhub-stage.buzzfeed.com/api/pubhub/drafts/{id}
https://pubhub-stage.buzzfeed.com/api/pubhub/jobs?draft_id={id}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment