Pollo
Documentation for Pollo
Last updated
Documentation for Pollo
Last updated
GET
http://pollo-backend.cornellappdev.com/api/v2/generate/code/
Name | Type | Description |
---|---|---|
If options
are empty, assume free response question.
GET
http://pollo-backend.cornellappdev.com/api/v2/drafts/
POST
http://pollo-backend.cornellappdev.com/api/v2/drafts/
PUT
http://pollo-backend.cornellappdev.com/api/v2/drafts/:id
DELETE
http://pollo-backend.cornellappdev.com/api/v2/drafts/:id
Previously known as Session.
POST
http://pollo-backend.cornellappdev.com/api/v2/sessions/
GET
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id
GET
http://pollo-backend.cornellappdev.com/api/v2/sessions/all/:role
Each of the Group nodes has an extra field called updatedAt
indicating the latest activity in Unix time & field called isLive
indicating whether the group is live or not.
PUT
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/
DELETE
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/
DELETE
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/members/
GET
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/members/
GET
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/admins/
POST
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/members/
DELETE
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/members/
POST
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/admins/
PUT
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/admins/
Answer
is the user’s answer for that specific question. null
if the user is the admin of the question. For multiple choice, answer is the choice. For free response, answer is an array of answer ids.
correctAnswer
is the correct answer choice for multiple choice (ex. correctAnswer: 'A'
). Empty string if no correct answer selected for multiple choice or the question is free response.
POST
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/polls/
GET
http://pollo-backend.cornellappdev.com/api/v2/polls/:id/
GET
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/polls/
Admin user will receive all polls
Member user will receive all polls but with poll results hidden (set to {}
) if poll is unshared
PUT
http://pollo-backend.cornellappdev.com/api/v2/polls/:id/
DELETE
http://pollo-backend.cornellappdev.com/api/v2/polls/:id/
POST
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/questions/
GET
http://pollo-backend.cornellappdev.com/api/v2/questions/:id/
GET
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/questions/
GET
http://pollo-backend.cornellappdev.com/api/v2/sessions/:id/questions/date/
PUT
http://pollo-backend.cornellappdev.com/api/v2/questions/:id/
DELETE
http://pollo-backend.cornellappdev.com/api/v2/questions/:id/
GET
http://pollo-backend.cornellappdev.com/api/v2/users/
If invalid accessToken
is passed into request header, 401 error
is thrown.
POST
http://pollo-backend.cornellappdev.com/api/v2/auth/mobile
POST
http://pollo-backend.cornellappdev.com/api/v2/auth/refresh/
Built with Socket.io. Documentation found here.
Connect (default socket) Make sure to visit /join/session/
before joining a socket because this will create the socket if not created yet. You will need to emit userType
on connect to socket.
Disconnect (default socket)
These objects are not saved outside of a socket.
Example of results. Note: answers is a mapping of googleID to selected option.
For MC: choice
should be C
and text should be Saturn
.
For FR: choice
and text
should be Saturn
.
options
is the text of the choices. If the choices are
where D
is a blank option, the choices would be:
Poll
is saved into the database after admin ends poll.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Authentication
string
'Bearer ' + accessToken
Authentication
string
'Bearer ' + accessToken
text
string
options
array
string[]
Authentication
string
'Bearer ' + accessToken
id
string
text
string
options
array
string[]
Authentication
string
'Bearer ' + accessToken
id
string
Authentication
string
'Bearer ' + accessToken
name
string
code
string
Authentication
string
'Bearer ' + accessToken
id
string
Authentication
string
'Bearer ' + accessToken
role
string
If role is member
, this will return all groups you are in. If role is admin
, this will return all groups you are an admin of.
Authorization
string
'Bearer ' + accessToken
id
string
name
string
Authorization
string
'Bearer ' + accessToken
id
string
Authorization
string
'Bearer ' + accessToken
id
string
Authorization
string
'Bearer ' + accessToken
id
string
Authorization
string
'Bearer ' + accessToken
id
string
Authorization
string
'Bearer ' + accessToken
id
string
memberIDs
array
int[]
Authorization
string
'Bearer ' + accessToken
id
string
memberIDs
array
int[]
Authorization
string
'Bearer ' + accessToken
id
string
adminIDs
array
int[]
Authorization
string
'Bearer ' + accessToken
id
string
adminIDs
array
int[]
Authorization
string
'Bearer ' + accessToken
id
string
Authorization
string
'Bearer ' + accessToken
type
string
text
string
results
object
json
shared
boolean
id
string
Authorization
string
'Bearer ' + accessToken
id
string
Authorization
string
'Bearer ' + accessToken
id
string
Authorization
string
'Bearer ' + accessToken
text
string
results
string
shared
boolean
id
string
Authorization
string
'Bearer ' + accessToken
id
string
group id
Authorization
string
'Bearer ' + accessToken
text
string
id
string
question id
Authorization
string
'Bearer ' + accessToken
id
string
group id
Authorization
string
'Bearer ' + accessToken
id
string
group id
Authorization
string
'Bearer ' + accessToken
id
string
question id
Authorization
string
'Bearer ' + accessToken
text
string
id
string
question id
Authorization
string
'Bearer ' + accessToken
Authorization
string
'Bearer ' + accessToken
idToken
string
Authorization
string
'Bearer ' + refreshToken
Method
Body
URL
Response
Description
POST
code: string
and name?: string
/start/session/
Group
- The group that was created, use id
as a namespace
User sends to start a group
POST
id: number
or code: string
/join/session/
Group
User sends to join a group
Message
Body
Description
server/poll/start
Poll
object without id
Admin sends to start a poll
server/poll/end
empty
Admin sends to stop a poll
server/poll/results
empty
Admin sends to share results
server/poll/tally
Answer
object without id
User sends to reveal their chosen response to the server
server/poll/upvote
{ answerID,
googleID }
User sends to upvote an answer
server/poll/delete
pollID
*same as db ID
Admin sends to delete saved poll
server/poll/deleteLive
empty
Admin sends to delete live poll
Message
Body
Description
user/poll/start
{ poll: Poll
object }
User receives to display a poll
user/poll/end
{ poll: Poll
object }
User receives when poll has ended
user/poll/results/
CurrentState
object
User receives when if admin decides to share results
user/poll/results/live
CurrentState
object
User receives when there is a live FR question when user first joins socket
user/count
{ count: user count
}
User receives number of live users in socket
user/poll/delete
pollID
*same as db ID
User receives when poll is deleted
user/poll/deleteLive
empty
User receives when live poll is deleted
user/answer/success
empty
User receives when FR answer is successfully registered (pass filter)
user/answer/filter
{ text: string
, filter: string array
}
User receives when FR answer is not registered (doesn't pass filter)
Message
Body
Description
admin/poll/start
{ poll: Poll
object }
Admin receives current poll upon entry (if there is one)
admin/poll/updateTally
CurrentState
object
Admin receives state of poll i.e. tallies
admin/poll/ended
{ poll: Poll
object }
Admin receives when poll has been ended
user/count
{ count: user count
}
User receives number of live users in socket