lock/Unlock request
This request is used to lock schedules to the system. To do it, API uses application/xml as its acceptable request representation, and the standard HTTP-method POST.
URL: /rest/2/distribution-api/schedules/lock
/rest/2/distribution-api/schedules/unlock
Input for lock/Unlock request
The list of all supported attributes and their description provided in the table below.
# | Attribute name | Type | Style | Mandatory | Description |
1 | date | String | Query | Yes | Date when the run is scheduled. Depends on the configuration for particular account localization. Example of English format is “DD/MM/YYYY”. Example of Russian format is “DD.MM.YYYY” |
2 | vehicleID | Long | Query | Yes | ID of the vehicle in Maxoptra |
3 | aocID | Long | Query | Yes | ID of the distribution center in Maxoptra |
4 | runNumber | Short | Query | No | ID of run for particular vehicle in Maxoptra |
The following combinations of attributes are possible for run locking/unlocking:
- Locking of one run: vehicleID + date + runNumber
- Locking for the selected vehicle: vehicleID + date
- Locking for the depot: aocID + date
Note
- The vehicle attribute (= vehicle's external ID) can be used instead of vehicleID (= vehicle's internal ID).
- Locking/unlocking is possible only if the details have not been sent yet. When trying to lock/unlock the started run - error 1314.
- When using the aocID attribute together with vehicleID, then all the runs for all the vehicles of the specified depot (AOC) will be locked/unlocked (if details were not sent yet).
- It is possible to put multiple vehicles or dates in one request.
Example of getScheduleByVehicleOnDate request
URL: /rest/2/distribution-api/schedules/{lock|unlock}?date=18.10.2018&{vehicleID=123|aocID=123}&(runNumber=1)
Method: POST
getVehicleLocationByVehicleId response
Lock schedule
|
Unlock schedule
|
Possible errors
Error | Description |
---|---|
1014 | Expected parameters |
1015 | Internal service error |
1019 | User with provided credentials doesn’t have AoC access or AoC doesn’t exist |
1314 | Failed to lock/unlock |