Get started with Authentication

📘

You are reading API v2 documentation

Still using the Legacy API? Access the Legacy API documentation.


To access protected resources and perform actions through the Dailymotion API (such as uploading a video, creating a Player, etc), your application must be granted the appropriate permissions.

This is achieved through two combined elements:

  • A private API keys generated from the Dailymotion Studio of the profile you intend to interact with.
  • An access token obtained via the OAuth 2.0 authentication flow.


1 - Create a private API key

  1. Log into your Dailymotion Studio with an Owner or Admin account.
  2. Go to Organization → API keys → Create API key.
  3. Select Private API key, and give it a title and description. 
  4. Define whether the key applies to all channels in your Organization, or to specific ones only.
  5. Toggle on the permissions tied to the key.
  6. Click Create and securely store your API key and secret.
❗️

Important

The API secret is only shown once. Make sure to save it before closing the pop-up window.


2 - Request an access token

Make a POST request to the token endpoint:

POST https://oauth2.dailymotion.com/v2/token

Request header:

HeaderValue
Content-Typeapplication/x-www-form-urlencoded

Include the following request body parameters:

ParameterDescription
grant_typeSet to client_credentials
client_idThe API key from step 1
client_secretThe API secret from step 1
scopeSpace-separated list of required scopes

Request example:

curl -X POST https://oauth2.dailymotion.com/v2/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=<YOUR_CLIENT_ID>" \
  -d "client_secret=<YOUR_CLIENT_SECRET>" \
  -d "scope=bundle.publisher"

3 - Authentication response

If your request is successful, you'll get a JSON response containing the access token:

{
  "access_token": "eyJhbGciOiJSUzI1N...",
  "token_type": "Bearer",
  "expires_in": 1800,
  "scope": "bundle.publisher"
}
Response fieldDescription
access_tokenJWT token to use in API requests
token_typeAlways Bearer
expires_inToken validity in seconds. Tokens expire after 30 minutes (1800 seconds).
scopeThe permissions granted to this token

4 - Use the access token

Include the access token in the Authorization header of every API request.

Format:

Authorization: Bearer <ACCESS_TOKEN>

Request example:

curl -X GET https://api.dailymotion.com/v2/me \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1N..."
 
// Change "/me" for any API call you want to perform




Security best practices

  • Token expiration: Access tokens expire after 30 minutes (1800 seconds). You'll need to request a new token when the current one expires.
  • Secret: Never expose your client_secret in client-side code or public repositories.
  • Scope: Only request the scopes that your application actually needs. To request multiple scopes, separate them by a space (eg. video.manage player.manage)




Did this page help you?