NAV
shell ruby python csharp php

Building

The Building object

The Building object looks like this in JSON:

{
    "object": "building",
    "id": 1,
    "campus_id": 8,
    "name": "Anselm House Annex",
    "street": "20500 East Fifth Street",
    "city": "Moscow",
    "state": "ID",
    "postal": "83843",
    "country": "US",
    "floors": 2,
    "basement_floors": 1,
    "retired_at": null,
    "retired_by_id": null,
    "added_at": null,
    "added_by_id": null,
    "sandbox": true
}
Attribute Required Data Type
id Yes int
campus_id Yes int
name Yes text (255)
street Yes text (255)
city Yes text (255)
state Yes text (50)
postal Yes text (50)
country Yes text (50)
floors Yes int
basement_floors 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/buildings" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/buildings',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/buildings',
 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/buildings"), 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/buildings');
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": 1,
    "results": 1,
    "results_per_page": null,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "building",
            "id": 1,
            "campus_id": 8,
            "name": "Anselm House Annex",
            "street": "20500 East Fifth Street",
            "city": "Moscow",
            "state": "ID",
            "postal": "83843",
            "country": "US",
            "floors": 2,
            "basement_floors": 1,
            "retired_at": null,
            "retired_by_id": null,
            "added_at": null,
            "added_by_id": null
        }
    ],
    "sandbox": true
}

Retrieves all Building objects.

HTTP Request

GET /buildings

Parameters

None

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/buildings/(building)" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/buildings/(building)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/buildings/(building)',
 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/buildings/(building)"), 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/buildings/(building)');
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": "building",
    "id": 1,
    "campus_id": 8,
    "name": "Anselm House Annex",
    "street": "20500 East Fifth Street",
    "city": "Moscow",
    "state": "ID",
    "postal": "83843",
    "country": "US",
    "floors": 2,
    "basement_floors": 1,
    "retired_at": null,
    "retired_by_id": null,
    "added_at": null,
    "added_by_id": null,
    "sandbox": true
}

Retrieves a specific Building object.

HTTP Request

GET /buildings/(building)

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: