Approvers API
Table of Contents
- Overview
- Endpoints
- Get Resource Approvers
- Get User Approvers
- Create Approver
- Update Approver
- Delete Approver
Overview
An approver in QReserve is a user set to approve the reservations or requests of either a specific resource or a specific user. You can access a list of approvers for a SiteUser by viewing a SiteUser object, and you can view a list of approvers for a Resource by requesting the approvers attribute.
Endpoints
Get Resource Approvers
GET /reservables/{reservable_id}Retrieves a resource along with its approvers.
Path Parameters
| Parameter | Type | Required | Description | 
|---|---|---|---|
| reservable_id | string | Yes | ID of the resource to retrieve | 
Response
Success Response (200 OK)
{
  "reservable_id": "string",
  ...
  "approvers": [
    {
      "approver_id": "string",
      "automatic": boolean,
      "display_name": "string",
      "email": "string",
      "only_account_overage": boolean,
      "role": "string",
      "silent": boolean,
      "user_id": "string"
    },
    ...
  ],
  ...
}Get User Approvers
For retrieving a Site User including a list of their approvers or a list of objects that a particular user approves, refer to the Site Users API documentation.
Create Approver
POST /sites/{site_id}/approversCreates a new approver relationship for a resource or user.
Path Parameters
| Parameter | Type | Required | Description | 
|---|---|---|---|
| site_id | string | Yes | ID of the site | 
Request Body
Required Fields
| Field | Type | Required | Description | 
|---|---|---|---|
| approver_user_id | string | Yes | User ID of the person becoming the approver | 
| automatic | boolean | Yes | When true, approvals are automatically marked approved | 
| silent | boolean | Yes | When true, this approver will not be emailed with approval requests | 
Optional Fields (One of these is required)
| Field | Type | Required | Description | 
|---|---|---|---|
| reservable_id | string | No* | Resource to approve | 
| user_id | string | No* | User to approve | 
Important
You must include either reservable_id OR user_id, but not both.
Update Approver
POST /sites/{site_id}/approversUpdates an existing approver relationship. This endpoint is the same as the Create endpoint - if an approver is already set up for that resource or user, any updated flags will be updated as requested.
Path Parameters
| Parameter | Type | Required | Description | 
|---|---|---|---|
| site_id | string | Yes | ID of the site | 
Request Body
Same as the Create Approver endpoint.
Delete Approver
POST /sites/{site_id}/approvers/deleteDeletes an approver relationship.
Path Parameters
| Parameter | Type | Required | Description | 
|---|---|---|---|
| site_id | string | Yes | ID of the site | 
Request Body
Required Fields
| Field | Type | Required | Description | 
|---|---|---|---|
| approver_user_id | string | Yes | User ID of the person who is the approver | 
Optional Fields (One of these is required)
| Field | Type | Required | Description | 
|---|---|---|---|
| reservable_id | string | No* | Resource the approver is assigned to | 
| user_id | string | No* | User the approver is assigned to | 
Important
You must include either reservable_id OR user_id, but not both.