Create Job Parts
From MyMobileWorkers API
Contents |
Summary
| Create Job | ||
|---|---|---|
| URL | http://:base_url/:api_path/:version/jobs/job/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 } ] }