Get started with Authentication
Overview
To access protected resources and perform actions (such as editing a video, creating a Player, etc) on behalf of a Dailymotion profile, you need to be granted permission by this profile.
This can be done via the combined actions of the API keys, generated from the Dailymotion Studio of the profile you intend to interact with, and the authentication (access token request).
In this guide, we’ll walk you through the steps of the authentication process:
- Create an API key that will be used to grant permissions to users who need to interact with your Dailymotion account.
- Request an access token.
- Retrieve the access token.
- Interact with the protected resources of the Dailymotion account using the above access token.
Understand endpoints and API keys
Within the API reference, you'll understand how to identify the right API key type for your use case, get endpoints compability, and choose the right authentication flow.
API key types overview – Explains the difference between Public and Private API keys, what each is used for, and how they behave (client-side vs server-side).
Endpoint compatibility matrix – Lists the main Dailymotion API endpoints (api.dailymotion.com and partner.api.dailymotion.com) and specifies which key type is required for each.
Authentication methods – Describes the available OAuth 2.0 grant types (Client Credentials, Password, Authorization Code) and shows which are supported by each key type.
Learn more directly within our API reference - https://dailymotion.readme.io/reference/authentication-api#/
Get started with Authentication
1 - Create an API key
Follow the steps below to create a public API key:
- Log into your Dailymotion Studio with an Owner or Admin account.
- Go to Organization → API keys → Create API key.
- Select the API key type you would like to use - Public API key or Private API key
- Give the key a title and description. 
- Provide a Callback URL if you intend to use the “Authorization Code” grant type. For “Client Credentials” or “Password” grants, a Callback URL is not required.
- (Private only) - Specify whether the key applies to all channels in your organization or to specific channels, and define the permissions tied to the key. 
- Click Create.
Your API key has been created! We invite you to store your API key and API secret securely.
ImportantThe API secret of a private API key is only displayed once. Make sure to save it before closing the pop-up window.
2 - Request an access token
The Platform API uses the OAuth 2.0 protocol to secure authentication, and supports the different grant type based on your needs to generate access tokens.
We invite you to follow our dedicated authentication guides depending on your use case:
3 - Retrieve the access token
If your request is successful, you will get a JSON response containing the access token in the following format:
{
"access_token": "<ACCESS_TOKEN>",
"token_type": "Bearer",
"expires_in": 36000,
"refresh_token": "<REFRESH_TOKEN>",
"scope": "<SCOPE>"
}The access token is returned in the access_token parameter and remains valid for the time defined in expires_in (time in seconds = 10 hours).
About refresh tokens
The refresh_token (only available with password and authorization_code grant types) enables you to request another access token without the need to ask for user credentials again.
Check our dedicated guide to know how to refresh a token.
4 - Interact with the protected resources
Now that you retrieved an access token, you are ready to use the API!
Include the access token in the Authorization header of every API call. For example:
GET /rest/user/<PROFILE_ID>/videos HTTP/1.1
Host: partner.api.dailymotion.com
Authorization: Bearer <ACCESS_TOKEN>
// Change "/rest/user/<PROFILE_ID>/videos" for any API call you want to performThe Platform REST API will validate the access token to ensure it is authorized to access the requested resource.
Check the API Reference and guides to help you make the most out of the Dailymotion API! We’ve also gathered a few examples below to showcase common use cases.
Updated 12 days ago
