This repository was archived by the owner on Feb 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
API models schema
Jon Reeve edited this page Oct 20, 2017
·
11 revisions
Note that IDs are strings, and where there is a map (just events atm) you should avoid using strings that happen to be sequential integers starting at 0. Even though they are strings, and it's a map, it will get converted to an array using those IDs as indexes, and then cause an issue when an Android client tries to parse that as a map ("Expected a Map while deserializing, but got a class java.util.ArrayList").
The API models that are served by the Firebase RTDB must follow this schema.
{
"events" : {
"events": {
"event_0": { // Note this is a MAP not an array
"id": "event_0",
"name": "This is the event title",
"type": "[registration|talk|keynote|coffee_break|lunch|social|other]", // Optional (assume other)
"description": "A longer description. Some HTML allowed.", // Optional (assume none)
"start_time": 1234567890, // epoch millis
"end_time": 1234567891,
"day_id": "1",
"track_id": "0", // Optional, assume no track
"experience_level": "[beginner|intermediate|advanced]", // Optional, assume none
"place_id": "0", // Optional, assume no place
"speaker_ids": [
"123", "876"
], // Optional, assume no speakers
"links": {
"streaming": "http://example.com/stream/0", // Optional, assume no streaming link
"vod": "http://example.com/vod/0", // Optional, assume no VOD link
"slides": "http://example.com/decks/0" // Optional, assume no deck link
}
}
}
},
"days": {
"days": [
{
"id": "1",
"position": 0,
"date": "2017-04-20" // ISO-8601
}
]
},
"places": {
"places": [ // Must have at least one place even if you don't use them
{
"id": "0",
"floor": "Ground floor", // Optional, assume no floor
"name": "Keynote room"
}
]
},
"tracks": {
"tracks": [
{
"id": "0",
"accent_color": "#RRGGBB",
"text_color": "#RRGGBB",
"name": "Android",
"icon_url": "http://example.com/tracks/0" // Optional, assume no icon (vectors if possible)
}
]
},
"speakers": {
"speakers": [
{
"id": "123",
"name": "Rick Sanchez",
"company_name": "Gazorpazorp", // Optional, assume none
"company_url": "http://gazorpazo.rp", // Optional, assume none
"personal_url": "http://rick.sanch.ez", // Optional, assume none
"bio": "The speaker's bio. Some HTML allowed.",
"twitter_username": "@squanchy", // Optional, assume none
"photo_url": "gs://conf-app-id.appspot.com/speakers/123_Rick_Sanchez.jpg" // Optional, assume none
}
]
},
"venue": {
"name": "Centro congressi Rincotto",
"address": "123 stocazzo rd, Trollino, Italy",
"lat": 45.9680213,
"lon": 12.9463144,
"map_url": "http://squanchy.net/venue/map",
"description": "Whatever you might want to say. Accepts some HTML",
"timezone": "Europe/Rome" // Must be in a format that can be parsed by JodaTime
}
}