Skip to content

Instantly share code, notes, and snippets.

@dailymotion-api
dailymotion-api / config.php
Created January 3, 2014 17:59
PHP testing environment Here you can find an example of how to test API actions using simple use-cases
<?php
require_once 'Dailymotion.php';
// ----- account settings -----//
$apiKey = 'yourApiKey';
$apiSecret = 'yourApiSecret';
$testUser = 'someUser';
$testPassword = 'yourPassword';
$videoTestFile = '/path/to/video/test.mp4';
@dailymotion-api
dailymotion-api / delete.php
Created January 3, 2014 17:55
How to delete a video
<?php
// Using php-sdk
$api->delete('/video/' . $videoId);
?>
@dailymotion-api
dailymotion-api / example_js.html
Created January 3, 2014 17:53
Basic authenticated api call with sdk-js
<html>
<head>
<script src="http://api.dmcdn.net/all.js"></script>
<script>
DM.init({
apiKey: 'XXXXXXXXXXXXXXXXXXX',
status: true, // check login status
cookie: true // enable cookies to allow the server to access the session
});
@dailymotion-api
dailymotion-api / edit.php
Created January 3, 2014 17:48
How to edit a video
<?php
// Using our php-sdk
$api->post(
'/video/' . $videoId,
array('title' => 'New Title',
'description' => 'New Description',
....
)
);
@dailymotion-api
dailymotion-api / upload.php
Last active October 19, 2018 15:32
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')