Last active
October 19, 2018 15:32
-
-
Save dailymotion-api/8242251 to your computer and use it in GitHub Desktop.
Basic examples showing how to perform video upload using Dailymotion API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Using php sdk | |
$url = $api->uploadFile($testVideoFile); | |
$api->post( | |
'/videos', | |
array('url' => $url, | |
'title' => 'PHP SDK test upload', | |
'published' => true, | |
'channel' => 'videogames') | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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