'get_capacity' Request
The 'get_capacity' request defines:
Capacity parameters:
capacity bucket and date for which capacity should be returned
specific time slots and capacity categories for which the returned capacity data (if any) should be filtered
work zone key parameters, if required (if the quota close time is defined for specific work zones)
Other parameters:
flags to define if the duration/travel time/capacity categories are to be returned and calculated
company-specific fields used to calculate duration/travel time/capacity categories (if necessary)
The following table describes the 'get_capacity' request parameters.
Name |
Required |
Type |
Description |
---|---|---|---|
user |
Yes |
struct |
'user' structure |
date |
Yes |
date |
date for which capacity data should be returned in the YYYY-MM-DD format any number of 'date' parameters can be defined |
location |
No |
string |
external ID of the capacity bucket |
calculate_duration |
No |
bool |
if the flag is checked set to '1' or 'true', the 'activity_field' node should contain the fields required to calculate duration/travel time/capacity category value, respectively, and they will be returned in the response default value: false |
calculate_travel_time | |||
calculate_work_skill | |||
time_slot |
No |
string |
label of the time slot for which capacity data should be returned if the parameter is absent, the data for the full range of time slots is returned |
work_skill |
No |
string |
label of capacity category for which capacity data should be returned if the 'work_skill' parameter is absent AND the 'calculate_work_skill' flag is set to 'true', capacity is calculated using 'activity_field' node values if the 'work_skill' parameter is absent AND the 'calculate_work_skill' flag is set to 'false', capacity for all capacity categories defined for the company is returned |
activity_field |
Yes/No |
node |
parameters that can be used to define the duration/travel time/capacity category and work zone |
dont_aggregate_results |
No |
bool |
option defining whether the results for different buckets within the same request are to be aggregated. When the value is set to '1' or 'true', the results for different buckets are not aggregated and are returned separately default value: false |
determine_location_by_work_zone |
No |
bool |
option defining whether the capacity bucket is to be determined by the work zone of the activity. When the value is set to '1' or 'true', the work zone to which the activity belongs is retrieved, and all capacity buckets to which such work zone is assigned are processed. In this case the work zone key fields become mandatory. default value: false |
min_time_to_end_of_time_slot |
No |
string |
parameter defining the minimum remaining time of the time slot. Capacity for the specified time slot is returned only when the calculated value of time remaining before the end of such time slot is equal or greater than the set value. The remaining time is calculated as follows: – for time slot: time slot end minus current time in time zone of capacity bucket – for day or all-day time slot: start of next day minus current time in time zone of capacity bucket Note: when the response contains aggregated data of multiple capacity buckets with different time zones and different current time, the function uses the maximum current time value determined among such capacity buckets to check the threshold. Unit of measurement: minutes valid values: in the range from -1440000 to 1440000 |
return_time_slot_info |
No |
bool |
option defining whether the time slot node containing its name, label and time interval is to be returned. default value: false |
default_duration |
No |
int |
default activity duration. If 'default_duration' is sent, the 'worktype_label' or 'aworktype' fields defining the activity type are mandatory. If the 'Define duration manually' feature is enabled for the activity type, the method returns the sent 'define_duration' value. Otherwise, the statistical value is used. If no statistical record is available for the activity, the sent 'default_duration' value is returned. When 'default_duration' is omitted and the 'Define duration manually' feature is enabled for the activity type, the default duration defined at the company level is returned. |
includePartiallyDefinedCategories |
No |
bool |
If this option is set to true and more than one capacity category
matching the given activity is defined for the capacity area(s), the
function returns capacity area(s) having at least one capacity category
matching the activity. If this option is set to false or omitted (default behavior), the function returns only those capacity areas that has all the capacity categories from the ones defined in the system that matches the activity. |