It can happen that an API request returns an error. In this article, we'll show you how a response with an error looks like, and the meaning of the most common errors received so you can troubleshoot them easily.
API v2 now availableVisit the API v2 documentation or follow the migration guide to upgrade.
Receiving errors
Below is an example of an API request with an invalid video ID:
GET https://partner.api.dailymotion.com/rest/video/xnotfound
This call will return the following error response which contains an error code, a message and an error type.
{
"error": {
"more_info": "https://developer.dailymotion.com/api#error-codes",
"code": 404,
"message": "Can't find object video for `id' parameter",
"type": "not_found",
"error_data": {
"reason": "object_not_found",
"object_type": "video",
"object_id": "xnotfound",
"param": "id"
}
}
}These informations can help you identify the issue with your call and troubleshoot it easily.
In this article, you'll find the list of the most common error codes, error types and video access errors.
Error codes
The Dailymotion Platform API uses conventional HTTP response codes to indicate success or failure of an API request:
2xxrange indicates success4xxrange indicates an error resulting from invalid provided information (e.g. a required parameter is missing, invalid access token, etc.)5xxrange indicates an error with the Dailymotion servers
| HTTP error code | Corresponding Dailymotion errors |
|---|---|
400 Bad Request | The API call requires authentication but it was not presented or was wholly invalid, or the API call was invalid invalid_parameter missing_required_parameter |
401 Unauthorized | A valid access token should be provided. This error may come from an expired access token. |
403 Forbidden | The request is understood but has been denied, or access is not allowed. An accompanying error message will explain why. This code is used when requests are being denied due to spam activity, or the request requires higher privileges than provided by the access token. |
404 Not Found | The requested object was not found (can also be thrown when you request non active users, censored videos, etc.). |
405 Method Not Allowed | Invalid HTTP Method + method_not_allowed error type. |
500 Internal Server Error | This API error covers any other type of problem (e.g.: a temporary problem with the Dailymotion servers) and should turn up only very infrequently. Check the associated message for more information. |
501 Not Implemented | The specified method does not exist invalid_method |
Error types
Here's a list of error types you may encounter in errors returned by the API:
| Error types | Type descriptions |
|---|---|
access_forbidden | Thrown when the user doesn't have the permission to access the data (e.g. missing a required scope to access certain fields) |
deleted | The requested object has been deleted |
invalid_method | The API endpoint or object connection is invalid |
invalid_parameter | Your request contains invalid parameters (e.g. you set an invalid data type for a field) |
method_not_allowed | The API call is correct, but the method is not allowed (e.g.: replace a video URL before encoding process is over) |
missing_required_parameter | You forgot a required parameter in your API call |
not_found | The requested object was not found |
write_failure | The data you tried to set using the API could not be saved, this is generally a temporary error that will resolve itself over time |
Video access errors
When requesting access to a video, the API may return a message in the access_error field explaining why the access can't be granted. Here are the different access error codes you may encounter:
| Error codes | Error description |
|---|---|
DM001 | No video has been specified, you need to specify one. Displays: No video available Sorry, this content is no longer available |
DM002 | Content has been deleted. Displays: Video has been deleted This video is no longer available |
DM003 | Live content has ended, it is not available. Displays: Live stream offair |
DM005 | Content rejected: This video may have been removed due to a breach of the terms of use, a copyright claim or an infringement upon third party rights. Displays: This video was deleted for violating our Terms of useThis content is no longer available |
DM006 | Publishing in progress. It has a reload button that will reload the video. Displays: Publication in progressVideo available shortly, please try reloading. |
DM007 | Video geo-restricted by its owner. Displays: Video not availableThis video is not available in your region |
DM008 | Explicit content. Displays: |
DM010 | Private content. Displays: Private videoThe publisher has marked this video as private |
DM011 | An encoding error occurred. Displays: Video not availableAn error occurred while encoding this video |
DM012 | Encoding in progress. It has a reload control that will reload the video Displays: Encoding in progressPlease try reloading |
DM013 | This video has no preset (no video stream). Displays: Video not availableThis video stream can't be reached right now |
DM014 | This video is blocked on your device by its owner. Displays: |
DM016 | Content not available on this website, it can only be watched on Dailymotion. Displays: |
DM017 | Live expired. Displays: Video no longer availableSorry, this content is no longer available |
DM018 | Live will start soon. Displays: Live in xH xM xS |
DM019 | This content has been uploaded by an inactive channel, its access is limited. Displays: Content is not availableThe video you requested is owned by inactive user. Its access has been limited |
DM020 | Content blocked on Dailymotion platforms (dailymotion.com and mobile applications). Displays: |
