I'm using the
dailymotion API to upload videos but I want to get the id of the newly uploaded video but I do not know how to do it. Could someone help me?
I have this code:
$api->setGrantType( Dailymotion::GRANT_TYPE_PASSWORD, $apiKey, $apiSecret, array('write', 'delete', 'manage_videos'), // OAuth 2.0 scopes that you'd like to be granted by the end-user array( 'username' => dailymotion_uname, // don't forget to sanitize this, 'password' => dailymotion_password, // never use POST variables this way ) ); // $data['video_id'] = "test"; $url = $api->uploadFile( getcwd().DIRECTORY_SEPARATOR ."video".DIRECTORY_SEPARATOR .$data['video_id'].".mp4"); $api->post( '/me/videos', array( 'url' => $url, 'title' => $data['title'], 'description' => $data['info'], 'channel' => dailymotion_channel, 'published' => true, ) );
If someone wants to help me, I leave you the documentation of the api: