dailymotion-sdk-php icon indicating copy to clipboard operation
dailymotion-sdk-php copied to clipboard

Return video id after upload

Open gtraxx opened this issue 3 years ago • 1 comments

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

gtraxx avatar Sep 06 '22 12:09 gtraxx

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']);

nicoferron avatar Sep 26 '22 16:09 nicoferron

thanks :D

gtraxx avatar Dec 02 '22 10:12 gtraxx