/search

GET /search/fields 1026 (ready) Gets the search fields
This request requires authentication headers to be set. See HTTP Headers below.
Gets the search fields.
The response of this request has a 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

Example response

{
	"fields": [{
		"name": "Global",
		"solrField": "global",
		"isOperatorOnly": false,
		"isUserOnly": false,
		"seqno": 10
	},
	{
		"name": "Account number",
		"solrField": "account_id",
		"isOperatorOnly": true,
		"isUserOnly": false,
		"seqno": 15
	},
	{
		"name": "Account name",
		"solrField": "account_name",
		"isOperatorOnly": true,
		"isUserOnly": true,
		"seqno": 17
	},
	{
		"name": "Job number",
		"solrField": "job_id_search",
		"isOperatorOnly": false,
		"isUserOnly": false,
		"seqno": 20
	},
	{
		"name": "Job name",
		"solrField": "job_name",
		"isOperatorOnly": false,
		"isUserOnly": false,
		"seqno": 30
	},
	{
		"name": "File name",
		"solrField": "file_name_search",
		"isOperatorOnly": false,
		"isUserOnly": false,
		"seqno": 40
	},
	{
		"name": "Job instruction",
		"solrField": "job_descr",
		"isOperatorOnly": false,
		"isUserOnly": false,
		"seqno": 50
	},
	{
		"name": "Job tags",
		"solrField": "job_tags_search",
		"isOperatorOnly": false,
		"isUserOnly": true,
		"seqno": 60
	},
	{
		"name": "File tags",
		"solrField": "file_tags_search",
		"isOperatorOnly": false,
		"isUserOnly": true,
		"seqno": 70
	},
	{
		"name": "File instruction",
		"solrField": "remark_to_proc",
		"isOperatorOnly": false,
		"isUserOnly": false,
		"seqno": 75
	},
	{
		"name": "Invoice reference",
		"solrField": "invoice_reference",
		"isOperatorOnly": false,
		"isUserOnly": true,
		"seqno": 80
	},
	{
		"name": "Number of images",
		"solrField": "number_of_files",
		"isOperatorOnly": false,
		"isUserOnly": false,
		"seqno": 90
	}],
	"_type": "GetSearchFieldsResponseBody"
}

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
{
  "code": "missing_header",
  "message": "A required header was not supplied.",
  "headerName": "X-Client-Token"
}

Status Codes

200 OK
The resource was found
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
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)
POST /search 1009 (ready) Search for jobs
This request requires authentication headers to be set. See HTTP Headers below.

Searches for jobs.

Important: For better search capabilities job has to be indexed. This might cause a delay before any job changes are visible in search results.

"field" should be one of the ids from the response of GET /search/fields.

The request body has the following structure:

{
  "page": 0,
  "field": "Global",
  "query": "",
  "statuses": [
    "CJ_NEW",
    "CJ_ACCEPT"
  ],
  "dateFrom": "2016-01-14T14:57:33.8931021+01:00",
  "dateTo": "2016-01-28T14:57:33.8931021+01:00"
}
The following values for Content-Type are accepted: application/x-www-form-urlencoded, application/json.
When Content-Type is any other value, 415 Unsupported Media Type is returned.
The response of this request has a 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)
field string false Field to search for. List of fields can be obtained via GET /search/fields request "Global"
query string false Query to search "Search for this"
page integer false Search result page 0
statuses string false List of statuses to search in [ "CJ_NEW", "CJ_REQUEST_OFFER" ]
dateFrom datetime false Search for jobs that where created after dateFrom 2016-05-06T15:22:02.86Z
dateTo datetime false Search for jobs that where created before dateTo 2016-08-06T15:22:02.86Z

Example response

{
	"totalJobs": 402,
	"jobs": [{
		"id": 0,
		"accountId": 23147,
		"status": "ERROR",
		"guid": "5991ee2e-85d3-43d3-a7f2-8c15cc6859dd",
		"name": "Rejected pictures of job #345402",
		"description": "",
		"acceptedDate": null,
		"createdDate": "2015-11-04T13:47:40.7Z",
		"deliveredDate": "2015-11-04T13:48:47.92Z",
		"orderedDate": null,
		"reviewedDate": null,
		"realCost": 0,
		"fileCount": 1
	},
	{
		"id": 0,
		"accountId": 23147,
		"status": "ERROR",
		"guid": "98ec040f-ff42-4ea3-b06b-6061208e97a5",
		"name": "Rejected pictures of job #345248",
		"description": "",
		"acceptedDate": null,
		"createdDate": "2015-09-17T13:27:26.3Z",
		"deliveredDate": null,
		"orderedDate": null,
		"reviewedDate": null,
		"realCost": 0,
		"fileCount": 1
	},
	{
		"id": 0,
		"accountId": 23147,
		"status": "ERROR",
		"guid": "bc2b1e6b-c84b-4d43-b6cf-58869c96f8ad",
		"name": "Rejected pictures of job #345248",
		"description": "",
		"acceptedDate": null,
		"createdDate": "2015-09-17T13:26:44.797Z",
		"deliveredDate": null,
		"orderedDate": null,
		"reviewedDate": null,
		"realCost": 0,
		"fileCount": 1
	},
	{
		"id": 0,
		"accountId": 23147,
		"status": "ERROR",
		"guid": "700486b4-fd97-46d3-a486-5ec4d65e5511",
		"name": "Rejected pictures of job #345044",
		"description": "",
		"acceptedDate": null,
		"createdDate": "2015-09-11T10:18:13.05Z",
		"deliveredDate": null,
		"orderedDate": null,
		"reviewedDate": null,
		"realCost": 0,
		"fileCount": 1
	},
	{
		"id": 0,
		"accountId": 23147,
		"status": "ERROR",
		"guid": "4e3c891d-1d58-493b-b5bf-f3de8fcecfb8",
		"name": "Rejected pictures of job #344983",
		"description": "",
		"acceptedDate": null,
		"createdDate": "2015-09-02T15:29:53.897Z",
		"deliveredDate": null,
		"orderedDate": null,
		"reviewedDate": null,
		"realCost": 0,
		"fileCount": 2
	},
	{
		"id": 0,
		"accountId": 23147,
		"status": "ERROR",
		"guid": "09c25a6b-a73f-42cb-ad95-86e5a15551f9",
		"name": "Rejected pictures of job #345034",
		"description": "",
		"acceptedDate": null,
		"createdDate": "2015-08-25T15:50:54.697Z",
		"deliveredDate": null,
		"orderedDate": null,
		"reviewedDate": null,
		"realCost": 0,
		"fileCount": 1
	},
	{
		"id": 0,
		"accountId": 23147,
		"status": "ERROR",
		"guid": "024e3c75-725b-46b1-b010-eb2815107d63",
		"name": "Rejected pictures of job #345033",
		"description": "",
		"acceptedDate": null,
		"createdDate": "2015-08-25T15:41:58.48Z",
		"deliveredDate": null,
		"orderedDate": null,
		"reviewedDate": null,
		"realCost": 0,
		"fileCount": 1
	},
	{
		"id": 0,
		"accountId": 23147,
		"status": "ERROR",
		"guid": "d067f6e6-0ca6-40a0-af1a-6698e516605f",
		"name": "Rejected pictures of job #345033",
		"description": "",
		"acceptedDate": null,
		"createdDate": "2015-08-25T15:29:52.69Z",
		"deliveredDate": null,
		"orderedDate": null,
		"reviewedDate": null,
		"realCost": 0,
		"fileCount": 1
	},
	{
		"id": 0,
		"accountId": 23147,
		"status": "ERROR",
		"guid": "5bdf2ed0-55f3-475e-b22b-6a16cf9ea53d",
		"name": "Rejected pictures of job #345033",
		"description": "",
		"acceptedDate": null,
		"createdDate": "2015-08-25T15:28:19.533Z",
		"deliveredDate": null,
		"orderedDate": null,
		"reviewedDate": null,
		"realCost": 0,
		"fileCount": 1
	},
	{
		"id": 0,
		"accountId": 23147,
		"status": "ERROR",
		"guid": "c164a718-c2bb-407a-8f9c-40f25dc4228a",
		"name": "Rejected pictures of job #345033",
		"description": "",
		"acceptedDate": null,
		"createdDate": "2015-08-25T15:25:57.69Z",
		"deliveredDate": null,
		"orderedDate": null,
		"reviewedDate": null,
		"realCost": 0,
		"fileCount": 1
	}],
	"_type": "SearchResponseBody"
}

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
{
  "code": "missing_header",
  "message": "A required header was not supplied.",
  "headerName": "X-Client-Token"
}
invalid_json The request body could not be parsed.
{
  "code": "invalid_json",
  "message": "The request body could not be parsed."
}

Status Codes

200 OK
The resource has been updated
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)