Difference between revisions of "Create Job Items"

From MyMobileWorkers API
Jump to: navigation, search
(→‎JSON Parameters)
(→‎Summary)
Line 6: Line 6:
 
|-
 
|-
 
!  URL
 
!  URL
−
| colspan="2" | http://:base_url/:api_path/:version/jobs/items
+
| colspan="2" | http://:base_url/:api_path/:version/jobs/job/items
 
|-
 
|-
 
! Type
 
! Type

Revision as of 09:50, 3 June 2013

Contents

Summary

Create Job
URL http://:base_url/:api_path/:version/jobs/job/items
Type POST
Params: api_key required
file required
job_number required
Response JSON


Job items can only be added to a PODC job.

This method is transactional. If one item fails validation, then no items will be created.

Returns a list of valid job items and a list of failed job items. Even if items are valid, they will not be created unless there are no failed items.

JSON Parameters

The JSON file is passed in the post as the "file"
Field Expected Data Required
name varchar(45) ✓
type "C","D"
* Collect/Deliver
✓
quantity int(4) ✓
notes varchar(45)

Example JSON

 

Example curl request

Responses

Example JSON

{
   "result":"failed",
   "failed":[
      {
         "item":{
            "name":"item2",
            "type":null,
            "notes":null,
         },
         "errors":[
            {
               "error_code":"JBI002",
               "error_message":"Job item type is null"
            }
         ]
      }
   ],
   "valid":[
      {
         "name":"item1",
         "type":"C",
         "notes":"notes",
 
      }
   ]
}
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox