Error management
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.
Receiving errors
Below is an example of an API request with an invalid video ID:
GET https://api.dailymotion.com/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:
2xx
range indicates success4xx
range indicates an error resulting from invalid provided information (e.g. a required parameter is missing, invalid access token, etc.)5xx
range 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 code | Error description |
---|---|
DM001 | No video has been specified, you need to specify one. |
DM002 | Content has been deleted. |
DM003 | Live content is not available, i.e. it may not have started yet. |
DM004 | Copyrighted content, access forbidden. |
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). |
DM006 | Publishing in progress… |
DM007 | Video geo-restricted by its owner. |
DM008 | Explicit content |
DM009 | Explicit content (offsite embed) |
DM010 | Private content |
DM011 | An encoding error occurred |
DM012 | Encoding in progress |
DM013 | This video has no preset (no video stream) |
DM014 | This video has not been made available on your device by its owner |
DM015 | Kids host error |
DM016 | Content not available on this website, it can only be watched on Dailymotion |
DM019 | This content has been uploaded by an inactive channel and its access is limited |