> For the complete documentation index, see [llms.txt](https://developers.praxedo.com/under-dev-1/llms.txt)

# Search for the best available slot

> POST /rest/v1/slots/search/best
> 
> > warn
> > Mind to choose the dedicated server for this application.
> 
> Finds the best available slot for qualified field resources to carry out a given type of work order, based on the client's best slot policy.
> Given a work order type and a location, and a Best Slot Policy, the service allows to find a single slot during which field resource possessing the needed skills have enough time to travel to the work order site from the previous site, perform the work order, and travel to the site of the next work order.
> 
> **Selection policy**
> 
> Candidates slots are ranked according to an ordered list of criteria. As soon
> as a single candidate remains, it is returned; otherwise the next
> criterion applies.
> 
> Best value for each criterion :
> 
> `TRAVEL_TIME` : Lowest travel time added to the field resource's route
> 
> `GAP_FILL` : Highest workload of the field resource on the day of the slot
> 
> `EARLIEST` : Earliest start, regarding the beginning of the searched period
> 
> Default policy: `TRAVEL_TIME` > `GAP_FILL` > `EARLIEST`. It applies when
> `bestSlotCriteria` or `criteriaOrder` is not provided, null or empty.
> When only 1 or 2 criteria are provided, they come first (in the given
> order), followed by the remaining criteria in the default order.
> 
> If candidates are still tied after the three criteria, field resource ID is used to make a decision.
> 
> **Options not available on this endpoint**
> 
> The following options of `/rest/v3/slots/search` are ignored if
> provided:
> - `slotSearchConfiguration.searchSize.maximumSlotNumber`
> - `slotSearchConfiguration.servedSlots.perTimeInterval`
> - `slotSearchConfiguration.servedSlots.perResource`



## Servers
- EU servers URL: https://availableslots-production-1.praxedo.com (EU servers URL)
- AM2 server URL: https://availableslots-production-2.praxedo.com (AM2 server URL)
- AM1 server URL: https://availableslots-production-3.praxedo.com (AM1 server URL)


## Authentication methods
- Bearer authentication


## Parameters



### Body: application/json (object)

- **endCustomer** (object)

- **schedulerRequirements** (object)

- **slotSearchConfiguration** (object)
  Configuration of the best slot search. `searchSize` is not available on this endpoint and is ignored if provided.



## Responses
### 200
OK. The best slot, or an empty `slot` list if no slot is eligible.

#### Body: application/json (object)
- **slot** (array[object])
  The best slot found. Contains at most one slot. Empty if no slot is eligible.


### 400
Bad request

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 1001
The work order type is missing

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 1002
A list of time ranges or a an appointment date is missing

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 1003
Received a request requesting slots related to field resources in charge of an area (enableZoneFilter = 'true'). However, no zip code has been provided to help identify the area in which the work order will take place

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2001
The provided work order type does not exist

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2002
At least one of the provided offices does not exist

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2003
The provided dates are in the past

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2004
The end date of the search interval is earlier than the start date

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2005
The slot search period is too long. The maximum is 200 weeks

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2006
The 'offices' list accepts either 'codes' or 'ids', but not both. Please provide only one

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2007
The provided areas do not exist

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2009
The skills list accepts either 'codes' or 'ids', but not both. Please provide only one

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2010
The 'workOrder' can either be a code or an id. Please provide only one

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2011
Invalid value '%s' for parameter 'areaScope'. Allowed values are: 'RESOURCE', 'TIMESLOT'

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2012
The parameter 'customerPortalUser' cannot be used with the 'RESOURCE' area scopes

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2016
Invalid value '%s' for parameter 'criteriaOrder'. Allowed values are: 'GAP_FILL', 'EARLIEST', 'TRAVEL_TIME'

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 2017
The criteria '%s' is duplicated in 'criteriaOrder'. Each criteria can only be provided once

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 3011
The provided address couldn't be geocoded

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 3021
The provided [latitude, longitude] is out of range : [%s, %s]. Expected values : -90 < latitude < 90 and -180 < longitude < 180

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 3022
Coordinates (0,0) are not accepted

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 3031
The travel times and distances could not be computed

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.


### 3032
No route could be found to reach the work order destination (e.g. closed road, unreachable area)

#### Body: application/json (object)
- **errorCode** (string)
  The error code.

- **errorMessage** (string)
  The error message.



[Powered by Bump.sh](https://bump.sh)
