The check in system for UB ACM events.
Allows a user to check into an event.
api_key: String,
slack_id: String
{
check_in_code: String,
username: String
}
- Success: Response Code 200
- Failure - Bad API Key: Response Code 401
- Failure - Wrong Check In Code: Response Code 403
- Failure - Slack ID Not Found: Response Code 404
{
message: String
}
Shows all events.
api_key: String,
slack_id: String
{
check_in_code: String
}
- Success: Response Code 200
{
"events": [
{
"_id": String,
"active": Boolean,
"attendees": [
String,
...
],
"check_in_code": String,
"deleted": Boolean,
"description": String,
"name": String,
"slack_id": String,
"timestamp": String,
"weight": Integer
},
...
}
- Failure - Missing Fields: Response Code 400
- Failure - Bad API Key: Response Code 401
- Failure - Not an Admin in Slack team: Response Code 401
- Failure - Wrong Check In Code: Response Code 403
- Failure - Slack ID Not Found: Response Code 404
{
message: String
}
Shows all active events.
api_key: String,
slack_id: String
{
check_in_code: String
}
- Success: Response Code 200
{
"events": [
{
"_id": String,
"active": Boolean,
"attendees": [
String,
...
],
"check_in_code": String,
"deleted": Boolean,
"description": String,
"name": String,
"slack_id": String,
"timestamp": String,
"weight": Integer
},
...
}
- Failure - Missing Fields: Response Code 400
- Failure - Bad API Key: Response Code 401
- Failure - Not an Admin in Slack team: Response Code 401
- Failure - Wrong Check In Code: Response Code 403
- Failure - Slack ID Not Found: Response Code 404
{
message: String
}
Creates a new event.
api_key: String,
slack_id: String
{
name: String,
description: String,
timestamp: Long, // Optional, Default: Now
weight: Float, // Optional, Default: 1.0
}
- Success: Response Code 200
{
event_id: Integer,
check_in_code: String
}
- Failure - Missing Fields: Response Code 400
- Failure - Bad API Key: Response Code 401
- Failure - Not an Admin in Slack team: Response Code 401
- Failure - Wrong Check In Code: Response Code 403
- Failure - Slack ID Not Found: Response Code 404
{
message: String
}
Closes an event provided with an ID.
api_key: String,
slack_id: String
{
check_in_code: String
}
- Success: Response Code 200
- Failure - Missing Fields: Response Code 400
- Failure - Bad API Key: Response Code 401
- Failure - Not an Admin in Slack team: Response Code 401
- Failure - Wrong Check In Code: Response Code 403
- Failure - Slack ID Not Found: Response Code 404
{
message: String
}
Reopens a previously closed event provided with an ID.
api_key: String,
slack_id: String
{
check_in_code: String
}
- Success: Response Code 200
- Failure - Missing Fields: Response Code 400
- Failure - Bad API Key: Response Code 401
- Failure - Not an Admin in Slack team: Response Code 401
- Failure - Wrong Check In Code: Response Code 403
- Failure - Slack ID Not Found: Response Code 404
{
message: String
}
Soft-deletes an event from the database. All check-ins for this event is invalid.
api_key: String,
slack_id: String
{
check_in_code: String
}
- Success: Response Code 200
- Failure - Missing Fields: Response Code 400
- Failure - Bad API Key: Response Code 401
- Failure - Not an Admin in Slack team: Response Code 401
- Failure - Wrong Check In Code: Response Code 403
- Failure - Slack ID Not Found: Response Code 404
{
message: String
}
Restores a previously deleted event provided with an ID.
api_key: String,
slack_id: String
{
check_in_code: String
}
- Success: Response Code 200
- Failure - Missing Fields: Response Code 400
- Failure - Bad API Key: Response Code 401
- Failure - Not an Admin in Slack team: Response Code 401
- Failure - Wrong Check In Code: Response Code 403
- Failure - Slack ID Not Found: Response Code 404
{
message: String
}
Gets all of the users and their scores (in descending order).
Just a basic GET
request will do.
{
[
{
'username': String,
'slack_id': String,
'events': [String, String, ...],
'score': Integer
},
...
]
}
Add the score passed in to the users current score. So to add pass a positive number and to subtract, send a negative number. The slack_id
in the header is the admin id and the slack_id
in the body is for the user that will be updated.
api_key: String,
slack_id: String
{
score: Float,
slack_id: String
}
- Success: Response Code 200
- Failure - Missing Fields: Response Code 400
- Failure - Bad API Key: Response Code 401
- Failure - Not an Admin in Slack team: Response Code 401
- Failure - Wrong Check In Code: Response Code 403
- Failure - Slack ID Not Found: Response Code 404
{
message: String
}
Get details of an event including a list of all the attendees.
Just a basic GET
request to this route with the check in code for
the event as a parameter.
- Success: Response Code 200
{
event: {
active: Boolean,
check_in_code: String,
deleted: Boolean,
name: String,
slack_id: String,
timestamp: String,
weight: Integer
},
attendees: [String, String, ...],
count: Integer
}
- Failure - Wrong Check In Code: Response Code 403
{
message: String
}