Can I Restrict What Users are Allowed to do with a Job via the API ?

What is a Restriction?

Restrictions prevent both mobile users (workers) and web users (dispatchers) from being able to change certain parts of a job.  This is an API only feature at this point.

The one exception to this rule is planned_start_at.  Setting a restriction on planned_start_at will only prevent a dispatcher from changing the start time by dragging the job on the schedule.  They will still be able to open the job and reschedule it.  (In effect, it prevents them from rescheduling the job by mistake when assigning it to a worker.)

 

What Restrictions Can Be Set?

You can set a restriction on any of the following job nodes:

  • planned_duration
  • customer_id
  • planned_start_at
  • custom field name
  • custom field value
  • invoice tax rate
  • invoice description
  • invoice line item code
  • invoice line item description
  • invoice line item requested quantity
  • invoice line item actual quantity
  • invoice line item unit cost
  • invoice line item notes

  

How Do I Set a Restriction?

You set a restriction by including a restrictions node in the job XML.  The following job example sets all restrictions available in red:

<?xml version="1.0"?>
<job>
<job_type>job</job_type>
<restrictions>planned_duration,customer_id,planned_start_at</restrictions>
<customer_ID>459092</customer_ID>
<planned_start_at>2015-04-14T00:57:00+00:00</planned_start_at>
<template_name>Job</template_name>
<planned_duration>3600</planned_duration>
<steps type="array">
<step>
<name>En Route</name>
</step>
</steps>
<custom_fields type="array">
<custom_field>
<restrictions>name,value</restrictions>
<name>Notes</name>
<value>Unchangeable Notes</value>
<mobile>
<permission>read_only</permission>
</mobile>
</custom_field>
</custom_fields>
<invoice>
<number>INV003</number>
<description>Bill of work</description>
<tax_rate>3.4</tax_rate>
<restrictions>tax_rate,description</restrictions>
<line_items type="array">
<line_item>
<code>WA382</code>
<description>Washer</description>
<unit_cost>100.0</unit_cost>
<requested_quantity>1.0</requested_quantity>
<actual_quantity>1.0</actual_quantity>
<restrictions>code,unit_cost,description,requested_quantity,actual_quantity,notes</restrictions>
</line_item>
</line_items>
</invoice>
</job>

 



Need more information? ask us hereHave more questions? Submit a request