Skip to content

Assets

Assets is an optional feature that allows you to maintain a database of customer owned assets and information associated with them.

The following web services can be used to create, update, delete and search for assets within vWork.

Here are the fields you can use when making an asset request:

NameTypeDescription
nameStringUnique name of asset, cannot be blank.
third_party_idStringYour unique ID for the asset. (optional)
modelStringA description of the asset. (optional)
serialStringThe serial number of the asset. (optional)
notesStringAncillary information about the asset. (optional)
group_idsStringComma-separated list of ids of groups this asset shall be a member of. (optional)
customer_idStringThe unique ID of the customer who owns the asset.
costDecimalThe hourly cost of the asset (optional, not currently used)
location.formatted_addressStringThe formatted address of this location.
location.latDecimalThe latitude of the location.
location.lngDecimalThe longitude of the location.
enabledBooleanWhether the asset is enabled or disbled. It is not possible to create jobs for disabled assets.

When retrieving an asset from vWork, you may also see these additional fields in the response. (Depending on what optional features are enabled on your account, you may also see: tags, hazards, time windows, or line items. More information on these options is available in the following sections.)

NameTypeDescription
idIntegerThe unique ID of the asset.
attachment_idIntegerThe unique ID of the asset's attached image. This can only be upload via the web interface.

Create A New Asset

Request

Creates a new asset in vWork.

Security
apiKey
Query
api_keystringrequired
Headers
Accept-Encodingstringrequired

Must be gzip. The vWork API requires HTTP compression on all requests; requests without it may be rejected with 406 Not Acceptable (see Tech Notes → HTTP Compression).

Value:"gzip"
Example:gzip
Bodyapplication/xml; charset=utf-8
string

Raw XML payload — see the example.

POST
/v5/assets.xml
curl -i -X POST \
  'https://api.vworkapp.com/v5/assets.xml?api_key=string&api_key=YOUR_API_KEY_HERE' \
  -H 'Accept-Encoding: gzip' \
  -H 'Content-Type: application/xml; charset=utf-8' \
  -d '<?xml version="1.0" encoding="utf-8"?>
  <asset>
      <name>Milkshake</name>
      <model>Yard</model>
      <serial>123456</serial>
      <notes>A sample note</notes>
      <group_ids>2908</group_ids>
      <customer_id>123456</customer_id>
      <third_party_id>Kelis</third_party_id>
      <cost>42.50</cost>
      <location>
          <formatted_address>200 Queen Street, Auckland, New Zealand</formatted_address>
          <lat>-36.848616</lat>
          <lng>174.765643</lng>
      </location>
  </asset>'

Responses

Created

Headers
Cache-Controlstring
Example:"max-age=0, private, must-revalidate"
Content-Security-Policystring
Example:"frame-ancestors *.vworkapp.com *.vwork.io *.visfleet.com *.salesforce.com *.zoho.com, default-src: google.com google-analytics.com googleapis.com gst
Datestring
Example:"Mon, 13 Jun 2016 23:39:38 GMT"
ETagstring
Example:"W/\"2dbcb6a04f44419e584b939d643b66f1\""
Statusstring
Example:"201 Created"
Strict-Transport-Securitystring
Example:"max-age=31536000"
Transfer-Encodingstring
Example:"chunked"
X-Content-Type-Optionsstring
Example:"nosniff"
X-Frame-Optionsstring
Example:"SAMEORIGIN"
X-Request-Idstring
Example:"c984cbfd-2df1-4010-bad2-d5ef1e4d5412"
X-Runtimestring
Example:"0.586222"
X-Unique-IDstring
Example:"CA7C7B8A:CD56_0A000ED8:01BB_575F4426_6E78F2:1EB6"
X-XSS-Protectionstring
Example:"1; mode=block"
Bodyapplication/xml; charset=utf-8
string

Raw XML payload — see the example.

Response
<?xml version="1.0" encoding="utf-8"?>
<asset>
    <id readonly="readonly">345232</id>
    <name>Milkshake</name>
    <model>Yard</model>
    <serial>123456</serial>
    <notes>A sample note</notes>
    <group_ids>2908</group_ids>
    <customer_id>123456</customer_id>
    <attachment_id></attachment_id>
    <third_party_id>Kelis</third_party_id>
    <cost>42.50</cost>
    <enabled>true</enabled>
    <location>
        <id type="integer">84710961</id>
        <address1></address1>
        <address2></address2>
        <suburb></suburb>
        <city></city>
        <post_code></post_code>
        <country></country>
        <province></province>
        <region></region>
        <state></state>
        <formatted_address>200 Queen Street, Auckland, New Zealand</formatted_address>
        <lat type="decimal">-36.848616</lat>
        <lng type="decimal">174.765643</lng>
        <deleted_at type="datetime"></deleted_at>
        <created_at type="datetime" readonly="readonly">2021-03-10T06:…