NAV
shell ruby python csharp php

Room

The Room object

The Room object looks like this in JSON:

{
    "object": "room",
    "id": 1,
    "building_id": 3,
    "name": "Administrative Offices",
    "floor": "1",
    "capacity": null,
    "default_room_plan_id": null,
    "retired_at": null,
    "retired_by_id": null,
    "added_at": null,
    "added_by_id": null,
    "sandbox": true
}
Attribute Required Data Type
id Yes int
building_id Yes int
name Yes text (255)
floor Yes int
capacity Yes int
default_room_plan_id No int
retired_at No datetime
retired_by_id No int
added_at No datetime
added_by_id No int
sandbox No bool

index

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/rooms" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/rooms',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/rooms',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/rooms"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/rooms');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "list",
    "count": 6,
    "results": 6,
    "results_per_page": null,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "room",
            "id": 1,
            "building_id": 3,
            "name": "Administrative Offices",
            "floor": "1",
            "capacity": null,
            "default_room_plan_id": null,
            "retired_at": null,
            "retired_by_id": null,
            "added_at": null,
            "added_by_id": null
        }
    ],
    "sandbox": true
}

Retrieves all Room objects.

HTTP Request

GET /rooms

Parameters

None

Permissions

One of the following roles is required to call this method:

index (campus life)

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/campuslife/rooms" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
-d '{
    "academic_term_id": 8,
    "filter": {"0":{"logic":"ALL","fields":[{"name":"room_plan","value":1,"positive":1}]}}
}' \ 
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/campuslife/rooms',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
 body: {
  :academic_term_id => 8
 }.to_json
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/campuslife/rooms',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
 json={
  'academic_term_id': 8
 }
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/campuslife/rooms"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
request.AddJsonBody(new {
  academic_term_id = 8
});
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/campuslife/rooms');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode([
  'academic_term_id' => 8
]));
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "list",
    "count": 2,
    "results": 2,
    "results_per_page": 200,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "room",
            "id": 2,
            "building_id": 1,
            "name": "Anselm House Anselm",
            "floor": "B0",
            "capacity": null,
            "default_room_plan_id": null,
            "retired_at": null,
            "retired_by_id": null,
            "added_at": null,
            "added_by_id": null,
            "report_data": {
                "building_name": "Anselm House Annex",
                "capacity_used": "0",
                "available": "0",
                "room_plan_name": null,
                "occupants": null,
                "row_id": 2
            }
        }
    ],
    "sandbox": true
}

Retrieves all Room objects that match given filter conditions.

HTTP Request

GET /campuslife/rooms

Parameters

Name Required Data Type Description
academic_term_id Yes int
filter No mixed See available filter conditions
page No int The page of results to return if more than 200 records are found.

Filter Condition Parameters

These conditions can be used to narrow the results returned.

Name Type
room_plan object id
building object id
room text
capacity integer
used integer
available integer
occupants text

Permissions

One of the following roles is required to call this method:

show

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/rooms/(room)" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/rooms/(room)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/rooms/(room)',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/rooms/(room)"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/rooms/(room)');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "room",
    "id": 1,
    "building_id": 3,
    "name": "Administrative Offices",
    "floor": "1",
    "capacity": null,
    "default_room_plan_id": null,
    "retired_at": null,
    "retired_by_id": null,
    "added_at": null,
    "added_by_id": null,
    "sandbox": true
}

Retrieves a specific Room object.

HTTP Request

GET /rooms/(room)

Parameters

No additional parameters are needed beyond the ID of the object being requested that appears in the URL.

Permissions

One of the following roles is required to call this method:

schedule

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/rooms/schedule" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
-d '{
    "start": "2022-08-01"
}' \ 
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/rooms/schedule',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/rooms/schedule',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/rooms/schedule"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/rooms/schedule');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "list",
    "count": 0,
    "results": 0,
    "results_per_page": null,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": []
}

This method returns a week's worth of room schedule data, equivalent to the Campus Life -> Facilities Schedule.

HTTP Request

GET /rooms/schedule

Parameters

Name Required Data Type Description
start No date The date of the Monday of the week you want the room schedules for. Defaults to the Monday of the current week.
campus_id No int
building_id No int
room_id No int

Permissions

One of the following roles is required to call this method: