Skip to content

Organizations

Alex Crowley edited this page Feb 15, 2017 · 2 revisions

Organizations are entities that can recruit and browse Students. They have the ability to make a preference list of who they would like to interview.

API Overview

The following routes are supported for performing operations on the Organization entity.

CreateOrganization POST /organization
GetOrganizationStudents GET /organization/students
GetCurrentOrganization GET /organization/current
AddStudent POST organization/addStudent
RemoveStudent POST /organization/removeStudent
SwitchStudents POST /organization/switchStudents

JSON Representation:

Organization Structure:

name string Name of Organization
studentIds List of(int64) List of Students the Organization is interested in recruiting. Order pertains to preference.

API Reference

Note: to run in Postman, just take the information contained in the quotes of --data and paste in the body field.

CreateOrganization

Adds Companies to the database

URL Structure:

xtern-matching.appspot.com/organization

Example Request:

curl -X POST xtern-matching.appspot.com/organization \
--data '[{"name": "Test Company"}]'

Returns

None

Errors

Internal Server Error 500:

Invalid Organization JSON formatting
Invalid structure for Datastore


GetOrganizationStudents

Gets the Students in the wishlist for a particular organization

URL Structure:

xtern-matching.appspot.com/organization/students

Example Request:

curl -X GET xtern-matching.appspot.com/organization/
--data '{"org" : 5066549580791808}'

Returns

{"keys" : List of(int64 ), "students" : List of(Student)}

Errors

Bad Request 400:

Missing or Invalid Id in request

Internal Server Error 500:

Datastore ErrFieldMismatch if types do not agree of if data structure models differ


GetCurrentOrganization

Gets the current Organization in according to Organization login credentials

URL Structure:

xtern-matching.appspot.com/organization/current

Example Request:

curl -X GET xtern-matching.appspot.com/organization/current

Returns

Organization JSON Representation

Errors

Internal Server Error 500:

Missing Id in request
Datastore ErrFieldMismatch if types do not agree of if data structure models differ


AddStudent

Adds a student to a given Organization

URL Structure:

xtern-matching.appspot.com/organization/addStudent

Example Request:

curl xtern-matching.appspot.com/organization/addStudent \
--data '{"studentId": 5733953138851840}'

Returns

None

Errors

Internal Server Error 500:

Error decoding body into map Datastore ErrFieldMismatch if types do not agree of if data structure models differ

RemoveStudent

Removes a Student from a given Organization

URL Structure:

xtern-matching.appspot.com/organization/removeStudent

Example Request:

curl xtern-matching.appspot.com/organization/removeStudent \
--data '{"studentId": 5733953138851840}'

Returns

None

Errors

Internal Server Error 500:

Error decoding body into map
Datastore ErrFieldMismatch if types do not agree of if data structure models differ


SwitchStudents

Switches two students in a preference list in a given Organization

URL Structure:

xtern-matching.appspot.com/organization/switchStudents

Example Request:

curl xtern-matching.appspot.com/organization/switchStudents \
--data '{"student1Id": 5733953138851840, "student2Id": 5733953138851841}'

Returns

None

Errors

Internal Server Error 500:

Error decoding body into map Datastore ErrFieldMismatch if types do not agree of if data structure models differ