Difference between revisions of "Get Job Updates Since"

From MyMobileWorkers API
Jump to: navigation, search
 
(15 intermediate revisions by 6 users not shown)
Line 6: Line 6:
 
|-
 
|-
 
! URL
 
! URL
−
| colspan="2" |  http://:base_url/:api_path/:version/jobs/updated?api_key=YOUR_KEY&since=DATETIME
+
| colspan="2" |  https://:base_url/:api_path/:version/jobs/updated?api_key=YOUR_KEY&since=DATETIME&branch=BRANCH_NAME
 
|-
 
|-
 
! Type
 
! Type
Line 15: Line 15:
 
|-
 
|-
 
!  
 
!  
−
| status || required
+
| since || required
 
|-
 
|-
 
!  
 
!  
−
| since || required
+
| branch || optional
 
|-
 
|-
  
Line 26: Line 26:
  
  
−
The jobs/updated method returns all jobs that have been updated since the specified "since" parameter
+
The jobs/updated method returns all jobs that have been updated since the specified "since" parameter & you can also specify which branch the jobs come from.
  
  
Line 32: Line 32:
  
 
<source lang="java">
 
<source lang="java">
−
{"jobs":[{"type":"repair","status":"NEW","duration":0,"product":null,"created_at":"2013-05-20T11:27:57+00:00","job_number":"RB45603_45789","repair_description":"x1
+
{
−
operative to clear basic 3-way Traffic light
+
"secondary_users": [],
−
se","repair_code":null,"notes":null,"gas_safe_inspection":[],"satisfaction":null,"fault":null,"failure_type":null,"mobile_user":{"username":"ANDREWSMITH","email":"asdfds@asdfsdfasdf.com","color":"FA556A","engineer_registration_number":null},"address_1":"Broadmeadow
+
"type": "repair",
−
LaneBishopsteignton
+
"signatures": [],
−
Road","address_2":"Teignmouth","address_3":null,"address_4":null,"postcode":"TQ14
+
"date": "2017-03-28",
−
9AE","contact_name":"Leigh Newton - Mcnicholas
+
"time": null,
−
Plc","contact_number_1":"07557921078","contact_number_2":"02082366323","special_instructions":"x1
+
"status": "NEW",
−
operative to clear basic 3-way Traffic light set up.
+
"task": null,
−
","timeslot":"2013-05-20T18:00:00+00:00","activities":[],"items":[],"signee":null,"attachments":[],"parts":[],"post_job_checks":[],"pre_job_checks":[],"photos":[],"invoices":[]},{"type":"repair","status":"NEW","duration":0,"product":null,"created_at":"2013-05-20T11:29:48+00:00","job_number":"RM45752_45938","repair_description":"2
+
"duration": 0,
−
Way Lights + Setup 30mph
+
"product": null,
−
ASAP","repair_code":null,"notes":null,"gas_safe_inspection":[],"satisfaction":null,"fault":null,"failure_type":null,"mobile_user":{"username":"JAMESSHAW","email":"sdfd@asdasd.com","color":"135902","engineer_registration_number":null},"address_1":"98a
+
"weight": 100.15,
−
Kings
+
"branch": {
−
Road","address_2":"Birkhamsted","address_3":null,"address_4":null,"postcode":"HP4
+
"name": "BranchA",
−
3BD","contact_name":"David Amos - Balfour Beatty Utility
+
"number": null,
−
Solutions","contact_number_1":"01142329727","contact_number_2":"","special_instructions":"2
+
"external_id": null,
−
Way Lights + Setup 30mph
+
"contact_name": "Joe Bloggs",
−
ASAP","timeslot":"2013-05-20T12:25:00+00:00","activities":[],"items":[],"signee":null,"attachments":[],"parts":[],"post_job_checks":[],"pre_job_checks":[],"photos":[],"invoices":[]},{"type":"repair","status":"NEW","duration":0,"product":null,"created_at":"2013-05-20T11:56:33+00:00","job_number":"SE45655_45940","repair_description":"Setup
+
"address_1": "",
−
& install temporary 4 way lights whilst
+
"address_2": "",
−
UKPN","repair_code":null,"notes":null,"gas_safe_inspection":[],"satisfaction":null,"fault":null,"failure_type":null,"mobile_user":{"username":"PHILIPWESSELS","email":"asdsasd@asdasds.com","color":"F830A0","engineer_registration_number":null},"address_1":"Notting
+
"address_3": "",
−
Hill Gate","address_2":"London
+
"address_4": "",
−
","address_3":null,"address_4":null,"postcode":"W11
+
"postcode": "",
−
3HX","contact_name":"Paula Carvalho - Westminster
+
"created_at": 1473425398000,
−
Transerv","contact_number_1":"07766902707","contact_number_2":"","special_instructions":"Setup
+
"contact_number": "06575346575",
−
& install temporary 4 way lights whilst UKPN disconnect existing lights
+
"contact_email": "branch@example.com"
−
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":[],"invoices":[]},{"type":"repair","status":"NEW","duration":0,"product":null,"created_at":"2013-05-20T11:57:54+00:00","job_number":"JD45527_45942","repair_description":"4
+
"route": {
−
way lights + setup 30mph. MAN ON
+
"external_id": null,
−
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
+
"route_name": "Liverpool-AM",
−
Hall Road Junc High Road and The Comm","address_2":"Bushey Heath
+
"route_code": "LIV-001",
−
Bushey","address_3":null,"address_4":null,"postcode":"WD23
+
"route_limit": 180
−
1NU","contact_name":"Mick Owen - Balfour Beatty Utility Solutions
+
},
−
","contact_number_1":"00000000000","contact_number_2":"","special_instructions":"Full
+
"customer": null,
−
address:Magpie Hall Road Junc High Road and The Common4 way lights +
+
"customer_sites": {
−
setup 30mph. MAN ON
+
"external_id": null,
−
SITE","timeslot":"2013-05-21T08:00:00+00:00","activities":[],"items":[],"signee":null,"attachments":[],"parts":[],"post_job_checks":[],"pre_job_checks":[],"photos":[],"invoices":[]}]}
+
"contact_name": "Joe",
 +
"address_1": "29 bath road",
 +
"address_2": "",
 +
"address_3": "",
 +
"address_4": "",
 +
"postcode": "la1 3cd",
 +
"created_at": 1465210944000,
 +
"updated_at": 1465210944000,
 +
"contact_number": "06709253543",
 +
"contact_email": "joe@example.com",
 +
"sic_code": null,
 +
"customer_site_emails": [
 +
{
 +
"customer_email": "joe@example.com"
 +
}
 +
]
 +
},
 +
"created_at": "2017-03-28T10:54:41+01:00",
 +
"updated_at": "2017-03-28T10:54:41+01:00",
 +
"actualStart": null,
 +
"job_number": "123",
 +
"gas_safe_inspection": [],
 +
"mobile_user": {
 +
"username": "Darren",
 +
"email": "darren@example.com",
 +
"color": "AE3B94",
 +
"engineer_registration_number": null
 +
},
 +
"priorityDetails": {
 +
"colour": "00731D",
 +
"name": "Very Low"
 +
},
 +
"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": "2013-10-08 14:19:17",
 +
"job": {
 +
"job_ number": "123"
 +
},
 +
"asset": {
 +
"external_id": "sss32",
 +
"serial_number": "serialNo456"
 +
},
 +
"custom_fields": {
 +
"testFieldName3": "testFieldValue3",
 +
"testFieldName2": "testFieldValue2",
 +
"testFieldName1": "testFieldValue1"
 +
},
 +
"customer": {
 +
"name": "john"
 +
},
 +
"branch": {
 +
"name": "Main Branch"
 +
},
 +
"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": "2013-10-08 14:19:17",
 +
"job": {
 +
"job_ number": "123"
 +
},
 +
"asset": {
 +
"external_id": "sss32",
 +
"serial_number": "serialNo456"
 +
},
 +
"custom_fields": {
 +
"testFieldName3": "testFieldValue3",
 +
"testFieldName2": "testFieldValue2",
 +
"testFieldName1": "testFieldValue1"
 +
},
 +
"customer": {
 +
"name": "john"
 +
},
 +
"branch": {
 +
"name": "Main Branch"
 +
},
 +
"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": "2013-10-08 14:19:17",
 +
"job": {
 +
"job_ number": "123"
 +
},
 +
"asset": {
 +
"external_id": "sss32",
 +
"serial_number": "serialNo456"
 +
},
 +
"custom_fields": {
 +
"testFieldName3": "testFieldValue3",
 +
"testFieldName2": "testFieldValue2",
 +
"testFieldName1": "testFieldValue1"
 +
},
 +
"customer": {
 +
"name": "john"
 +
},
 +
"branch": {
 +
"name": "Main Branch"
 +
},
 +
"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": "2013-10-08 14:19:17",
 +
"job": {
 +
"job_ number": "123"
 +
},
 +
"asset": {
 +
"external_id": "sss34",
 +
"serial_number": "serialNo789"
 +
},
 +
"custom_fields": {
 +
"testFieldName3": "testFieldValue3",
 +
"testFieldName2": "testFieldValue2",
 +
"testFieldName1": "testFieldValue1"
 +
},
 +
"customer": {
 +
"name": "john"
 +
},
 +
"branch": {
 +
"name": "Main Branch"
 +
},
 +
"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": [
 +
{
 +
"type": "JOB_VIEWED",
 +
"created_at": "2014-01-13T10:15:00+00:00"
 +
},
 +
{
 +
"type": "JOB_VIEWED",
 +
"created_at": "2014-01-13T10:15:00+00:00"
 +
},
 +
{
 +
"type": "JOB_STARTED",
 +
"created_at": "2014-01-13T10:16:00+00:00"
 +
},
 +
{
 +
"type": "JOB_ARRIVED",
 +
"created_at": "2014-01-13T10:21:00+00:00"
 +
}
 +
],
 +
"post_job_checks": [],
 +
"pre_job_checks": [],
 +
"photos": [],
 +
"job_invoices": [],
 +
"pre_job_details": [
 +
{
 +
"invoice_number": null,
 +
"po_no": "TestPo"
 +
}
 +
]
 +
}
 
</source>
 
</source>
  
 
== Example curl request ==
 
== Example curl request ==
  
−
http://10.1.0.75:8080/api/1/jobs/updated?api_key=YOUR_KEY&since=2013-05-20%2012:12:12
+
curl "https://api.mymobileworkers.com:8181/api/1/jobs/updated?api_key=YOUR_KEY&since=2017-05-20%2013:59:59&branch=BRANCH_NAME"

Latest revision as of 13:33, 9 March 2018

[edit] Summary

Jobs Update Since
URL https://:base_url/:api_path/:version/jobs/updated?api_key=YOUR_KEY&since=DATETIME&branch=BRANCH_NAME
Type GET
Params: api_key required
since required
branch optional
Response JSON


The jobs/updated method returns all jobs that have been updated since the specified "since" parameter & you can also specify which branch the jobs come from.


[edit] Example response

{
	"secondary_users": [],
	"type": "repair",
	"signatures": [],
	"date": "2017-03-28",
	"time": null,
	"status": "NEW",
	"task": null,
	"duration": 0,
	"product": null,
	"weight": 100.15,
	"branch": {
		"name": "BranchA",
		"number": null,
		"external_id": null,
		"contact_name": "Joe Bloggs",
		"address_1": "",
		"address_2": "",
		"address_3": "",
		"address_4": "",
		"postcode": "",
		"created_at": 1473425398000,
		"contact_number": "06575346575",
		"contact_email": "branch@example.com"
	},
	"route": {
		"external_id": null,
		"route_name": "Liverpool-AM",
		"route_code": "LIV-001",
		"route_limit": 180
	},
	"customer": null,
	"customer_sites": {
		"external_id": null,
		"contact_name": "Joe",
		"address_1": "29 bath road",
		"address_2": "",
		"address_3": "",
		"address_4": "",
		"postcode": "la1 3cd",
		"created_at": 1465210944000,
		"updated_at": 1465210944000,
		"contact_number": "06709253543",
		"contact_email": "joe@example.com",
		"sic_code": null,
		"customer_site_emails": [
			{
				"customer_email": "joe@example.com"
			}
		]
	},
	"created_at": "2017-03-28T10:54:41+01:00",
	"updated_at": "2017-03-28T10:54:41+01:00",
	"actualStart": null,
	"job_number": "123",
	"gas_safe_inspection": [],
	"mobile_user": {
		"username": "Darren",
		"email": "darren@example.com",
		"color": "AE3B94",
		"engineer_registration_number": null
	},
	"priorityDetails": {
		"colour": "00731D",
		"name": "Very Low"
	},
	"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": "2013-10-08 14:19:17",
			"job": {
				"job_ number": "123"
			},
			"asset": {
				"external_id": "sss32",
				"serial_number": "serialNo456"
			},
			"custom_fields": {
				"testFieldName3": "testFieldValue3",
				"testFieldName2": "testFieldValue2",
				"testFieldName1": "testFieldValue1"
			},
			"customer": {
				"name": "john"
			},
			"branch": {
				"name": "Main Branch"
			},
			"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": "2013-10-08 14:19:17",
			"job": {
				"job_ number": "123"
			},
			"asset": {
				"external_id": "sss32",
				"serial_number": "serialNo456"
			},
			"custom_fields": {
				"testFieldName3": "testFieldValue3",
				"testFieldName2": "testFieldValue2",
				"testFieldName1": "testFieldValue1"
			},
			"customer": {
				"name": "john"
			},
			"branch": {
				"name": "Main Branch"
			},
			"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": "2013-10-08 14:19:17",
			"job": {
				"job_ number": "123"
			},
			"asset": {
				"external_id": "sss32",
				"serial_number": "serialNo456"
			},
			"custom_fields": {
				"testFieldName3": "testFieldValue3",
				"testFieldName2": "testFieldValue2",
				"testFieldName1": "testFieldValue1"
			},
			"customer": {
				"name": "john"
			},
			"branch": {
				"name": "Main Branch"
			},
			"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": "2013-10-08 14:19:17",
			"job": {
				"job_ number": "123"
			},
			"asset": {
				"external_id": "sss34",
				"serial_number": "serialNo789"
			},
			"custom_fields": {
				"testFieldName3": "testFieldValue3",
				"testFieldName2": "testFieldValue2",
				"testFieldName1": "testFieldValue1"
			},
			"customer": {
				"name": "john"
			},
			"branch": {
				"name": "Main Branch"
			},
			"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": [
		{
			"type": "JOB_VIEWED",
			"created_at": "2014-01-13T10:15:00+00:00"
		},
		{
			"type": "JOB_VIEWED",
			"created_at": "2014-01-13T10:15:00+00:00"
		},
		{
			"type": "JOB_STARTED",
			"created_at": "2014-01-13T10:16:00+00:00"
		},
		{
			"type": "JOB_ARRIVED",
			"created_at": "2014-01-13T10:21:00+00:00"
		}
	],
	"post_job_checks": [],
	"pre_job_checks": [],
	"photos": [],
	"job_invoices": [],
	"pre_job_details": [
		{
			"invoice_number": null,
			"po_no": "TestPo"
		}
	]
}

[edit] Example curl request

curl "https://api.mymobileworkers.com:8181/api/1/jobs/updated?api_key=YOUR_KEY&since=2017-05-20%2013:59:59&branch=BRANCH_NAME"

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox