Difference between revisions of "Get Jobs By Status"

From MyMobileWorkers API
Jump to: navigation, search
(→‎Example response)
(→‎Example response)
Line 34: Line 34:
 
<source lang="java">
 
<source lang="java">
 
{
 
{
−
   "jobs":[
+
   "type":"repair",
 +
  "status":"NEW",
 +
  "duration":0,
 +
  "product":null,
 +
  "customer":null,
 +
  "created_at":"2013-08-05T00:00:00+01:00",
 +
  "job_number":"123",
 +
  "gas_safe_inspection":[
 +
 
 +
  ],
 +
  "mobile_user":{
 +
      "username":"Darren_test32",
 +
      "email":"darren.atherton19@yahoo.com",
 +
      "color":"AE3B94",
 +
      "engineer_registration_number":null
 +
  },
 +
  "timeslot":null,
 +
  "asset_histories":[
 
       {
 
       {
−
         "type":"repair",
+
         "location":"aPlace2",
−
         "status":"NEW",
+
         "status":{
−
        "duration":0,
+
            "external_id":null,
−
         "product":null,
+
            "name":"test"
−
         "created_at":"2013-05-20T11:27:57+00:00",
+
        },
−
         "job_number":"RB45603_45789",
+
         "description":"describingwords",
−
         "repair_description":"x1
+
         "item":{
−
operative to clear basic 3-way Traffic light
+
            "external_id":null,
−
se",
+
            "category":"test2",
−
         "repair_code":null,
+
            "name":"Woo"
−
         "notes":null,
+
        },
−
         "gas_safe_inspection":[
+
         "serial_number":"serialNo456",
−
 
+
         "external_id":"sss32",
−
         ],
+
         "last_scanned_by":null,
−
         "satisfaction":null,
+
         "last_updated_by":null,
−
        "fault":null,
+
         "created_at":1376650412000,
−
        "failure_type":null,
+
        "job":{
−
         "mobile_user":{
+
            "job_ number":"123"
−
             "username":"ANDREWSMITH",
+
         },
−
             "email":"asdfds@asdfsdfasdf.com",
+
         "asset":{
−
             "color":"FA556A",
+
            "external_id":"sss32",
−
             "engineer_registration_number":null
+
            "serial_number":"serialNo456"
 +
        },
 +
         "custom_fields":{
 +
             "testFieldName3":"testFieldValue3",
 +
             "testFieldName2":"testFieldValue2",
 +
             "testFieldName1":"testFieldValue1"
 +
        },
 +
        "customer":{
 +
             "name":"john"
 +
        },
 +
        "branch":{
 +
            "name":"DarrenDevTest"
 
         },
 
         },
−
        "address_1":"Broadmeadow
 
−
LaneBishopsteignton
 
−
Road",
 
−
        "address_2":"Teignmouth",
 
−
        "address_3":null,
 
−
        "address_4":null,
 
−
        "postcode":"TQ14
 
−
9AE",
 
−
        "contact_name":"Leigh Newton - Mcnicholas
 
−
Plc",
 
−
        "contact_number_1":"07557921078",
 
−
        "contact_number_2":"02082366323",
 
−
        "special_instructions":"x1
 
−
operative to clear basic 3-way Traffic light set up.
 
−
",
 
−
        "timeslot":"2013-05-20T18:00:00+00:00",
 
−
        "activities":[
 
−
 
−
        ],
 
−
        "items":[
 
−
 
−
        ],
 
−
        "signee":null,
 
−
        "attachments":[
 
−
 
−
        ],
 
−
        "parts":[
 
−
 
−
        ],
 
−
        "post_job_checks":[
 
−
 
−
        ],
 
−
        "pre_job_checks":[
 
−
 
−
        ],
 
 
         "photos":[
 
         "photos":[
−
 
−
        ],
 
−
        "invoices":[
 
  
 
         ]
 
         ]
 
       },
 
       },
 
       {
 
       {
−
         "type":"repair",
+
         "location":"aPlace2",
−
         "status":"NEW",
+
         "status":{
−
        "duration":0,
+
            "external_id":null,
−
         "product":null,
+
            "name":"test"
−
         "created_at":"2013-05-20T11:29:48+00:00",
+
        },
−
         "job_number":"RM45752_45938",
+
         "description":"describingwords",
−
         "repair_description":"2
+
         "item":{
−
Way Lights + Setup 30mph
+
            "external_id":null,
−
ASAP",
+
            "category":"test2",
−
         "repair_code":null,
+
            "name":"Woo"
−
         "notes":null,
+
        },
−
         "gas_safe_inspection":[
+
         "serial_number":"serialNo456",
−
 
+
         "external_id":"sss32",
−
         ],
+
         "last_scanned_by":null,
−
         "satisfaction":null,
+
         "last_updated_by":null,
−
        "fault":null,
+
         "created_at":1376650421000,
−
        "failure_type":null,
+
        "job":{
−
         "mobile_user":{
+
            "job_ number":"123"
−
             "username":"JAMESSHAW",
+
         },
−
             "email":"sdfd@asdasd.com",
+
         "asset":{
−
             "color":"135902",
+
            "external_id":"sss32",
−
             "engineer_registration_number":null
+
            "serial_number":"serialNo456"
 +
        },
 +
         "custom_fields":{
 +
             "testFieldName3":"testFieldValue3",
 +
             "testFieldName2":"testFieldValue2",
 +
             "testFieldName1":"testFieldValue1"
 +
        },
 +
        "customer":{
 +
             "name":"john"
 +
        },
 +
        "branch":{
 +
            "name":"DarrenDevTest"
 
         },
 
         },
−
        "address_1":"98a
 
−
Kings
 
−
Road",
 
−
        "address_2":"Birkhamsted",
 
−
        "address_3":null,
 
−
        "address_4":null,
 
−
        "postcode":"HP4
 
−
3BD",
 
−
        "contact_name":"David Amos - Balfour Beatty Utility
 
−
Solutions",
 
−
        "contact_number_1":"01142329727",
 
−
        "contact_number_2":"",
 
−
        "special_instructions":"2
 
−
Way Lights + Setup 30mph
 
−
ASAP",
 
−
        "timeslot":"2013-05-20T12:25:00+00:00",
 
−
        "activities":[
 
−
 
−
        ],
 
−
        "items":[
 
−
 
−
        ],
 
−
        "signee":null,
 
−
        "attachments":[
 
−
 
−
        ],
 
−
        "parts":[
 
−
 
−
        ],
 
−
        "post_job_checks":[
 
−
 
−
        ],
 
−
        "pre_job_checks":[
 
−
 
−
        ],
 
 
         "photos":[
 
         "photos":[
−
 
−
        ],
 
−
        "invoices":[
 
  
 
         ]
 
         ]
 
       },
 
       },
 
       {
 
       {
−
         "type":"repair",
+
         "location":"aPlace2",
−
         "status":"NEW",
+
         "status":{
−
        "duration":0,
+
            "external_id":null,
−
         "product":null,
+
            "name":"test"
−
         "created_at":"2013-05-20T11:56:33+00:00",
+
        },
−
         "job_number":"SE45655_45940",
+
         "description":"describingwords",
−
         "repair_description":"Setup
+
         "item":{
−
& install temporary 4 way lights whilst
+
            "external_id":null,
−
UKPN",
+
            "category":"test2",
−
         "repair_code":null,
+
            "name":"Woo"
−
         "notes":null,
+
        },
−
         "gas_safe_inspection":[
+
         "serial_number":"serialNo456",
−
 
+
         "external_id":"sss32",
−
         ],
+
         "last_scanned_by":null,
−
         "satisfaction":null,
+
         "last_updated_by":null,
−
        "fault":null,
+
         "created_at":1377005632000,
−
        "failure_type":null,
+
        "job":{
−
         "mobile_user":{
+
            "job_ number":"123"
−
             "username":"PHILIPWESSELS",
+
         },
−
             "email":"asdsasd@asdasds.com",
+
         "asset":{
−
             "color":"F830A0",
+
            "external_id":"sss32",
−
             "engineer_registration_number":null
+
            "serial_number":"serialNo456"
 +
        },
 +
         "custom_fields":{
 +
             "testFieldName3":"testFieldValue3",
 +
             "testFieldName2":"testFieldValue2",
 +
             "testFieldName1":"testFieldValue1"
 +
        },
 +
        "customer":{
 +
             "name":"john"
 +
        },
 +
        "branch":{
 +
            "name":"DarrenDevTest"
 
         },
 
         },
−
        "address_1":"Notting
 
−
Hill Gate",
 
−
        "address_2":"London
 
−
",
 
−
        "address_3":null,
 
−
        "address_4":null,
 
−
        "postcode":"W11
 
−
3HX",
 
−
        "contact_name":"Paula Carvalho - Westminster
 
−
Transerv",
 
−
        "contact_number_1":"07766902707",
 
−
        "contact_number_2":"",
 
−
        "special_instructions":"Setup
 
−
& install temporary 4 way lights whilst UKPN disconnect existing lights
 
−
and install new meter. Job will only last 1-2 hours. NO TM
 
−
PLAN",
 
−
        "timeslot":"2013-05-21T10:30:00+00:00",
 
−
        "activities":[
 
−
 
−
        ],
 
−
        "items":[
 
−
 
−
        ],
 
−
        "signee":null,
 
−
        "attachments":[
 
−
 
−
        ],
 
−
        "parts":[
 
−
 
−
        ],
 
−
        "post_job_checks":[
 
−
 
−
        ],
 
−
        "pre_job_checks":[
 
−
 
−
        ],
 
 
         "photos":[
 
         "photos":[
−
 
−
        ],
 
−
        "invoices":[
 
  
 
         ]
 
         ]
 
       },
 
       },
 
       {
 
       {
−
         "type":"repair",
+
         "location":"aPlace2",
−
         "status":"NEW",
+
         "status":{
−
        "duration":0,
+
             "external_id":null,
−
        "product":null,
+
             "name":"test"
−
        "created_at":"2013-05-20T11:57:54+00:00",
+
−
        "job_number":"JD45527_45942",
+
−
        "repair_description":"4
+
−
way lights + setup 30mph. MAN ON
+
−
SITE",
+
−
        "repair_code":null,
+
−
        "notes":null,
+
−
        "gas_safe_inspection":[
+
−
 
+
−
        ],
+
−
        "satisfaction":null,
+
−
        "fault":null,
+
−
        "failure_type":null,
+
−
        "mobile_user":{
+
−
             "username":"RAJINDERSINGH",
+
−
             "email":"fdassddssd@asdasgfds.com",
+
−
            "color":"3BA646",
+
−
            "engineer_registration_number":null
+
 
         },
 
         },
−
         "address_1":"Magpie
+
         "description":"describingwords",
−
Hall Road Junc High Road and The Comm",
+
        "item":{
−
         "address_2":"Bushey Heath
+
            "external_id":null,
−
Bushey",
+
            "category":"test2",
−
         "address_3":null,
+
            "name":"Woo"
−
         "address_4":null,
+
        },
−
         "postcode":"WD23
+
         "serial_number":"serialNo789",
−
1NU",
+
        "external_id":"sss34",
−
         "contact_name":"Mick Owen - Balfour Beatty Utility Solutions
+
         "last_scanned_by":null,
−
",
+
         "last_updated_by":null,
−
         "contact_number_1":"00000000000",
+
         "created_at":1377005675000,
−
         "contact_number_2":"",
+
        "job":{
−
         "special_instructions":"Full
+
            "job_ number":"123"
−
address:Magpie Hall Road Junc High Road and The Common4 way lights +
+
        },
−
setup 30mph. MAN ON
+
         "asset":{
−
SITE",
+
            "external_id":"sss34",
−
         "timeslot":"2013-05-21T08:00:00+00:00",
+
            "serial_number":"serialNo789"
−
        "activities":[
+
        },
 +
         "custom_fields":{
 +
            "testFieldName3":"testFieldValue3",
 +
            "testFieldName2":"testFieldValue2",
 +
            "testFieldName1":"testFieldValue1"
 +
        },
 +
         "customer":{
 +
            "name":"john"
 +
        },
 +
         "branch":{
 +
            "name":"DarrenDevTest"
 +
        },
 +
        "photos":[
 +
            {
 +
              "file_name":"www.testFileName.com/test"
 +
            },
 +
            {
 +
              "file_name":"www.testFileName.com/test"
 +
            }
 +
         ]
 +
      }
 +
  ],
 +
  "contact_name":"qwerty",
 +
  "address_1":"qwerty",
 +
  "address_2":null,
 +
  "postcode":"qqwerty",
 +
  "notes":null,
 +
  "address_3":null,
 +
  "address_4":null,
 +
  "contact_number_1":"0",
 +
  "contact_number_2":null,
 +
  "special_instructions":null,
 +
  "fault":null,
 +
  "repair_code":null,
 +
  "repair_description":null,
 +
  "signee":null,
 +
  "satisfaction":null,
 +
  "failure_type":null,
 +
  "attachments":[
  
−
        ],
+
  ],
−
        "items":[
+
  "items":[
 +
      {
 +
        "name":"Bob",
 +
        "type":"C",
 +
        "status":"COMPLETED",
 +
        "notes":"exampleNotes",
 +
        "expected_quantity":4,
 +
        "other":"test",
 +
        "actual_quantity":null
 +
      },
 +
      {
 +
        "name":"Bob",
 +
        "type":"C",
 +
        "status":"COMPLETED",
 +
        "notes":"exampleNotes",
 +
        "expected_quantity":4,
 +
        "other":"test",
 +
        "actual_quantity":null
 +
      },
 +
      {
 +
        "name":"darrenItem",
 +
        "type":"C",
 +
        "status":"COMPLETED",
 +
        "notes":"exampleNotes",
 +
        "expected_quantity":4,
 +
        "other":"test",
 +
        "actual_quantity":null
 +
      },
 +
      {
 +
        "name":"darrenItem245",
 +
        "type":"C",
 +
        "status":"COMPLETED",
 +
        "notes":"exampleNotes",
 +
        "expected_quantity":4,
 +
        "other":"test",
 +
        "actual_quantity":null
 +
      },
 +
      {
 +
        "name":"darrenItem245",
 +
        "type":"C",
 +
        "status":"COMPLETED",
 +
        "notes":"exampleNotes",
 +
        "expected_quantity":4,
 +
        "other":"test",
 +
        "actual_quantity":null
 +
      },
 +
      {
 +
        "name":"darrenItem245",
 +
        "type":"C",
 +
        "status":"COMPLETED",
 +
        "notes":"exampleNotes",
 +
        "expected_quantity":4,
 +
        "other":"test",
 +
        "actual_quantity":null
 +
      },
 +
      {
 +
        "name":"darrenItem",
 +
        "type":"C",
 +
        "status":"COMPLETED",
 +
        "notes":"exampleNotes",
 +
        "expected_quantity":4,
 +
        "other":"test",
 +
        "actual_quantity":null
 +
      }
 +
  ],
 +
  "activities":[
  
−
        ],
+
  ],
−
        "signee":null,
+
  "post_job_checks":[
−
        "attachments":[
+
  
−
        ],
+
  ],
−
        "parts":[
+
  "pre_job_checks":[
  
−
        ],
+
  ],
−
        "post_job_checks":[
+
  "photos":[
  
−
        ],
+
  ],
−
        "pre_job_checks":[
+
  "invoices":[
  
−
        ],
 
−
        "photos":[
 
−
 
−
        ],
 
−
        "invoices":[
 
−
 
−
        ]
 
−
      }
 
 
   ]
 
   ]
 
}
 
}

