Join Me Backend
HTTP://http://joinme.us-east-2.elasticbeanstalk.com/rest
Restful API for Join Me
Version v1
APIs
## /invitations
### <a name="list"></a>GET
Gets all invitations.
Retrieves all invitations from/to all people.
Request
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Array[Invitation] |
<a name=""></a>
## /invitations/{invitationId}
### <a name="getSingleInvitation"></a>GET
Gets an invitation.
Retrieves the invitation for the given invitationId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
invitationId | path | yes | Id for the invitation. | integer (int64) |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Invitation |
<a name=""></a>
## /people
### <a name="list"></a>GET
Gets all Person objects.
Retrieves all people.
Request
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Array[Person] |
### <a name="post"></a>POST
Adds person.
Adds person to database.
Request
Content-Type: application/json
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
body | body | yes | Partial person object. | Person |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Person |
<a name=""></a>
## /people/{personId}
### <a name="get"></a>GET
Gets a person.
Retrieves a person according to personId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
personId | path | yes | Id for the person. | integer (int64) |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Person |
### <a name="updatePerson"></a>PUT
Updates a person.
Updates a person according to personId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
body | body | yes | Person object. | Person | |
personId | path | yes | Id for the person. | integer (int64) |
Response
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Person |
### <a name="deletePerson"></a>DELETE
Deletes a person.
Deletes a person according to personId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
personId | path | yes | Id for the person. | integer (int64) |
Response
Status Code | Reason | Response Model |
---|---|---|
default | successful operation | - |
<a name=""></a>
## /people/{personId}/invitations
### <a name="getAllInvitationsPerPerson"></a>GET
Gets all new invitations for a person.
Retrieves all new invitation for a person according to personId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
personId | path | yes | Id for the person. | integer (int64) |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Array[Invitation] |
### <a name="addInvitation"></a>POST
Adds an invitation to a person.
Adds an invitation to a person according to personId.
Request
Content-Type: application/json
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
personId | path | yes | Id for the person. | integer (int64) | |
body | body | yes | Invitation object. | Invitation |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Invitation |
<a name=""></a>
## /people/{personId}/invitations/{invitationId}
### <a name="getInvitationPerPerson"></a>GET
Gets a single invitation.
Retrieves a single invitation associated with a person, according to personId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
invitationId | path | yes | Id for the invitation. | integer (int64) |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Invitation |
### <a name="updateInvitation"></a>PUT
Updates an invitation.
Updates a single person's id, based on personId and invitationId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
invitationId | path | yes | Id for the invitation. | integer (int64) |
Response
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Invitation |
<a name=""></a>
## /people/{personId}/people
### <a name="getPeopleNearby"></a>PUT
Updates a person's location and gets the people near them.
Causes a person's location to be updated and retrieves a list of all the people that are near the new location.
Request
Content-Type: application/json
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
body | body | yes | Person object. | Person | |
personId | path | yes | Id for the person. | integer (int64) |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Array[Person] |
<a name=""></a>
## /squares
### <a name="list"></a>GET
Gets all squares.
Retrieves all squares in the database.
Request
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Array[Square] |
### <a name="post"></a>POST
Initializes squares.
Causes pre-set squares to be added to the database. After a database wipe, this must be the first thing added to a new database.
Request
Content-Type: application/json
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Array[Square] |
<a name=""></a>
## /squares/{squareId}
### <a name="get"></a>GET
Gets a square.
Retrieves a square according to squareId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
squareId | path | yes | Id for the square. | integer (int64) |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Square |
### <a name="delete"></a>DELETE
Deletes a square.
Deletes a square according to squareId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
squareId | path | yes | Id for the square. | integer (int64) |
Response
Status Code | Reason | Response Model |
---|---|---|
204 | - |
<a name=""></a>
## /squares/{squareId}/vertices
### <a name="vertexList"></a>GET
Gets vertices associated with a square.
Retrieves the vertices associated with a squareId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
squareId | path | yes | Id for the square. | integer (int64) |
Response
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Array[Vertex] |
### <a name="postVertex"></a>POST
Adds square to vertex.
Adds the square, by squareId, to the passed vertex.
Request
Content-Type: application/json
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
squareId | path | yes | Id for the square. | integer (int64) | |
body | body | yes | Vertex object. | Vertex |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Square |
<a name=""></a>
## /squares/{squareId}/vertices/{vertexId}
### <a name="deleteVertex"></a>DELETE
Removes a vertex from a square.
Deletes a vertex from a square, according to vertexId and squareId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
squareId | path | yes | Id for the square. | integer (int64) | |
vertexId | path | yes | Id for the vertex. | integer (int64) |
Response
Status Code | Reason | Response Model |
---|---|---|
204 | - |
<a name=""></a>
## /vertices
### <a name="list"></a>GET
Gets all vertices.
Retrieves all vertices in the database.
Request
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Array[Vertex] |
### <a name="post"></a>POST
Initializes vertices in a new database.
Initializes vertices in a new database. This is the second operation that must be performed after wiping a database. Squares should always be initialized first, and people and invitations should not be added until both squares and vertices are already present (in that order).
Request
Content-Type: application/json
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Vertex |
<a name=""></a>
## /vertices/{vertexId}
### <a name="getHTML"></a>GET
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
vertexId | path | yes | integer (int64) |
Response
Content-Type: text/html
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation |
### <a name="delete"></a>DELETE
Deletes a vertex.
Deletes a vertex, according to vertexId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
vertexId | path | yes | integer (int64) |
Response
Status Code | Reason | Response Model |
---|---|---|
204 | - |
<a name=""></a>
## /vertices/{vertexId}/squares
### <a name="squareList"></a>GET
Gets the squares associated with a vertex.
Gets the squares associated with a vertex, according to vertexId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
vertexId | path | yes | integer (int64) |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Array[Square] |
### <a name="postSquare"></a>POST
Adds squares to a vertex.
Adds squares to a vertex, according to vertexId.
Request
Content-Type: application/json
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
vertexId | path | yes | integer (int64) | ||
body | body | no | Vertex |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | successful operation | Square |
<a name=""></a>
## /vertices/{vertexId}/squares/{squareId}
### <a name="deleteSquare"></a>DELETE
Deletes a square from a vertex.
Deletes a square from a vertex, according to squareId and vertexId.
Request
##### Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
vertexId | path | yes | integer (int64) | ||
squareId | path | yes | integer (int64) |
Response
Status Code | Reason | Response Model |
---|---|---|
204 | - |
<a name=""></a>
Definitions
## Invitation
Name | Type | Mode | Description |
---|---|---|---|
id | integer (int64) | required | invitation_id |
userSenderId | integer (int64) | required | user_sender_id |
userReceiverId | integer (int64) | required | user_receiver_id |
wasDelivered | boolean | required | was_delivered |
willAttend | boolean | required | will_attend |
degreesRemaining | integer (int32) | optional | degrees_remaining |
date | string | required | date |
description | string | required | description |
title | string | required | title |
location | string | required | location |
people | array[Person] | optional | - |
href | string (uri) | optional | - |
## Person
Name | Type | Mode | Description |
---|---|---|---|
personId | integer (int64) | required | person_id |
closestVertex | Vertex | optional | - |
invitations | array[Invitation] | optional | - |
latitude | number (double) | required | latitude |
longitude | number (double) | required | longitude |
currentSquare | Square | optional | - |
displayName | string | required | display_name |
userImageLocation | string | required | user_image_location |
userDescription | string | required | user_description |
googleUserId | string | required | google_id |
href | string (uri) | optional | - |
## Square
Name | Type | Mode | Description |
---|---|---|---|
id | integer (int64) | required | square_id |
latitudeLowerBound | number (double) | optional | - |
latitudeUpperBound | number (double) | optional | - |
longitudeLowerBound | number (double) | optional | - |
longitudeUpperBound | number (double) | optional | - |
people | array[Person] | optional | - |
vertices | array[Vertex] | optional | - |
href | string (uri) | optional | - |
## Vertex
Name | Type | Mode | Description |
---|---|---|---|
id | integer (int64) | required | vertex_id |
latitude | number (double) | required | latitude |
longitude | number (double) | required | longitude |
squares | array[Square] | optional | - |
href | string (uri) | optional | - |