'get_capacity' Request Example

The following example requests capacity data for several capacity buckets for 4-5 February, 2014 for time slots 8-12 and 12-17. The request contains the following parameters:

  • 'calculate_duration'. The property defined in Manage Application → Company Settings → Statistics Parameters → Activity duration stats fields is 'activity type'. The type of the activity can be specified by its label ('worktype_label') which in the example below is 'AL'. The 'worktype_label' and its value are sent in the 'activity_field' node. This field is the key for the activity duration statistics.

  • 'calculate_travel_time'. The property defined in Manage Application → Company Settings → Statistics Parameters → Activity travel stats fields is post code 'czip' which in the example below is 14101. The 'czip' and its value are sent in the 'activity_field' node. This field is the key for the travel statistics.

  • 'calculate_work_skill'.The Work Skill Conditions use property – 'AA_CATEGORY' which in the example below has the value of '4' corresponding to capacity category 'Deinstall'. The 'AA_CATEGORY' and its value are sent in the 'activity_field' node.

  • The time slot information is required, therefore, in the request the 'return_time_slot_info' is set to 'true.

  • The 'Define duration manually' feature is enabled for the 'AL' type of activities. Therefore the value of duration for this activity is retrieved from the 'default_duration' parameter.

  • The request is sent at 10 a.m. on 4 February, 2014, so there is no need to return capacity data for the time slot which ends in less than 2 hours. For this purpose the request includes the 'min_time_to_end_of_time_slot' set to 125 minutes.

  • The capacity data is needed for for each capacity bucket separately, therefore, the 'dont_aggregate_results' parameter is set to 'true'.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:toa:capacity">
	<soapenv:Header/>
	<soapenv:Body>
		<urn:get_capacity>
			<user>
				<now>2018-02-13T10:00:28+00:00</now>
				<company>sunrise</company>
				<login>root</login>
				<auth_string>f346612cf354f8d0e447afbe58323072</auth_string>
			</user>
				<date>2018-02-13</date>
			<location>FullDefinedByCategoriesWithWorkS</location>
			<location>PartlyDefinedByCategoriesWithWor</location>
			<calculate_duration>false</calculate_duration>
			<calculate_travel_time>false</calculate_travel_time>
			<calculate_work_skill>true</calculate_work_skill>
			<determine_location_by_work_zone>true</determine_location_by_work_zone>
			<dont_aggregate_results>true</dont_aggregate_results>
			<include_partially_defined_categories>true</include_partially_defined_categories>
			<default_duration>60</default_duration>
		<activity_field>
			<name>cityl</name>
			<value>52227</value>
		</activity_field>
		<activity_field>
			<name>string_text_activity_property</name>
			<value>ws2_ws1</value>
		</activity_field>
		<activity_field>
			<name>aworktype</name>
			<value>15</value>
		</activity_field>
		</urn:get_capacity>
</soapenv:Body>
</soapenv:Envelope>

If the capacity category label is known, it can be defined and then there will be no need to define the fields used to calculate the work skills. For example, the labels of the capacity categories are MW and LLW.

		<date>2014-02-04</date>
			<location>planning</location>
			<time_slot>13-15</time_slot>
			<time_slot>15-17</time_slot>
			<work_skill>MW</work_skill>
			<work_skill>LLW</work_skill>

If it is necessary to retrieve capacity data for the specific work zone, its key field (which is defined in Manage Application → Company Settings → Work Zone Dictionary → Work Zone Key) can be defined in the 'activity_field' element and all capacity data for all capacity buckets with this work zone will be returned.

<date>2014-02-05</date>
	<determine_location_by_work_zone>true</determine_location_by_work_zone>
		<time_slot>12-17</time_slot> 
		<time_slot>08-12</time_slot>
	<activity_field>
		<name>czip</name>
		<value>10144</value>
	</activity_field>