-
Notifications
You must be signed in to change notification settings - Fork 0
Groups
GET request to https://project-run.herokuapp.com/groups/id/edit
Will return the following json format
{
"id: 1,
"name": "group name"
"admins": ["email1", "email2"],
"students": ["email3", "email4"],
"pending_invites": ["email5", "email6"]
}Creating a new Group can be done by making a POST request to https://project-run.herokuapp.com/groups with the following parameters :
{
"name": "Name of the Group"
}Making an user part of a group can be done by making a POST request to https://project-run.herokuapp.com/groups/[group_id]/add?user_id=[user_id]
Removing an user from a group can be done by making a POST request to``https://project-run.herokuapp.com/groups/[group_id]/delete?user_id=[user_id]`
If you want to list all the quizzes that are available in a certain group you can do so by making a GET request to https://project-run.herokuapp.com/groups/[group_id]/quizzes.
A sample response to that kind of request could be :
[
{
"id": 1,
"title": "My quiz 1"
},
{
"id": 7,
"title": "My quiz 2"
}
]POST request to https://project-run.herokuapp.com/groups/[group_id]/quizzes_update with the following format
{
"quizzes": [quiz_id_1, ..., quiz_id_n]
}DELETE to https://project-run.herokuapp.com/groups/[group_id]
GET request to https://project-run.herokuapp.com/groups/[group_id]/students
Sample response:
[
{
"id": 2,
"name": "m",
"email": "m@gmail.com"
}
]POST request to https://project-run.herokuapp.com/groups/[group_id]/users_update with the following parameters:
{
"users": [
"email", "email", "email"
]
}You will get an array with many hashes that have two attributes email and status which can either be added or invited_to_join if the user doesn't have an account. They will automatically join the group once they create their account
POST request to https://project-run.herokuapp.com/groups/[group_id]/add_users with the following parameters:
{
"users": [
"email", "email", "email"
]
}You will get an array with many hashes that have two attributes email and status which can either be added or invited_to_join if the user doesn't have an account. They will automatically join the group once they create their account
POST request to https://project-run.herokuapp.com/groups/search with the following parameters:
{
"input": "test"
}Sample JSON response body:
{
"best_match_name": [
{
"id": 1,
"name": "test"
}
],
"alternative_match_name": [
{
"id": 4,
"name": "test-group"
},
{
"id": 10,
"name": "testing groups"
},
{
"id": 11,
"name": "testing for /quizzes"
}
]
}