Difference between revisions of "Create Job Tracking Reference"
(Created page with "== Summary == The 'create job tracking reference' method accepts an array of job numbers to be used to add job tracking references into the system. If the 'update_existing' p...") |
Latest revision as of 16:42, 5 April 2020
Contents |
[edit] Summary
The 'create job tracking reference' method accepts an array of job numbers to be used to add job tracking references into the system. If the 'update_existing' parameter is set, then the expiry datetime of the tracking reference will be updated and the tracking reference itself will be displayed. If set to false or not provided, then the expiry datetime of each tracking reference will not be updated, but the tracking references for each job number will still be displayed.
If 'validate_only' is set, the set of job numbers will only be validated but job tracking references will not actually inserted into the database. This can be used to check an entire dataset for errors before submitting.
[edit] JSON As Body
| Create Job Tracking Reference - JSON | ||
|---|---|---|
| URL | https://base_url/api_path/version/jobs/trackingref/update | |
| Type | POST | |
| JSON {key, validate_only(optional), update_existing(optional), jobs_trackingrefs[]} |
required | |
| Response | JSON | |
[edit] JSON Contents
| Standard Fields | ||
|---|---|---|
| Field | Expected Data | Required |
| jobId | {"job_number":"<job_number>"} *nested JSON object |
✓ |
| Standard Fields | ||
|---|---|---|
| Field | Expected Data | Required |
| key | string - company api key | ✓ |
| update_existing | boolean | |
| validate_only | boolean | |
[edit] Example Input
[edit] JSON As Body
{ "key":"api_key", "update_existing":"true", "validate_only":"false", "jobs_trackingrefs":[ { "jobId" : { "job_number":"test_number" } } ] }
[edit] Example Curl Requests
[edit] JSON As Body
curl -X POST -H "Content-Type: application/json" -d '{
"key":"api_key",
"update_existing":"true",
"validate_only":"false",
"jobs_trackingrefs":[
{
"jobId" : {
"job_number":"test_number"
}
}
]
}' https://api.mymobileworkers.com:8181/api/1/jobs/trackingref/update
[edit] Responses
[edit] Example JSON
{ "failed": [], "successful": [ { "job_number": "test_number", "tracking_ref": "test_tracking_ref" } ] }