Restart failed video processing task

ID: video_processing_tasks/restart
Restart failed task. User can restart failed requests.

Request

URL
/api/v1/video_processing_tasks/:id/restart.json
Method
PATCH
Format
json
Headers
Name Value Description Required
Authorization: Token token=:token_value :token_value - is an authorization token value (api_token) Yes
Url params
{
idstring // Failed task database ID; required; example value: bc0eb01898341204a135ccdf
}
Data params

Responses

Success
HTTP Status
202 ACCEPTED
Format
json
Data params
{
idstring, // Video processing task database ID; example value: 8497dfa637d47078da911bf8
trim_startinteger, // Video start trimming parameter in seconds; example value: 8
trim_endinteger, // Video end trimming parameter in seconds; example value: 17
source_video // document, Source video file details
{
urlstring, // source file url; example value: http://video_processor.dev/system/video_processing_tasks/source_videos/57d4/6ce8/07ae/1d3b/2b95/ad50/original/test_video.mov?1473539304
durationinteger // source file duration; example value: 101
}
,
result_video // document, Result video file details
{
urlstring, // result file url; example value: http://video_processor.dev/system/video_processing_tasks/result_videos/36d4/6ce8/07ae/1d3b/2b75/ad50/original/test_video.mov?1773499304
durationinteger // result file duration; example value: 10
}
,
started_attimestamp, // Task started at unix timestamp
completed_attimestamp, // Task completed at unix timestamp
failed_attimestamp, // Task failed at unix timestamp
created_attimestamp, // Task created at unix timestamp
updated_attimestamp, // Task updated at unix timestamp
statestring, // Task state. Could be: scheduled, processing, done, failed; example value: failed
last_errorstring // Task last error message that happened during video processing; example value: FFMPEG: Failed encoding
}
Task is not in 'failed' state (Can not be switched to 'scheduled' state)
HTTP Status
422 UNPROCESSABLE ENTITY
Format
json
Data params
{
errorstring, // Human readable error message; example value: Cannot switch state from done via schedule
detailsdocument // error details, can be used for highlighting invalid fields at native app UI
}
Task is not found
HTTP Status
404 NOT FOUND
Format
json
Data params
{
errorstring, // Human readable error message; example value: Couldn't find this data
detailsdocument // error details, can be used for highlighting invalid fields at native app UI
}
User is not authorized
HTTP Status
401 UNAUTHORIZED
Format
json
Data params
{
errorstring // Api Token is not valid error message; example value: Bad Credentials
}
Sample Call
curl -v -H "Authorization: Token token=YwXdQ64vI5oam8ukfUx4SAtt" -H "Accept: application/json" -H "Content-type: application/json" -X PATCH http://video_processor.dev/api/v1/video_processing_tasks/57d52ca107ae1d24852e6afe/restart.json
Sample Response
{
   "id":"57d52ca107ae1d24852e6afe",
   "trim_start":3,
   "trim_end":12,
   "state":"scheduled",
   "last_error":null,
   "source_video":{
      "url":"http://video_processor.dev/system/video_processing_tasks/source_videos/57d5/2ca1/07ae/1d24/852e/6afe/original/test_video.mov?1473588385",
      "duration":15
   },
   "result_video":{
      "url":null,
      "duration":null
   },
   "started_at":null,
   "completed_at":null,
   "failed_at":null,
   "created_at":1473588385,
   "updated_at":1473590738
}