Webservice meant to be used with a frontend app (not included).
Documentation of end points accessible via the API.
Authentication will be via JSON web tokens (JWT).
Token can be created by providing a unique visitor.code
.
Token will expire after 6 hours
.
Token structure will be:
{
"id": 0,
"email": "",
"affiliation": "",
"name": "",
"level": "", //level code
"sessions": [] // list of session.id marked for attendance
}
Level Codes
Code | Level | Notes |
---|---|---|
V | Visitor | General Visitor |
A | Admin | Administrator - can access privileged information/actions |
Represents a conference session.
{
"id": 0,
"title": "",
"description": "",
"level": "",
"language": "",
"format": "",
"room": "",
"speakers": "",
"ratings_count": 0, //number of people who rated
"score": 75, //overall score in percentage
"reaction_summary": {
"reaction_1": [
{"reaction": "A", "count": 0}, //reaction code and count
{"reaction": "B", "count": 0}
],
"reaction_2": [
{"reaction": "A", "count": 0}, //reaction code and count
{"reaction": "B", "count": 0}
],
"reaction_3": [
{"reaction": "A", "count": 0}, //reaction code and count
{"reaction": "B", "count": 0}
]
},
"attendance": 0, //number of people expected to attend
"start_at": "2018-01-31T13:01:10.001Z",
"end_at": "2018-01-31T14:01:10.001Z",
"status": true //whether session is still on - false for cancelled
}
Level Codes
Code | Level |
---|---|
O | Introductory and overview |
I | Intermediate |
A | Advanced |
E | Expert |
V | Vendor |
Language Codes
Code | Language |
---|---|
en | English |
fr | French |
Format Codes
Code | Format |
---|---|
S | Session |
Notes
speakers
is astring
of comma separated values for multiple speakersratings_count
will be computedrating
will be computed
Represents a single feedback
{
"id": 0,
"visitor": "",
"reaction_1": "", //Reaction Code
"reaction_2": "", //Reaction Code
"reaction_3": "", //Reaction Code
"reaction_4": "",
"created_at": "2018-01-31T14:01:10.001Z"
}
Feedback Reaction Codes
Feedback | Code | Meaning |
---|---|---|
* |
L | Like |
Represents a message from server
{
"type": "", //type code
"text": ""
}
Type Codes
Code | Type |
---|---|
D | Debug |
E | Error |
S | Success |
{
"name": "", //visitor.name
"affiliation": "", //visitor.affiliation
"email": "" //visitor.email
}
Create an authentication token
Request Body
{
"code": "" //unique visitor.code
}
Response Body
{
"status": true,
"messages": [], //list of messages,
"profile": "" //profile
}
Response Codes
HTTP Code | Meaning |
---|---|
200 | Token generated |
400 | Request Body invalid |
401 | Code not found |
403 | User access denied |
Return current visitor details
Request Header
Authorization: Bearer <jwt>
Response Body
{
"status": true,
"messages": [], //list of messages,
"profile": {} //profile
}
Get list of visitors. Only admin will have access to this route
Request Header
Authorization: Bearer <jwt>
Response Body
{
"status": true,
"messages": [], //list of messages,
"visitors": {} //profile
}
Response Codes
HTTP Code | Meaning |
---|---|
200 | Status Ok |
401 | Token verification failed |
Update visitor details. Only admin will have access to this route
Request Header
Authorization: Bearer <jwt>
Request Body
{
"email": "",
"affiliation": "",
"name": ""
}
Response Codes
HTTP Code | Meaning |
---|---|
200 | Status Ok |
400 | Request Body invalid |
401 | Token verification failed |
404 | Session not found |
Response Body
{
"status": true,
"messages": [], //list of messages,
"profile": {} //profile
}
Return a list of sessions open for voting
Response Body
{
"status": true,
"messages": [], //list of messages
"sessions": [] //list of session resources
}
Response Codes
HTTP Code | Meaning |
---|---|
200 | Status Ok |
Optional query string parameters:
?status=all
: return all sessions?status=upcoming
: return all sessions that are not yet closed but not yet started?status=closed
: return all sessions that are closed
Create a new session. Accessible only to admin level
Request Header
Authorization: Bearer <jwt>
Request Body
{
"title": "",
"description": "",
"level": "",
"language": "",
"format": "",
"room": "",
"speakers": "",
"start_at": "2018-01-31T13:01:10.001Z",
"end_at": "2018-01-31T14:01:10.001Z",
"status": true //whether session is still on - false for cancelled
}
Response Codes
HTTP Code | Meaning |
---|---|
200 | Status Ok |
400 | Request Body invalid |
401 | Token verification failed |
404 | Session not found |
Response Body
{
"status": true,
"messages": [], //list of messages,
"session": {} //session
}
Update session. Accessible only to admin level
Request Header
Authorization: Bearer <jwt>
Request Body
{
"title": "",
"description": "",
"level": "",
"language": "",
"format": "",
"room": "",
"speakers": "",
"start_at": "2018-01-31T13:01:10.001Z",
"end_at": "2018-01-31T14:01:10.001Z",
"status": true //whether session is still on - false for cancelled
}
Response Codes
HTTP Code | Meaning |
---|---|
200 | Status Ok |
400 | Request Body invalid |
401 | Token verification failed |
404 | Session not found |
Response Body
{
"status": true,
"messages": [], //list of messages,
"session": {} //session
}
Create feedback for a session
Request Header
Authorization: Bearer <jwt>
Request Body
{
"reaction_1": "",
"reaction_2": "",
"reaction_3": "",
"reaction_4": "",
"created_at": "2018-01-31T14:01:10.001Z"
}
Response Body
{
"status": true,
"messages": [] //list of messages
}
Response Codes
HTTP Code | Meaning |
---|---|
200 | Feedback saved |
400 | Request Body invalid |
401 | Token verification failed |
403 | Feedback not allowed for this session |
404 | Session not found |
List feedback posted by current visitor
Request Header
Authorization: Bearer <jwt>
Response Body
{
"status": true,
"messages": [], //list of messages
"sessions": [
{
"session_id": 0,
"title": "",
"feedback": {}//feedback object
}
]
}
Response Codes
HTTP Code | Meaning |
---|---|
200 | Ok |
401 | Token verification failed |
Get a session details
Response Body
{
"status": true,
"messages": [], //list of messages
"session": {} //single session resource
}
Response Codes
HTTP Code | Meaning |
---|---|
200 | Status Ok |
404 | Session not found |
List feedback for a specific session
Response Body
{
"status": true,
"messages": [], //list of messages
"feedback": [] //list of feedback resources
}
Notes:
In each feedback resource,
visitor
may be withheld - equal tonull
; if request does not haveadmin
privileges
Response Codes
HTTP Code | Meaning |
---|---|
200 | Status Ok |
404 | Session not found |
Field | Type | Constraints |
---|---|---|
id | INT |
PRIMARY KEY Serial |
code | CHAR(6) |
UNIQUE INDEXED |
name | VARCHAR(255) |
|
affiliation | VARCHAR(255) |
|
VARCHAR(255) |
||
level | CHAR(1) |
Field | Type | Constraints |
---|---|---|
id | INT |
PRIMARY KEY Serial |
title | VARCHAR(255) |
|
description | Text |
|
level | CHAR(1) |
|
language | CHAR(2) |
|
format | CHAR(1) |
|
room | VARCHAR(255) |
|
speakers | TEXT |
|
ratings_count | INT |
|
score | INT |
|
reaction_summary | JSONB |
|
start_at | TIMESTAMP |
|
end_at | TIMESTAMP |
|
status | BOOLEAN |
Field | Type | Constraints |
---|---|---|
id | INT |
PRIMARY KEY Serial |
visitor_id | INT |
FOREIGN KEY visitor(id) |
reaction_1 | CHAR(1) |
|
reaction_2 | CHAR(1) |
|
reaction_3 | CHAR(1) |
|
reaction_4 | TEXT |
|
created_at | TIMESTAMP |
Field | Type | Constraints |
---|---|---|
id | INT |
PRIMARY KEY Serial |
session_id | INT |
FOREIGN KEY session(id) |
visitor_id | INT |
FOREIGN KEY visitor(id) |