Difference between revisions of "Get Assets Assigned To Customer"

From MyMobileWorkers API
Jump to: navigation, search
(Created page with "== Summary == {| border="1" class="wikitable" ! Asset ! colspan="2" | |- ! URL | colspan="2" | http://:base_url/:api_path/:version/asset?api_key=YOUR_KEY&serial_number=SERI...")
 
Line 2: Line 2:
 
{| border="1" class="wikitable"
 
{| border="1" class="wikitable"
  
−
! Asset
+
! Asset by customer name
−
! colspan="2" |
+
−
|-
+
−
! URL
+
−
| colspan="2" |  http://:base_url/:api_path/:version/asset?api_key=YOUR_KEY&serial_number=SERIAL_NUMBER
+
−
|-
+
−
! Type
+
−
| colspan="2" | GET
+
−
|-
+
−
! Params:
+
−
| api_key || required
+
−
|-
+
−
!
+
−
| serial_number || required
+
−
|-
+
−
! Response
+
−
| colspan="2" | JSON
+
−
|}
+
−
 
+
−
The Get Asset method returns the asset corresponding to the serial number specified.
+
−
 
+
−
== Response Parameters ==
+
−
{| border="1" class="wikitable"
+
−
 
+
−
! 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
+
−
|-
+
−
|}
+
−
 
+
−
== Example response ==
+
−
<source lang="java">
+
−
[
+
−
{
+
−
"location":"aPlace",
+
−
"status":{
+
−
"external_id":null,
+
−
"name":"test"
+
−
},
+
−
"description":"describingwords",
+
−
"item":{
+
−
"external_id":null,
+
−
"category":"Test Numero 1",
+
−
"name":"Woo
+
−
"},
+
−
"serial_number":"serialNo123",
+
−
"created_at":1375786053000,
+
−
"last_updated_by":null,
+
−
"external_id":"sss32",
+
−
"last_scanned_by":null,
+
−
"custom_fields":null,
+
−
"job":{
+
−
"job_ number":"123"},
+
−
"customer":{
+
−
"name":"john"
+
−
}
+
−
}
+
−
]
+
−
</source>
+
−
 
+
−
== Example curl request ==
+
−
 
+
−
== Summary ==
+
−
{| border="1" class="wikitable"
+
−
 
+
−
! Asset
+
 
! colspan="2" |  
 
! colspan="2" |  
 
|-
 
|-

Revision as of 13:47, 12 August 2013

Contents

Summary

Asset by customer name
URL http://:base_url/:api_path/:version/asset/customer?api_key=YOUR_KEY&customer=CUSTOMER
Type GET
Params: api_key required
customer required
Response JSON

The Get Assets Assigned To Customer method returns the list of assets assigned to the customer name provided in the parameter.

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

Example response

{
   "assets":[
      {
         "location":"aPlace2",
         "status":{
            "external_id":null,
            "name":"test"
         },
         "description":"describingwords",
         "item":{
            "external_id":null,
            "category":"Test Numero 1",
            "name":"Woo"
         },
         "serial_number":"serialNo123",
         "created_at":1375874083000,
         "last_updated_by":null,
         "external_id":"sss32",
         "last_scanned_by":null,
         "custom_fields":null,
         "job":{
            "job_ number":"123"
         },
         "customer":{
            "name":"john"
         }
      },
      {
         "location":"aPlace2",
         "status":{
            "external_id":null,
            "name":"test"
         },
         "description":"describingwords",
         "item":{
            "external_id":null,
            "category":"Test Numero 1",
            "name":"Woo"
         },
         "serial_number":"serialNo456",
         "created_at":1375888861000,
         "last_updated_by":null,
         "external_id":"sss32",
         "last_scanned_by":null,
         "custom_fields":null,
         "job":{
            "job_ number":"123"
         },
         "customer":{
            "name":"john"
         }
      }
   ]
}

Example curl request

curl "http://live.mymobileworkers.com:8080/api/1/assets/asset/customer/?api_key=darrenwebapi&customer=john"

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox