This repository was archived by the owner on Jun 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
API Endpoints
Andrew Chan edited this page Dec 29, 2017
·
20 revisions
The Application Portal API exposes resources like forms, categories, and applications for logged in users and is used extensively by the frontend.
Gets the full list of forms as form objects. Each form object should also contain the list of question objects associated with it, in the correct order.
{
'forms': [
{
'id': 4,
'name': 'Consulting Spring 2018',
'created_at': '2017/12/07 17:55:48 +0000',
'archived': false,
'questions': [
{
'id': 1,
'form': 4,
'question_text': 'Check the classes you have taken:',
'question_type': 'Checkbox',
'options': "['CS61A', 'CS61B', 'CS61C']",
},
{
'id': 2,
'form': 4,
'question_text': 'Why CodeBase?',
'question_type': 'Paragraph',
'options': '',
},
],
},
{
'id': 3,
'name': 'Mentored Spring 2018',
'created_at': '2017/12/07 17:55:00 +0000',
'archived': true,
'questions': [
{
'id': 3,
'form': 3,
'question_text': 'Check the classes you have taken:',
'question_type': 'Checkbox',
'options': "['CS61A', 'CS61B', 'CS61C']",
},
{
'id': 4,
'form': 3,
'question_text': 'Why CodeBase?',
'question_type': 'Paragraph',
'options': '',
},
],
},
],
};
Gets all the categories for a particular form with the given <id>
. This consists of a list of category objects, and each category object should have an applications
attribute containing a list of application objects corresponding to the first page of the inbox for that category.
{
'form': 4,
'categories': [
{
'id': 1,
'form': 4,
'name': 'Received',
'applications': [
{
'id': 1,
'category': 1,
'email': '[email protected]',
'first_name': 'Andrew',
'last_name': 'Chan',
'read': false,
'answers': {
'1': {
'id': 1,
'application': 1,
'question': 1,
'answer_text': "['CS61A', 'CS61B']",
},
'2': {
'id': 2,
'application': 1,
'question': 2,
'answer_text': 'Because all the members are really smart and good looking',
},
},
},
{
'id': 2,
'category': 1,
'email': '[email protected]',
'first_name': 'Brian',
'last_name': 'DeLeonardis',
'read': false,
'answers': {
'3': {
'id': 3,
'application': 2,
'question': 1,
'answer_text': "['CS61A']",
},
'4': {
'id': 4,
'application': 2,
'question': 2,
'answer_text': "Because it's super cool and awesome",
},
},
},
],
},
{
'id': 2,
'form': 4,
'name': 'Accepted',
'applications': [
{
'id': 5,
'category': 2,
'email': '[email protected]',
'first_name': 'Ivon',
'last_name': 'Liu',
'read': true,
'answers': {
'9': {
'id': 9,
'application': 5,
'question': 1,
'answer_text': "['CS61A', 'CS61B']",
},
'10': {
'id': 10,
'application': 5,
'question': 2,
'answer_text': 'I do whatever the fuck I want',
},
},
},
],
},
{
'id': 3,
'form': 4,
'name': 'Rejected',
'applications': [
{
'id': 6,
'category': 3,
'email': '[email protected]',
'first_name': 'Kunal',
'last_name': 'Kak',
'read': true,
'answers': {
'11': {
'id': 11,
'application': 6,
'question': 1,
'answer_text': "['CS61B']",
},
'12': {
'id': 12,
'application': 6,
'question': 2,
'answer_text': 'Poopy butthole',
},
},
},
],
},
],
};