Update Reservation

Restriction: This API endpoint is not supported in the Free Trial cloud.

Updates a specific device reservation. The reservation is indicated by the reservationID provided when the reservation was created.

URL

Copy
https://<YOUR_CLOUD>.app.perfectomobile.com/api/v1/device-reservation/reservations/<reservationId>

Method

Put

For information on a previous version of this endpoint, see Update Reservation | Legacy.

Header parameters

Name

Description

Perfecto-Authorization

The Perfecto security token. For more information, see Generate security tokens.

Request parameters

Name

Type

Default

Description

admin

boolean

false

Set to true to allow users with administrative credentials to get reservation info for users in their group.

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

startTime

long

The reservation start time, measured in milliseconds, from midnight, January 1, 1970 UTC.*

endTime

long

The reservation end time, measured in milliseconds, from midnight, January 1, 1970 UTC.*

reservedTo 

string

The user the device is reserved to. 

description 

string

The reservation description (free text). 

* Use this Timestamp converter to create the required time stamp for the new startTime and endTime values.

Copy
Sample request body
{
    "startTime": "<<TIME_STAMP>>",
    "endTime": "<<TIME_STAMP>>",
    "description": "<<DESCRIPTION_IF_ANY>>",
    "reservedTo": "<<USER_ID>>"
}

Success response

Code: 200 OK

Copy
Success response format
{
    "status": "Success"
}

Error response

Copy
Error response format
[
    {
        "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 is not found.

  • The reservation feature is disable for the tenant.

  • The reservation period is less than 15 minutes.

Sample error responses

Copy
A wrong securityToken is passed in the request (Unauthorized Request Code - 401)
[
    {
        "userMessage": "Unable to authenticate bearer token",
        "developerMessage": "Unable to authenticate bearer token"
    }
]
Copy
The reservation is not found (Bad Request Code - 400)
[
    {
        "userMessage": "Reservation not found",
        "developerMessage": "d6775ff7760d414583f755fd74f046bd"
    }
]
Copy
The reservation is disabled for the tenant (Forbidden Request Code - 403)
[
    {
        "userMessage": "Reservation is disabled. Please contact support.",
        "developerMessage": "5f4fb4e9c44e424faf0280d40dbbc8f2"
    }
]
Copy
The reservation period is less than 15 minutes
[
    {
        "userMessage": "The minimum reservation period is 15 minutes",
        "developerMessage": "3fed6bb17a08412cb376a932498f69ea"
    }
]