Difference between revisions of "Get Asset By Serial Number"
From MyMobileWorkers API
(→Response Parameters) |
(→Example curl request) |
||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 6: | Line 6: | ||
|- | |- | ||
! URL | ! URL | ||
| − | | colspan="2" | | + | | colspan="2" | https://:base_url/:api_path/:version/asset?api_key=YOUR_KEY&serial_number=SERIAL_NUMBER |
|- | |- | ||
! Type | ! Type | ||
| Line 20: | Line 20: | ||
| colspan="2" | JSON | | colspan="2" | JSON | ||
|} | |} | ||
| − | |||
The Get Asset method returns the asset corresponding to the serial number specified. | The Get Asset method returns the asset corresponding to the serial number specified. | ||
| − | |||
== Response Parameters == | == Response Parameters == | ||
| Line 72: | Line 70: | ||
! customer | ! customer | ||
| Customer the asset is linked to | | Customer the asset is linked to | ||
| + | |- | ||
| + | ! branch | ||
| + | | Branch the asset is linked to | ||
|- | |- | ||
|} | |} | ||
| Line 78: | Line 79: | ||
<source lang="java"> | <source lang="java"> | ||
[ | [ | ||
| − | { | + | { |
| − | "location":" | + | "location":"aPlace2", |
| − | "status":{ | + | "status":{ |
| − | + | "external_id":null, | |
| − | + | "name":"test" | |
| − | + | }, | |
| − | "description":"describingwords", | + | "description":"describingwords", |
| − | "item":{ | + | "item":{ |
| − | + | "external_id":null, | |
| − | + | "category":"test2", | |
| − | + | "name":"Woo" | |
| − | + | }, | |
| − | "serial_number":" | + | "serial_number":"serialNo456", |
| − | " | + | "external_id":"sss32", |
| − | "last_updated_by":null, | + | "last_scanned_by":null, |
| − | "external_id":"sss32", | + | "last_updated_by":null, |
| − | "last_scanned_by":null, | + | "created_at":"2013-10-08 14:19:17", |
| − | "custom_fields":null, | + | "job":{ |
| − | "job":{ | + | "job_ number":"123" |
| − | + | }, | |
| − | "customer":{ | + | "asset":{ |
| − | + | "external_id":"sss32", | |
| − | + | "serial_number":"serialNo456" | |
| − | } | + | }, |
| + | "custom_fields":{ | ||
| + | |||
| + | }, | ||
| + | "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":"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":"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":"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":"DarrenDevTest" | ||
| + | }, | ||
| + | "photos":[ | ||
| + | |||
| + | ] | ||
| + | } | ||
] | ] | ||
</source> | </source> | ||
| Line 107: | Line 199: | ||
== Example curl request == | == Example curl request == | ||
| − | curl " | + | curl "https://api.mymobileworkers.com:8181/api/1/assets/asset/?api_key=darrenwebapi&serial_number=serialNo123" |
Latest revision as of 12:37, 14 November 2016
Contents |
[edit] Summary
| Asset | ||
|---|---|---|
| URL | https://:base_url/:api_path/:version/asset?api_key=YOUR_KEY&serial_number=SERIAL_NUMBER | |
| Type | GET | |
| Params: | api_key | required |
| serial_number | required | |
| Response | JSON | |
The Get Asset method returns the asset corresponding to the serial number specified.
[edit] Response Parameters
| Field | Description |
|---|---|
| location | Asset location |
| status | Contains both external id and status name for asset status |
| description | Asset description |
| item | Contains the name, category and external id of the item the asset is linked to |
| serial_number | Asset serial number |
| created_at | Date asset was created |
| last_updated_by | User who last updated asset |
| external_id | Asset external id |
| last_scanned_by | User who last scanned asset |
| custom_fields | Asset custom fields |
| last_updated_by | User who last updated asset |
| job | Job the asset is linked to |
| customer | Customer the asset is linked to |
| branch | Branch the asset is linked to |
[edit] Example response
[ { "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":{ }, "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":"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":"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":"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":"DarrenDevTest" }, "photos":[ ] } ]