Difference between revisions of "Get Assets By Item Category"

From MyMobileWorkers API
Jump to: navigation, search
(→‎Response Parameters)
(→‎Example response)
Line 78: Line 78:
 
== Example response ==
 
== Example response ==
 
<source lang="java">
 
<source lang="java">
−
[
 
 
{
 
{
−
"location":"aPlace",
+
  "location":"aPlace2",
−
"status":{
+
  "status":{
−
"external_id":null,
+
      "external_id":null,
−
"name":"test"
+
      "name":"test"
−
},
+
  },
−
"description":"describingwords",
+
  "description":"describingwords",
−
"item":{
+
  "item":{
−
"external_id":null,
+
      "external_id":null,
−
"category":"",
+
      "category":"test3",
−
"name":"Woo
+
      "name":"Woo"
−
"},
+
  },
−
"serial_number":"serialNo123",
+
  "serial_number":"serialNo456",
−
"created_at":1375786053000,
+
  "created_at":1376650412900,
−
"last_updated_by":null,
+
  "last_updated_by":null,
−
"external_id":"sss32",
+
  "external_id":"sss32",
−
"last_scanned_by":null,
+
  "last_scanned_by":null,
−
"custom_fields":null,
+
  "job":{
−
"job":{
+
      "job_ number":"123"
−
"job_ number":"123"},
+
  },
−
"customer":{
+
  "customer":{
−
"name":"john"
+
      "name":"john"
−
}
+
  },
 +
  "custom_fields":{
 +
      "testFieldName3":"testFieldValue3",
 +
      "testFieldName2":"testFieldValue2",
 +
      "testFieldName1":"testFieldValue1"
 +
  },
 +
  "branch":{
 +
      "name":"DarrenDevTest"
 +
  }
 
}
 
}
−
]
 
 
</source>
 
</source>
  

Revision as of 11:09, 16 August 2013

Contents

Summary

Asset by item category
URL http://:base_url/:api_path/:version/asset/category?api_key=YOUR_KEY&category=CATEGORY
Type GET
Params: api_key required
category required
Response JSON

The Get Asset method returns the asset corresponding to the category name specified.

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

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":1376650412900,
   "last_updated_by":null,
   "external_id":"sss32",
   "last_scanned_by":null,
   "job":{
      "job_ number":"123"
   },
   "customer":{
      "name":"john"
   },
   "custom_fields":{
      "testFieldName3":"testFieldValue3",
      "testFieldName2":"testFieldValue2",
      "testFieldName1":"testFieldValue1"
   },
   "branch":{
      "name":"DarrenDevTest"
   }
}

Example curl request

curl "http://live.mymobileworkers.com:8080/api/1/assets/category/?api_key=darrenwebapi&category=test3"

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox