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.

GET
https://my.portatour.net/a/api/CalculateSchedule?parameters
Required URL parameters
formatExport 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.
userDateTimeCurrent 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
startStreetStreet of the start location. Should be supplied if startLocationMode is manual.
startCityCity of the start location. Should be supplied if startLocationMode is manual.
startPostalCodePostal code of the start location. Should be supplied if startLocationMode is manual.
startStateState of the start location. Should be supplied if startLocationMode is manual.
startCountryCountry 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.
startLatitudeLatitude of the start location. Can be supplied if startLocationMode is manual.
startLongitude Longitude of the start location. Can be supplied if startLocationMode is manual.
languageRecommended. Language used for the export. More information
planningPeriodStartDateTimeStart 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.
planningPeriodDaysLength 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.
customerPlanningModeSpecifies 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.
includeCustomerDataIf set to true, schedule rows referencing a customer also include all data of that customer. Default is false.
includeAppointmentDataIf set to true, schedule rows referencing an appointment also include all data of that appointment. Default is false.
exportFieldsIf specified, the export will only contain the listed fields, in the specified order. More information
Example usage with curl
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-22T09:47&planningPeriodStartDateTime=2024-11-22T09:47"

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.

Refreshing offline data
Loading...