Difference between revisions of "Get Asset History By Serial Number"

From MyMobileWorkers API
Jump to: navigation, search
(→‎Example curl request)
 
(6 intermediate revisions by one user not shown)
Line 2: Line 2:
 
{| border="1" class="wikitable"
 
{| border="1" class="wikitable"
  
−
! Asset
+
! Asset History
 
! colspan="2" |  
 
! colspan="2" |  
 
|-
 
|-
Line 24: Line 24:
  
 
== Response Parameters ==
 
== Response Parameters ==
 +
{| border="1" class="wikitable"
 +
 +
! Field
 +
! Description
 +
|-
 +
! asset
 +
| The asset the history is associated with
 +
|-
 +
|-
 +
! created_at
 +
| Date asset was created
 +
|-
 +
! custom_fields
 +
| Asset custom fields
 +
|-
 +
! customer
 +
| Customer the asset is linked to
 +
|-
 +
! description
 +
| Asset description
 +
|-
 +
|-
 +
! external_id
 +
| Asset external id
 +
|-
 +
! item
 +
| Contains the name, category and external id of the item the asset is linked to
 +
|-
 +
! job
 +
| Job the asset is linked to
 +
|-
 +
! last_scanned_by
 +
| User who last scanned asset
 +
|-
 +
! last_updated_by
 +
| User who last updated asset
 +
|-
 +
! location
 +
| Asset location
 +
|-
 +
|-
 +
! photos
 +
| Photos associated with the asset history
 +
|-
 +
|-
 +
! serial_number
 +
| Asset serial number
 +
|-
 +
! status
 +
| Contains both external id and status name for asset status
 +
|-
 +
|-
 +
! branch
 +
| Branch the asset is linked to
 +
|-
 +
|}
  
 
== Example response ==
 
== Example response ==
 
<source lang="java">
 
<source lang="java">
−
[ { "asset" : { "external_id" : "sss32",
+
[
−
        "serial_number" : "serialNo123"
+
  {
 +
      "location":"aPlace2",
 +
      "status":{
 +
        "external_id":null,
 +
        "name":"test"
 
       },
 
       },
−
    "created_at" : 1375874083000,
+
      "description":"describingwords",
−
    "custom_fields" : null,
+
      "item":{
−
    "customer" : { "name" : "john" },
+
        "external_id":null,
−
    "description" : "describingwords",
+
        "category":"test3",
−
    "external_id" : "sss32",
+
        "name":"Woo"
−
    "item" : { "category" : "Test Numero 1",
+
−
        "external_id" : null,
+
−
        "name" : "Woo"
+
 
       },
 
       },
−
    "job" : { "job_ number" : "123" },
+
      "serial_number":"serialNo456",
−
    "last_scanned_by" : null,
+
      "created_at":"2013-10-08 14:19:17",
−
    "last_updated_by" : null,
+
      "last_updated_by":null,
−
    "location" : "aPlace2",
+
       "external_id":"sss32",
−
    "photos" : [ { "file_name" : "www.testFileName.com/test" },
+
      "last_scanned_by":null,
−
        { "file_name" : "www.testFileName.com/test" }
+
       "job":{
−
       ],
+
        "job_ number":"123"
−
    "serial_number" : "serialNo123",
+
−
    "status" : { "external_id" : null,
+
−
        "name" : "test"
+
−
       }
+
−
  },
+
−
  { "asset" : { "external_id" : "sss32",
+
−
        "serial_number" : "serialNo123"
+
 
       },
 
       },
−
    "created_at" : 1375874146000,
+
      "asset":{
−
    "custom_fields" : null,
+
        "external_id":"sss32",
−
    "customer" : { "name" : "john" },
+
        "serial_number":"serialNo456"
−
    "description" : "describingwords",
+
−
    "external_id" : "sss32",
+
−
    "item" : { "category" : "Test Numero 1",
+
−
        "external_id" : null,
+
−
        "name" : "Woo"
+
 
       },
 
       },
−
    "job" : { "job_ number" : "123" },
+
      "customer":{
−
    "last_scanned_by" : null,
+
        "name":"john"
−
    "last_updated_by" : null,
+
      },
−
    "location" : "aPlace2",
+
      "custom_fields":{
−
    "photos" : [ { "file_name" : "www.testFileName.com/test" } ],
+
        "testFieldName3":"testFieldValue3",
−
    "serial_number" : "serialNo123",
+
        "testFieldName2":"testFieldValue2",
−
    "status" : { "external_id" : null,
+
        "testFieldName1":"testFieldValue1"
−
        "name" : "test"
+
      },
−
       }
+
      "branch":{
−
  }
+
        "name":"DarrenDevTest"
 +
      },
 +
      "photos":[
 +
 
 +
      ]
 +
  },
 +
  {
 +
      "location":"aPlace2",
 +
      "status":{
 +
        "external_id":null,
 +
        "name":"test"
 +
       },
 +
      "description":"describingwords",
 +
      "item":{
 +
        "external_id":null,
 +
        "category":"test3",
 +
        "name":"Woo"
 +
      },
 +
      "serial_number":"serialNo456",
 +
      "created_at":"2013-10-08 14:19:17",
 +
      "last_updated_by":null,
 +
      "external_id":"sss32",
 +
      "last_scanned_by":null,
 +
      "job":{
 +
        "job_ number":"123"
 +
      },
 +
      "asset":{
 +
        "external_id":"sss32",
 +
        "serial_number":"serialNo456"
 +
      },
 +
      "customer":{
 +
        "name":"john"
 +
      },
 +
      "custom_fields":{
 +
        "testFieldName3":"testFieldValue3",
 +
        "testFieldName2":"testFieldValue2",
 +
        "testFieldName1":"testFieldValue1"
 +
      },
 +
      "branch":{
 +
        "name":"DarrenDevTest"
 +
      },
 +
      "photos":[
 +
 
 +
      ]
 +
  }
 
]
 
]
 
</source>
 
</source>
Line 78: Line 167:
 
== Example curl request ==
 
== Example curl request ==
  
−
curl "http://live.mymobileworkers.com:8080/api/1/assets/asset/history/?api_key=darrenwebapi&serial_number=serialNo123"
+
curl "http://api.mymobileworkers.com:8080/api/1/assets/asset/history/?api_key=darrenwebapi&serial_number=serialNo123"

Latest revision as of 12:39, 14 November 2016

Contents

[edit] Summary

Asset History
URL http://:base_url/:api_path/:version/assets/asset/history?api_key=YOUR_KEY&serial_number=SERIAL_NUMBER
Type GET
Params: api_key required
serial_number required
Response JSON

The Get Asset History method returns the asset history entries corresponding to the asset serial number specified.

[edit] Response Parameters

Field Description
asset The asset the history is associated with
created_at Date asset was created
custom_fields Asset custom fields
customer Customer the asset is linked to
description Asset description
external_id Asset external id
item Contains the name, category and external id of the item the asset is linked to
job Job the asset is linked to
last_scanned_by User who last scanned asset
last_updated_by User who last updated asset
location Asset location
photos Photos associated with the asset history
serial_number Asset serial number
status Contains both external id and status name for asset status
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":"test3",
         "name":"Woo"
      },
      "serial_number":"serialNo456",
      "created_at":"2013-10-08 14:19:17",
      "last_updated_by":null,
      "external_id":"sss32",
      "last_scanned_by":null,
      "job":{
         "job_ number":"123"
      },
      "asset":{
         "external_id":"sss32",
         "serial_number":"serialNo456"
      },
      "customer":{
         "name":"john"
      },
      "custom_fields":{
         "testFieldName3":"testFieldValue3",
         "testFieldName2":"testFieldValue2",
         "testFieldName1":"testFieldValue1"
      },
      "branch":{
         "name":"DarrenDevTest"
      },
      "photos":[
 
      ]
   },
   {
      "location":"aPlace2",
      "status":{
         "external_id":null,
         "name":"test"
      },
      "description":"describingwords",
      "item":{
         "external_id":null,
         "category":"test3",
         "name":"Woo"
      },
      "serial_number":"serialNo456",
      "created_at":"2013-10-08 14:19:17",
      "last_updated_by":null,
      "external_id":"sss32",
      "last_scanned_by":null,
      "job":{
         "job_ number":"123"
      },
      "asset":{
         "external_id":"sss32",
         "serial_number":"serialNo456"
      },
      "customer":{
         "name":"john"
      },
      "custom_fields":{
         "testFieldName3":"testFieldValue3",
         "testFieldName2":"testFieldValue2",
         "testFieldName1":"testFieldValue1"
      },
      "branch":{
         "name":"DarrenDevTest"
      },
      "photos":[
 
      ]
   }
]

[edit] Example curl request

curl "http://api.mymobileworkers.com:8080/api/1/assets/asset/history/?api_key=darrenwebapi&serial_number=serialNo123"

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox