Create a job under an authenticated and authorized user.
There 2 options to upload images into a job:
- FTP: you can upload images via ftp to URL sepcified in upload.ftpUrl using account credentials
- POST: you can post files with multipart/form-data content type to URL specified in upload.postUrl
Example:
{
name: "Job of fruits",
invoiceReference: "Pay after all fruits are eaten",
description: "Cleap fruits from background",
isTest: true,
deadlineId: 1,
specificationKey: 432
}Content-Type are accepted: application/x-www-form-urlencoded, application/json.When
Content-Type is any other value, 415 Unsupported Media Type is returned.
Content-Type of application/json.Any request should supply an
Accept header explicitly accepting this Content-Type, e.g. Accept: application/json.When an
Accept header is missing, or it has another value, 406 Not Acceptable is returned.
HTTP Headers
| Name | Type | Required | Default value | Description |
| X-Client-Token | string | true | The token identifying the client of the API | |
| X-Session-Token | string | true | The token identifying the session of the current user |
Request body Parameters
| Name | Type | Required | Default value | Description | Example(s) |
| name | string | true | Name of the job | 'Job of fruits' | |
| description | string | true | Description of this job | 'Cleap fruits from background' | |
| invoiceReference | string | false | Provide invoice reference if any | 'Pay after all fruits are eaten' | |
| isTest | boolean | false | Indicate whether job is for testing | true | |
| deadlineId | integer | false | Deadline Id | 1 | |
| specificationKey | integer | false | Specification Key | 432 |
Example response
{
"id": 353413,
"name": "Job of fruits",
"description": "Cleap fruits from background",
"tags": [
"Apple",
"Banana",
"Cucumber"
],
"invoiceReference": "Pay after all fruits are eaten",
"isTest": true,
"upload": {
"ftpUrl": "ftp://dev-storage01.bright-river.com/20160513/353413/ORIGINAL/",
"postUrl": "http://local-storage01.bright-river.com/upload/UploadFile.ashx?jobID=353413&accountID=61731b19-5110-45d7-a321-b08373cf88a4"
},
"download": {
"ftpUrl": "ftp://dev-storage01.bright-river.com/20160513/353413/CLIPPED/",
"getUrl": "http://local-storage01.bright-river.com/ajax/DownloadZip.ashx?centraljobid=353413&sessionID=61731b19-5110-45d7-a321-b08373cf88a4"
},
"_type": "CreateJobResponseBody"
}
Errors
The following 400 Bad Request errors can be expected, and should be handled by the developer:
| Code | Message | Example |
| missing_header | A required header was not supplied |
|
| invalid_json | The request body could not be parsed. |
|
| missing_parameter | A required parameter was not supplied |
|
| invalid_parameter | A parameter was not in the right format |
|
The following custom errors can be expected. They should either be handled by the developer, or require user action:
| Id | Target | Status Code | Code | Default Message | Localized Messages |
| 5 | developer | 400 | name_required | Name is required. |
|
Status Codes
201 Created- The resource has been created
400 Bad Request- The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications
401 Unauthorized- The request requires user authentication
403 Forbidden- The client has no permission to access the resource
404 Not Found- The resource was not found
406 Not Acceptable- The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request
408 Request Timeout- The request timed out
410 Gone- The requested resource is no longer available and will not be available again
411 Length Required- The request did not specify the length of its content, which is required by the requested resource
415 Unsupported Media Type- The Content-Type of the request is not supported. Supported are 'application/x-www-form-urlencoded' and 'application/json'
500 Internal Server Error- The server encountered an unexpected condition which prevented it from fulfilling the request
503 Service Unavailable- The server is currently unavailable (because it is overloaded or down for maintenance)