Create Job Items

From MyMobileWorkers API
Revision as of 13:38, 15 May 2013 by Ryanmt (Talk | contribs)

Jump to: navigation, search

Contents

Summary

Create Job
URL http://:base_url/:api_path/:version/jobs/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