CalculateSchedule
Calculates a new schedule for the user, saves it as the current schedule of the user and returns it the same way a schedule export would return it. Batch calls for multiple users should not be executed in parallel but sequentially to avoid running into resource limitations for your account.
https://my.portatour.net/a/api/CalculateSchedule?parameters
|
Required URL parameters | |
format | Export format, can be one of xlsx, xls, ods, csv, simplecsv, or xlsxtable. More information |
---|---|
userEmail, employeeNumber | Email address or employee number of the user for whom a schedule should be calculated and exported. Exactly one must be specified. |
userDateTime | Current date and time in the user's time zone. Use an ISO format without specifying the time zone, for example YYYY-MM-DDThh:mm |
startLocationMode | Schedule start location type, can be one of homelocation, calculated, or manual. If you choose manual, you need to supply the address via the following optional address fields. Note: If you don't specify startLatitude and startLongitude, portatour® will try to geocode the address automatically. |
Optional URL parameters | |
startStreet | Street of the start location. Should be supplied if startLocationMode is manual. |
startCity | City of the start location. Should be supplied if startLocationMode is manual. |
startPostalCode | Postal code of the start location. Should be supplied if startLocationMode is manual. |
startState | State of the start location. Should be supplied if startLocationMode is manual. |
startCountry | Country of the start location. Should be supplied if startLocationMode is manual. If left empty, the country of the home address of the user will be assumed. |
startLatitude | Latitude of the start location. Can be supplied if startLocationMode is manual. |
startLongitude | Longitude of the start location. Can be supplied if startLocationMode is manual. |
language | Recommended. Language used for the export. More information |
planningPeriodStartDateTime | Start date and time for the schedule. The actual start might be postponed to align with the user's working hours. Use an ISO format without specifying the time zone, for example YYYY-MM-DDThh:mm. If not specified, the current setting is used. |
planningPeriodDays | Length of the schedule in days, can be 1, 2, 3, 4, 5, 6, 7, 14, 21, or 28. If not specified, the current setting is used. |
customerPlanningMode | Specifies how customers should be planned, can be one of AccordingToCallInterval or OnlyReservations. If not specified, the current setting is used. |
hadWorkBreakToday | Whether the user already had his work break today. Allowed values are true or false. If not specified, the current setting is used. |
trafficConditionsForFirstRide | Specifies which traffic conditions are used for the first ride during calculation, can be one of CurrentTraffic or TypicalTraffic. If not specified, the current setting is used. If not specified and the current setting is "Ask", typical traffic conditions will be used. The current traffic conditions will only be taken into account if the first ride starts within the next 15 minutes. |
includeCustomerData | If set to true, schedule rows referencing a customer also include all data of that customer. Default is false. |
includeAppointmentData | If set to true, schedule rows referencing an appointment also include all data of that appointment. Default is false. |
exportFields | If specified, the export will only contain the listed fields, in the specified order. More information |
curl -o schedule.csv -u admin_username:admin_password
"https://my.portatour.net/a/api/CalculateSchedule?format=csv&language=en-US&userEmail=bob@example.com&startLocationMode=calculated&userDateTime=2024-11-22T12:46&planningPeriodStartDateTime=2024-11-22T12:46"
|
Caution: When you process exported data, don't depend on the column order. Use the column header names to access data. The order of the columns might change, e.g if new fields are added. In case your importer doesn’t support accessing field values by field name, use the exportFields parameter to specify the columns and their order.