Skip to content

H&S - Managing Tags

Tags and Hazards are part of the optional vWork Health and Safety module. If you are not using this module, you can ignore this section of the API documentation.

You can add specific tags to your workers and jobs. This will prevent jobs being assigned to workers that do not have the required qualification for a certain job. (For example, you can tag a job as requiring a certified electrician and then tag your electricians with this same tag.)

Tags need to be defined in your account before they can be added to your workers or jobs. This can be done via the website or via the API.

Tags may have a description as well as an expiry date. If you say that a tag requires an expiry date, the expiry date is added to the tag when it is associated with the user. (For example, Bob may have a commercial driver's license that expires on Jan 1, 2020.)

Here are the fields you can use when making a tag request:

NameTypeDescription
nameStringThe name of the tag.
descriptionStringA description of the tag.
expiresBooleanWhether or not an expiry date is required when adding the tag to a user.

When retrieving a tag from vWork, you may also see these additional fields in the response:

NameTypeDescription
idIntegerUnique ID of the tag, used when adding a tag to a job or a user.
created_atDateTimeTime tag was created.
updated_atDateTimeTime tag was last updated.
created_by_user_idIntegerUser ID of the user who created the tag. (Set to Nil if created via the API.)

Create A New Tag

Request

Creates a new tag 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/tags.xml
curl -i -X POST \
  'https://api.vworkapp.com/v5/tags.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"?>
  <tag>
      <name>CDL</name>
      <description>Commercial Driver'\''s License</description>
      <expires>true</expires>
  </tag>'

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:"Tue, 14 Jun 2016 02:41:25 GMT"
ETagstring
Example:"W/\"852a96824f66ae37c18df704c0efb80a\""
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:"e583c836-b1d8-4e4c-836e-20e07aec2b23"
X-Runtimestring
Example:"0.046924"
X-Unique-IDstring
Example:"CA7C7B8A:D37C_0A000ED8:01BB_575F6EC3_78E6B6:1E66"
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"?>
<tag>
    <id type="integer">27</id>
    <name>CDL</name>
    <description>Commercial Driver's License</description>
    <expires type="boolean">true</expires>
    <created_by_user_id nil="true"/>
    <created_at type="datetime">2016-06-14T02:41:25Z</created_at>
    <updated_at type="datetime">2016-06-14T02:41:25Z</updated_at>
</tag>