Get Reservation Information

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

Gets the reservation information by reservation id.

The reservedTo and reservedBy values in the response are only included for reservation administrator users with the admin parameter set to true. Non-administrator users will get these values only for themselves.

URL

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

Method

GET

For information on a previous version of this endpoint, see Get Reservation Info | 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 administrator credentials to get reservation info for users in their group.

Success response

Code: 200 OK

The standard ISO format used in the response is : [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss]

Copy
Success response
{
    "info": {
        "creationTime": {
            "formatted": "2023-02-02T14:00:38Z",
            "millis": "1675346438889"
        },
        "modelVersion": "2.6.0.0",
        "productVersion": "master",
        "time": "2023-02-02T14:00:38Z"
    },
    "reservation": {
        "id": "621",
        "resourceId": "F52F82C456B564D2575A4C83B5AD3870575FEE45",
        "reservedTo": "<<USER_ID>>",
        "startTime": {
            "formatted": "2023-02-02T10:40:56Z",
            "millis": "1675334456925"
        },
        "endTime": {
            "formatted": "2023-02-02T11:00:00Z",
            "millis": "1675335600000"
        },
        "reservedBy": "<<USER_ID>>",
        "status": "ENDED",
        "description": "Test reservation",
        "created": {
            "formatted": "2023-02-02T10:40:55Z",
            "millis": "1675334455928"
        },
        "lastModified": {
            "formatted": "1970-01-01T00:00:00Z",
            "millis": "0"
        }
    }
}

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 disabled for the tenant.

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"
    }
]