Skip to content

Instantly share code, notes, and snippets.

@dailymotion-api
Last active October 19, 2018 15:32
Show Gist options
  • Save dailymotion-api/8242251 to your computer and use it in GitHub Desktop.
Save dailymotion-api/8242251 to your computer and use it in GitHub Desktop.
Basic examples showing how to perform video upload using Dailymotion API
<?php
// Using php sdk
$url = $api->uploadFile($testVideoFile);
$api->post(
'/videos',
array('url' => $url,
'title' => 'PHP SDK test upload',
'published' => true,
'channel' => 'videogames')
);
# first, get an upload url
curl -i https://api.dailymotion.com/file/upload?access_token=XXX
# then, upload the file
curl -F 'file=@/path/to/video.mp4' [UPLOAD_URL]
# finally, create the video
curl -F 'access_token=XXX' -F 'url=[UPLOAD_URL]' -F 'title=' https://api.dailymotion.com/videos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment