Create job from template
Job create
Create a new job.
Example request:
Parameter | Description | Examples |
---|---|---|
action | create a new record in the jobs table | action=create |
Parameters described in overview | user=user&password=user&version=3.1 | |
Company | Company number | company=8 |
input | JSON string | input="data": ... |
varJobTemplate | Specify the template to use | "varJobTemplate": "8/00800001" |
jobClientCode | Client code - see clients API | "jobClientCode": "8/1244" |
jobDateIn | Date in | "jobDateIn": "2017/04/01" |
jobDateDue | Date due | "jobDateDue": "2017/04/30" |
jobNumber | Job number | "jobNumber": "8/00JON6" |
jobDescription | Job description | "jobDescription": "My new job description" |
jobComments | Job comments | "jobComments": "My new job comments" |
jobJobtypeCode | Job type code - see job types API | "jobJobtypeCode": "8/10" |
jobHandleruserid | Handler ID - see users API | "jobHandleruserid": "3" |
jobHandlerTeam | Job team - see teams API | "jobHandlerTeam": ""8/DQS" |
jobStatus | 1=Quote 2=Live 3=In house 4=On hold 5=Special | "jobStatus": "2" |
jobReferenceJob | Reference Job field - if not passed the reference job will be set to the job number of the template job used. | "jobReferenceJob": "ABC1000" |
Job prefixes:
If no job number is being passed in the API call and the system is set to use automatic job numbers, any automatic job prefixes will be added to the generated job number.
due date:
In a system where dates are driven by phase/stages (see date controls in company settings), the due date is ignored since all due dates are calculated by the durations set in the phases/stage in the template being used. If a due date is passed that is earlier than the start date no error is returned but the due date in the request is ignored
Request to create a job
http:///jsonAPI/jobs.json?user=user&password=user&action=create&company=8&version=3.1&input={
"data":[
{
"varJobTemplate": "8/00800001",
"jobHandleruserid": "3",
"jobClientCode": "8/1244",
"jobJobtypeCode": "8/10",
"jobNumber": "8/00MIKE12",
"jobDescription": "My new job description",
"jobDateIn": "2017/12/06",
"jobDateDue": "2017/12/07",
"jobHandlerTeam":"8/DQS",
"jobStatus":"2",
}
]
}
####Example response:
[block:code]
{
"codes": [
{
"code": "{\n\t\"responsecode\":1,\n\t\"responsestatus\":\"OK\",\n\t\"errorcode\":0,\n\t\"errormessage\":\"\",\n\t\"responsemessage\":\"data processed successfully.\",\n\t\"warningmessage\":\"\",\n\t\"success\":true,\n\t\"data\":[\n\t\t{\n\t\t\t\"jobNumber\":\"8/00JON6\",\n\t\t\t\"jobUuid\":\"44748B182B77154998E3D504A48F13FC\",\n\t\t\t\"jobTimeStampModified\":1492018793,\n\t\t\t\"jobRecommendedVersionNumber\":7\n\t\t}\n\t]\n}",
"language": "json"
}
]
}
[/block]