Revision as of 09:16, 21 August 2013

Summary

Jobs
URL http://:base_url/:api_path/:version/jobs/status?api_key=YOUR_KEY&status=A_STATUS&start_date=DATETIME&end_date=DATETIME
Type GET
Params: api_key required
status required
start_date required
end_date required
Response JSON


The jobs/status method returns all jobs listed between the specified date range, currently in the specified status

Example response

{
   "type":"repair",
   "status":"NEW",
   "duration":0,
   "product":null,
   "customer":null,
   "created_at":"2013-08-05T00:00:00+01:00",
   "job_number":"123",
   "gas_safe_inspection":[
 
   ],
   "mobile_user":{
      "username":"Darren_test32",
      "email":"darren.atherton19@yahoo.com",
      "color":"AE3B94",
      "engineer_registration_number":null
   },
   "timeslot":null,
   "asset_histories":[
      {
         "location":"aPlace2",
         "status":{
            "external_id":null,
            "name":"test"
         },
         "description":"describingwords",
         "item":{
            "external_id":null,
            "category":"test2",
            "name":"Woo"
         },
         "serial_number":"serialNo456",
         "external_id":"sss32",
         "last_scanned_by":null,
         "last_updated_by":null,
         "created_at":1376650412000,
         "job":{
            "job_ number":"123"
         },
         "asset":{
            "external_id":"sss32",
            "serial_number":"serialNo456"
         },
         "custom_fields":{
            "testFieldName3":"testFieldValue3",
            "testFieldName2":"testFieldValue2",
            "testFieldName1":"testFieldValue1"
         },
         "customer":{
            "name":"john"
         },
         "branch":{
            "name":"DarrenDevTest"
         },
         "photos":[
 
         ]
      },
      {
         "location":"aPlace2",
         "status":{
            "external_id":null,
            "name":"test"
         },
         "description":"describingwords",
         "item":{
            "external_id":null,
            "category":"test2",
            "name":"Woo"
         },
         "serial_number":"serialNo456",
         "external_id":"sss32",
         "last_scanned_by":null,
         "last_updated_by":null,
         "created_at":1376650421000,
         "job":{
            "job_ number":"123"
         },
         "asset":{
            "external_id":"sss32",
            "serial_number":"serialNo456"
         },
         "custom_fields":{
            "testFieldName3":"testFieldValue3",
            "testFieldName2":"testFieldValue2",
            "testFieldName1":"testFieldValue1"
         },
         "customer":{
            "name":"john"
         },
         "branch":{
            "name":"DarrenDevTest"
         },
         "photos":[
 
         ]
      },
      {
         "location":"aPlace2",
         "status":{
            "external_id":null,
            "name":"test"
         },
         "description":"describingwords",
         "item":{
            "external_id":null,
            "category":"test2",
            "name":"Woo"
         },
         "serial_number":"serialNo456",
         "external_id":"sss32",
         "last_scanned_by":null,
         "last_updated_by":null,
         "created_at":1377005632000,
         "job":{
            "job_ number":"123"
         },
         "asset":{
            "external_id":"sss32",
            "serial_number":"serialNo456"
         },
         "custom_fields":{
            "testFieldName3":"testFieldValue3",
            "testFieldName2":"testFieldValue2",
            "testFieldName1":"testFieldValue1"
         },
         "customer":{
            "name":"john"
         },
         "branch":{
            "name":"DarrenDevTest"
         },
         "photos":[
 
         ]
      },
      {
         "location":"aPlace2",
         "status":{
            "external_id":null,
            "name":"test"
         },
         "description":"describingwords",
         "item":{
            "external_id":null,
            "category":"test2",
            "name":"Woo"
         },
         "serial_number":"serialNo789",
         "external_id":"sss34",
         "last_scanned_by":null,
         "last_updated_by":null,
         "created_at":1377005675000,
         "job":{
            "job_ number":"123"
         },
         "asset":{
            "external_id":"sss34",
            "serial_number":"serialNo789"
         },
         "custom_fields":{
            "testFieldName3":"testFieldValue3",
            "testFieldName2":"testFieldValue2",
            "testFieldName1":"testFieldValue1"
         },
         "customer":{
            "name":"john"
         },
         "branch":{
            "name":"DarrenDevTest"
         },
         "photos":[
            {
               "file_name":"www.testFileName.com/test"
            },
            {
               "file_name":"www.testFileName.com/test"
            }
         ]
      }
   ],
   "contact_name":"qwerty",
   "address_1":"qwerty",
   "address_2":null,
   "postcode":"qqwerty",
   "notes":null,
   "address_3":null,
   "address_4":null,
   "contact_number_1":"0",
   "contact_number_2":null,
   "special_instructions":null,
   "fault":null,
   "repair_code":null,
   "repair_description":null,
   "signee":null,
   "satisfaction":null,
   "failure_type":null,
   "attachments":[
 
   ],
   "items":[
      {
         "name":"Bob",
         "type":"C",
         "status":"COMPLETED",
         "notes":"exampleNotes",
         "expected_quantity":4,
         "other":"test",
         "actual_quantity":null
      },
      {
         "name":"Bob",
         "type":"C",
         "status":"COMPLETED",
         "notes":"exampleNotes",
         "expected_quantity":4,
         "other":"test",
         "actual_quantity":null
      },
      {
         "name":"darrenItem",
         "type":"C",
         "status":"COMPLETED",
         "notes":"exampleNotes",
         "expected_quantity":4,
         "other":"test",
         "actual_quantity":null
      },
      {
         "name":"darrenItem245",
         "type":"C",
         "status":"COMPLETED",
         "notes":"exampleNotes",
         "expected_quantity":4,
         "other":"test",
         "actual_quantity":null
      },
      {
         "name":"darrenItem245",
         "type":"C",
         "status":"COMPLETED",
         "notes":"exampleNotes",
         "expected_quantity":4,
         "other":"test",
         "actual_quantity":null
      },
      {
         "name":"darrenItem245",
         "type":"C",
         "status":"COMPLETED",
         "notes":"exampleNotes",
         "expected_quantity":4,
         "other":"test",
         "actual_quantity":null
      },
      {
         "name":"darrenItem",
         "type":"C",
         "status":"COMPLETED",
         "notes":"exampleNotes",
         "expected_quantity":4,
         "other":"test",
         "actual_quantity":null
      }
   ],
   "activities":[
 
   ],
   "post_job_checks":[
 
   ],
   "pre_job_checks":[
 
   ],
   "photos":[
 
   ],
   "invoices":[
 
   ]
}

Example curl request

http://live.mymobileworkers.com:8080/api/1/jobs/status?api_key=YOUR_KEY&status=NEW&start_date=2013-01-10%2012:12:12&end_date=2013-05-25%2012:12:12

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox