Difference between revisions of "Create Job Parts"
From MyMobileWorkers API
(Created page with "== Summary == {| border="1" class="wikitable" ! Create Job ! colspan="2" | |- ! URL | colspan="2" | http://:base_url/:api_path/:version/jobs/parts |- ! Type | colspan="2" |...") |
(→JSON Parameters) |
||
| Line 35: | Line 35: | ||
{| border="1" class="wikitable" | {| border="1" class="wikitable" | ||
| − | |+ The JSON | + | |+ The JSON data is passed in the post as the "file" |
! Field | ! Field | ||
! Expected Data | ! Expected Data | ||
Revision as of 13:43, 15 May 2013
Contents |
Summary
| Create Job | ||
|---|---|---|
| URL | http://:base_url/:api_path/:version/jobs/parts | |
| Type | POST | |
| Params: | api_key | required |
| file | required | |
| job_number | required | |
| Response | JSON | |
Job parts can only be added to a Repair/Field Service job.
This method is transactional. If one part fails validation, then no parts will be created.
Returns a list of valid job parts and a list of failed job parts. Even if parts are valid, they will not be created unless there are no failed parts.
JSON Parameters
| Field | Expected Data | Required |
|---|---|---|
| name | varchar(45) | ✓ |
| code | varchar(45) | ✓ |
| quantity | double | ✓ |
| description | varchar(255) | ✓ |
Example JSON
Example curl request
Responses
Example JSON
{ "result":"failed", "failed":[ { "part":{ "name":"part2", "code":null, "description":null, "quantity":0.0 }, "errors":[ { "error_code":"WAJ037", "error_message":"code invalid empty string" }, { "error_code":"WAJ034", "error_message":"description invalid empty string" } ] } ], "valid":[ { "name":"part1", "code":"CODE1", "description":"description", "quantity":1.0 } ] }