Get available capacity

get

/rest/ofscCapacity/v1/capacity

This function is intended to returns maximum capacity available according to working calendars and capacity that is expected to be currently available

Request

Query Parameters
  • If multiple capacity areas are selected, this option allows to aggregate results. Default value false. Allows value: true, false
  • Collection Format: csv
    It is one or several capacity areas or their groups that are represented by their labels. String Format: CSV (RFC4180).
  • It is a list of time intervals the available capacity should be calculated for. A format: all | [:] | [[:]]-[[[:]]. Default value all
  • Collection Format: csv
    It is a list of time intervals the calendar capacity should be calculated for. It is defined as a comma-separated list. Each item in the list represents a particular interval. It has the following format: Item format all | [:] | [[:]]-[[[:]] Please note that: 'all' represents a whole working day. Hours valid values: [0; 48] Hours values > 24 - overnight work Minutes are optional. Minutes valid values: [0; 59] A single time value specified as the interval allows to determine a number of resources available on a given moment. Separate intervals can be specified for the 'calendar' and 'available' capacity. The system allows to use intersected and duplicated intervals within the same request. Default value all Example all,-08,08,08-9,9-10, 10-12 , 12-12:30, 12:30-13,12-14,14:30,15-
  • Collection Format: csv
    It is the capacity category filter. This parameter accepts one or several capacity categories identified by their labels. If there are no capacity categories in the filter, this function returns all capacity categories available for a given area(s).Format CSV (RFC4180)
  • Collection Format: csv
    It is one or several dates to be processed.Format CSV (RFC4180). Item format YYYY-MM-DD
  • Collection Format: csv
    Supported fields: - area.name; - area.calendar.count; - area.calendar.minutes; - area.available.count; - area.available.minutes; - area.category.calendar.count; - area.category.calendar.minutes; - area.category.available.count; - area.category.available.minutes; Default value: - date (returned regardless "fields"); - area.label (returned regardless "fields"); - area.calendar.count; - area.category.label (returned regardless "fields"); - area.category.calendar.count Format CSV (RFC4180)
Back to Top

Response

Supported Media Types

200 Response

Returns collection of booking closing schedule
Body ()
Collection of capacity
Root Schema : capacityList
Type: object
Collection of capacity
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : capacity
Type: object
Show Source
Nested Schema : areas
Type: array
A particular item in this array contains data for a single capacity area or an aggregation result.
Show Source
Nested Schema : items
Type: object
Show Source
  • available
    It is an information about the capacity that is expected to be currently available. A number and order of items in the "count" and "minutes" arrays returned as sub-items of this one correspond to the time intervals specified in the "available TimeIntervals" parameter. Please note that the returned values are calculated based on: - working calendars of resources that belong to this area - activities in existing routes of the resources that belong to this area - time of activation, reactivation, and deactivation for these routes - scheduled activities that are currently located in buckets but belong to this area
  • calendar
    It is an information about resources that belong this area and having a working calendar for this day. Please note that a number and order of items in the "count" and "minutes" arrays returned as sub-items of this one correspond to the time intervals specified in the "calendarTimeIntervals" parameter .
  • categories
    A particular item in this array contains data for a single capacity category.
  • It is a label that identifies this area. Please note that this field is not returned if the 'aggregateResults' option is enabled.
  • It is a name of this area. Please note that this field is not returned if the 'aggregateResults' option is enabled.
Nested Schema : available
Type: array
It is an information about the capacity that is expected to be currently available. A number and order of items in the "count" and "minutes" arrays returned as sub-items of this one correspond to the time intervals specified in the "available TimeIntervals" parameter. Please note that the returned values are calculated based on: - working calendars of resources that belong to this area - activities in existing routes of the resources that belong to this area - time of activation, reactivation, and deactivation for these routes - scheduled activities that are currently located in buckets but belong to this area
Show Source
Nested Schema : calendar
Type: array
It is an information about resources that belong this area and having a working calendar for this day. Please note that a number and order of items in the "count" and "minutes" arrays returned as sub-items of this one correspond to the time intervals specified in the "calendarTimeIntervals" parameter .
Show Source
Nested Schema : categories
Type: array
A particular item in this array contains data for a single capacity category.
Show Source
Nested Schema : items
Type: object
Show Source
  • count
    It is a number of resources that are expected to be available time within the time intervals.
  • minutes
    It is the maximum capacity available according to calendars of these resources.This value is also calculated for the time intervals specified in the "calendarTimeIntervals" parameter.
Nested Schema : count
Type: array
It is a number of resources that are expected to be available time within the time intervals.
Show Source
Nested Schema : minutes
Type: array
It is the maximum capacity available according to calendars of these resources.This value is also calculated for the time intervals specified in the "calendarTimeIntervals" parameter.
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : count
Type: array
It is a number of resources working within the time intervals.
Show Source
Nested Schema : minutes
Type: array
It is the maximum capacity available according to calendars of these resources .
Show Source
Nested Schema : items
Type: object
Show Source
  • available
    It is an information about the capacity that is expected to be currently available. A number and order of items in the "count" and "minutes" arrays returned as sub-items of this one correspond to the time intervals specified in the "availableTimeIntervals" parameter. Please note that the returned values are calculated based on: - working calendars of resources that belong to this area - activities in existing routes of the resources that belong to this area - time of activation, reactivation, and deactivation for these routes - scheduled activities that are currently located in buckets but belong to this area
  • calendar
    It is an information about the resources that belong this area, have a working calendar for this day, and have this capacity category. Please note that a number and order of items in the "count" and "minutes" arrays returned as sub-items of this one correspond to the time intervals specified in the "calendarTimeIntervals" parameter.
  • It is a label of this capacity category.
Nested Schema : available
Type: array
It is an information about the capacity that is expected to be currently available. A number and order of items in the "count" and "minutes" arrays returned as sub-items of this one correspond to the time intervals specified in the "availableTimeIntervals" parameter. Please note that the returned values are calculated based on: - working calendars of resources that belong to this area - activities in existing routes of the resources that belong to this area - time of activation, reactivation, and deactivation for these routes - scheduled activities that are currently located in buckets but belong to this area
Show Source
Nested Schema : calendar
Type: array
It is an information about the resources that belong this area, have a working calendar for this day, and have this capacity category. Please note that a number and order of items in the "count" and "minutes" arrays returned as sub-items of this one correspond to the time intervals specified in the "calendarTimeIntervals" parameter.
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : count
Type: array
It is a number of resources that are expected to be available time within the time intervals.
Show Source
Nested Schema : minutes
Type: array
It is the capacity that is expected to be available within the time intervals.
Show Source
Nested Schema : items
Type: object
Show Source
  • count
    It is a number of resources that are expected to be available time within the time intervals.
  • minutes
    It is the maximum capacity available according to calendars of these resources.This value is also calculated for the time intervals specified in the "calendarTimeIntervals" parameter.
Nested Schema : count
Type: array
It is a number of resources that are expected to be available time within the time intervals.
Show Source
Nested Schema : minutes
Type: array
It is the maximum capacity available according to calendars of these resources.This value is also calculated for the time intervals specified in the "calendarTimeIntervals" parameter.
Show Source

Default Response

In all other cases the Error object will be returned.
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

Examples

The following example shows how to get the available capacity by submitting a GET request on the REST resource.

Example of Request Header

The following shows an example of the request header.

GET /rest/ofscCapacity/v1/capacity?dates=2017-08-23&areas=Texasin%2CCapacityArea=true&calendarTimeIntervals=10-12&categories=IN%2CTC%2C%2CUP&availableTimeIntervals=01-06&fields=area.name%2C%20area.calendar.count%2Carea.calendar.minutes%2Carea.available.count%2Carea.available.minutes%2Carea.category.calendar.count%2Carea.category.calendar.minutes%2Carea.category.available.count%2Carea.category.available.minutes HTTP/1.1A
Connection: close
Accept-Encoding: gzip,deflate
Host: api.etadirect.com
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: nginx
Date: Wed, 23 Aug 2017 12:02:47 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Credentials: true
Strict-Transport-Security: max-age=31536000; includeSubDomains;

Example of Response Body

The following example shows the contents of the response body in JSON format.

{"items": [{
   "date": "2017-08-23",
   "areas": [   {
      "calendar":       {
         "count": [86],
         "minutes": [10080]
      },
      "available":       {
         "count": [0],
         "minutes": [0]
      },
      "categories":       [
                  {
            "label": "IN",
            "calendar":             {
               "count": [85],
               "minutes": [10080]
            },
            "available":             {
               "count": [0],
               "minutes": [0]
            }
         },
                  {
            "label": "TC",
            "calendar":             {
               "count": [86],
               "minutes": [10080]
            },
            "available":             {
               "count": [0],
               "minutes": [0]
            }
         },
                  {
            "label": "UP",
            "calendar":             {
               "count": [80],
               "minutes": [9600]
            },
            "available":             {
               "count": [0],
               "minutes": [0]
            }
         }
      ]
   }]
}]}
Back to Top