> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.megamation.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.megamation.com/_mcp/server.

# Get Calendar Init

GET https://api.megamation.com/CLIENT_ID/DATABASE_ID/rs_booking/CalendarInit

This will return the following:

- `building` is an array of buildings where each building have `id`, `name` and `address`.
    
- `assets` is an array with one object where the building id is key for an array of assets in that building. each of those assets willl have `id`, `name` and `address`.
    
- `category` is an array of catogries that can be used to make asset search a bit more specific. each category will have `id` and `name`.
    
- `settings` is an array of one object that has values as `startTime` which indicates the start time of the day and no time slot before that can be booked. `endTime` indicates the end time of the day and no time slot after that can be booked.

Reference: https://apidocs.megamation.com/api/room-event-scheduler-booking/get-room-event-scheduler-booking-get-calendar-init

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Response

### 200

OK

## Examples

**Response**

```json
{
  "asset": [
    {
      "001-0200": [
        {
          "address": "4100 Main St,Williamsville, NY 14221,",
          "id": "001-0200*NA*LL2",
          "name": "Language Lab 2"
        },
        {
          "address": "4100 Main St,Williamsville, NY 14221,",
          "id": "001-0200*NA*LL3",
          "name": "Language Lab 3"
        }
      ],
      "001-0700": [
        {
          "address": "4100 Main St,Williamsville, NY 14221,",
          "id": "001-0700*NA*LAB_2",
          "name": "Helton Science Lab 2"
        },
        {
          "address": "4100 Main St,Williamsville, NY 14221,",
          "id": "001-0700*NA*LAB_3",
          "name": "Helton Science Lab 3"
        }
      ],
      "001-1100": [
        {
          "address": "4800 Jack C Hays Trail, ,Buda, TX 78610, ,United States,",
          "id": "001-1100*NA*COURT_1",
          "name": "Raquetball Court 1"
        },
        {
          "address": "4800 Jack C Hays Trail, ,Buda, TX 78610, ,United States,",
          "id": "001-1100*NA*COURT_2",
          "name": "Raquetball Court 2"
        },
        {
          "address": "4800 Jack C Hays Trail, ,Buda, TX 78610, ,United States,",
          "id": "001-1100*NA*COURT_3",
          "name": "Raquetball Court 3"
        },
        {
          "address": "4800 Jack C Hays Trail, ,Buda, TX 78610, ,United States,",
          "id": "001-1100*NA*COURT_4",
          "name": "Raquetball Court 4"
        }
      ],
      "001-2200": [
        {
          "address": "4100 Main St,Williamsville, NY 14221,",
          "id": "001-2200*NA*108",
          "name": "Main Assembly"
        }
      ],
      "001-2400": [
        {
          "address": "4100 Main St,Williamsville, NY 14221,",
          "id": "001-2400*NA*107",
          "name": "Quiet Room 1"
        }
      ],
      "001-BJTHEA": [
        {
          "address": "4799 Jack C Hays Trail, ,Buda, TX 78610, ,United States",
          "id": "001-BJTHEA*NA*BJT201",
          "name": "Main Theater"
        }
      ],
      "BD11": [
        {
          "address": "Eastway Dr, ,Eugene, OR 97405, ,United States",
          "id": "BD11*NA*115",
          "name": "Conference Room 115"
        },
        {
          "address": "Eastway Dr, ,Eugene, OR 97405, ,United States",
          "id": "BD11*NA*109",
          "name": "Roger Hall Gallery "
        }
      ],
      "BL-CORE": [
        {
          "address": null,
          "id": "BL-CORE*NA*106",
          "name": "Conference Room"
        }
      ],
      "LCC-BUILDING-4": [
        {
          "address": "5 Physical Education, Eugene, ,OR 97405,,United States",
          "id": "LCC-BUILDING-4*NA*BSKT-1",
          "name": "Basketball Court 1"
        },
        {
          "address": "5 Physical Education, Eugene, ,OR 97405,,United States",
          "id": "LCC-BUILDING-4*NA*BSKT-2",
          "name": "Basketball Court 2"
        },
        {
          "address": "5 Physical Education, Eugene, ,OR 97405,,United States",
          "id": "LCC-BUILDING-4*NA*GYM1",
          "name": "Main Gym"
        },
        {
          "address": "5 Physical Education, Eugene, ,OR 97405,,United States",
          "id": "LCC-BUILDING-4*NA*COURT_A",
          "name": "Raquetball Court A"
        },
        {
          "address": "5 Physical Education, Eugene, ,OR 97405,,United States",
          "id": "LCC-BUILDING-4*NA*COURT_B",
          "name": "Raquetball Court B"
        },
        {
          "address": "5 Physical Education, Eugene, ,OR 97405,,United States",
          "id": "LCC-BUILDING-4*NA*COURT_C",
          "name": "Raquetball Court C"
        }
      ],
      "MCAMPUS": [
        {
          "address": "4000 East 30th Avenue,Eugene, OR,97405",
          "id": "MCAMPUS*NA*LCC_SF",
          "name": "Lcc Soccer Field"
        }
      ],
      "RPH*NA*MAIN": [
        {
          "address": "4000 E 30th Ave, Eugene, ,OR 97405, United States,Ragozzino Performance Hall",
          "id": "RPH*NA*MAIN",
          "name": "Performance Hall"
        }
      ]
    }
  ],
  "building": [
    {
      "address": "Eastway Dr, ,Eugene, OR 97405, ,United States",
      "id": "BD11",
      "name": "Art / Esl / Ged"
    },
    {
      "address": "4800 Jack C Hays Trail, ,Buda, TX 78610, ,United States,",
      "id": "001-1100",
      "name": "Bales Gym"
    },
    {
      "address": "4799 Jack C Hays Trail, ,Buda, TX 78610, ,United States",
      "id": "001-BJTHEA",
      "name": "Burdine Johnson Theater"
    },
    {
      "address": "4100 Main St,Williamsville, NY 14221,",
      "id": "001-2400",
      "name": "Ct Library"
    },
    {
      "address": null,
      "id": "BL-CORE",
      "name": "Core  Wing"
    },
    {
      "address": "4100 Main St,Williamsville, NY 14221,",
      "id": "001-0700",
      "name": "Helton Science"
    },
    {
      "address": "4100 Main St,Williamsville, NY 14221,",
      "id": "001-0200",
      "name": "Language Building"
    },
    {
      "address": "4000 East 30th Avenue,Eugene, OR,97405",
      "id": "MCAMPUS",
      "name": "Main Campus"
    },
    {
      "address": "5 Physical Education, Eugene, ,OR 97405,,United States",
      "id": "LCC-BUILDING-4",
      "name": "Phyiscal Education Building"
    },
    {
      "address": "4100 Main St,Williamsville, NY 14221,",
      "id": "001-2200",
      "name": "Rotc"
    },
    {
      "address": "4000 E 30th Ave, Eugene, ,OR 97405, United States,Ragozzino Performance Hall",
      "id": "RPH",
      "name": "Ragozzino Performance Hall"
    }
  ],
  "category": [
    {
      "id": "8",
      "name": "Board Room"
    },
    {
      "id": "9",
      "name": "Classroom"
    },
    {
      "id": "4",
      "name": "Conference Room"
    },
    {
      "id": "18",
      "name": "Gallery"
    },
    {
      "id": "3",
      "name": "Gymnasium"
    },
    {
      "id": "15",
      "name": "Lab"
    },
    {
      "id": "16",
      "name": "Library"
    },
    {
      "id": "17",
      "name": "Outdoor Space"
    },
    {
      "id": "5",
      "name": "Theater"
    }
  ],
  "settings": [
    {
      "endTime": "19:00",
      "startTime": "07:00",
      "timeCellStep": "60"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.megamation.com/CLIENT_ID/DATABASE_ID/rs_booking/CalendarInit"

response = requests.get(url, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://api.megamation.com/CLIENT_ID/DATABASE_ID/rs_booking/CalendarInit';
const credentials = btoa("<username>:<password>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megamation.com/CLIENT_ID/DATABASE_ID/rs_booking/CalendarInit"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.megamation.com/CLIENT_ID/DATABASE_ID/rs_booking/CalendarInit")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.megamation.com/CLIENT_ID/DATABASE_ID/rs_booking/CalendarInit")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.megamation.com/CLIENT_ID/DATABASE_ID/rs_booking/CalendarInit', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.megamation.com/CLIENT_ID/DATABASE_ID/rs_booking/CalendarInit");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megamation.com/CLIENT_ID/DATABASE_ID/rs_booking/CalendarInit")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```