Create Reservation
Creates a new device reservation.
URL |
Copy
|
Method |
|
For information on a previous version of this endpoint, see Create Reservation | Legacy.
Header parameters
Name |
Description |
---|---|
|
The Perfecto security token. For more information, see Generate a security token. |
Request parameters
Name |
Type |
Default |
Description |
---|---|---|---|
|
boolean |
false |
Set to Users with administrative credentials can create reservations that are longer than the max time frame. Restriction: This parameter is not available on a shared MCM.
|
Request body
Name | Type | Description |
---|---|---|
|
array |
A comma separated list of deviceId in an array. For example: |
|
long |
The reservation start time, measured in milliseconds, from midnight, January 1, 1970 UTC (standard UNIX time).** Tip: Use -1 to indicate current time.
|
|
long |
The reservation end time, measured in milliseconds, from midnight, January 1, 1970 UTC (standard UNIX time).** |
|
string |
The user the device is reserved to. |
|
string |
The reservation description (free text). |
* Mandatory parameter
** Use this Timestamp converter to create the required time stamp for the new startTime and endTime values.
Sample request body
{
"resourceIds": ["1234"],
"startTime": "-1",
"reservedTo": "<<USER_ID>>"
"endTime": "1675920000000",
"description": "Test description create"
}
Success response
Code: 200 OK
The response contains the generated reservationIds
and a system timestamp of when the reservation was registered.
{
"reservationIds": [
"636"
],
"info": {
"creationTime": {
"formatted": "2023-02-09T05:00:52Z",
"millis": "1675918852598"
},
"items": "1",
"modelVersion": "2.6.0.0",
"productVersion": "master",
"time": "2023-02-09T05:00:52Z"
}
}
Error response
[
{
"userMessage":"ERROR_MESSAGE",
"developerMessage": "1-63dbebb1-4521fab52df9f41a578221c8"
}
]
where:
-
userMessage
is the error message to be shown. -
developerMessage
is a value that you can send to Perfecto Support to check errors if further investigation is required.
An error is returned in the following cases:
-
The reservation feature is disable for the tenant.
-
The reservation start time is not valid.
-
The reservation period is not valid (it must be greater than 0).
-
The reservation period is less than 15 minutes.
Sample error responses
[
{
"userMessage": "Unable to authenticate bearer token",
"developerMessage": "Unable to authenticate bearer token"
}
]
[
{
"userMessage": "Reservation is disabled. Please contact support.",
"developerMessage": "5f4fb4e9c44e424faf0280d40dbbc8f2"
}
]
[
{
"userMessage": "Reservation start time is not valid",
"developerMessage": "53b800d2a18e42839a5fbf6c0c356504"
}
]
[
{
"userMessage": "Reservation period must be greater than 0(zero).",
"developerMessage": "c43bf0add8db40c08ac7a20ca2254c60"
}
]
[
{
"userMessage": "Mandatory property 'Resource Ids' is missing",
"developerMessage": "de7b1588bfc441a680df489b1e8909da"
}
]
[
{
"userMessage": "The minimum reservation period is 15 minutes",
"developerMessage": "3fed6bb17a08412cb376a932498f69ea"
}
]