dailymotion-sdk-php
dailymotion-sdk-php copied to clipboard
Return video id after upload
Hi, I created a system to upload a video on dailymotion and I would like to return the ID (video id) of this one just after sending. Do you have an example ? I will build the link based on this ID
Hello @gtraxx, based on this upload code sample you can retrieve your video ID in result of the post method as it's a default video field.
Example:
$url = $api->uploadFile('/path/to/your/video.mp4');
$result = $api->post(
'/user/<CHANNEL_ID>/videos',
array(
'url' => $url,
'title' => 'My Title',
'tags' => 'add,your,tags',
'channel' => 'videogames',
'published' => true,
'is_created_for_kids' => false,
)
);
var_dump($result['id']);
thanks :D