Skip to content
tlanclos edited this page Nov 15, 2015 · 8 revisions

Available URIs and workflow

These workflows are a rough description of what will be implemented. In a couple of days to a week or so, we will decide on the parameters that must be passed into each URI and post them to this wiki. The methods used should remain the same (GET/POST).

In addition to the response codes in each of the workflows below, there are two additional codes that may be returned.

  • If there is an uncaught server exception, the API may return a "500 Internal Server Error" code. This will never contain a failure response object.
  • If there is a caught (handled) server exception, the API may return a "520 Unknown Error" code. This should contain a failure response object.

As stated in [Response Data](Response Data), failure responses may return a failure response JSON object, but not always. This is important to keep in mind when handling errors.


Authentication

URI: /login
Method: POST

Description: This method will allow an application to login to the web server. The post request will take in authentication credentials and will authorize the application against these.

Workflow:

  • The application send user credentials to the web server
  • The web server validates the credentials against what the database holds
  • The web server create a session id (UUID) and stores it in the database
  • The web server replies to the application with a "200 OK" HTTP response and a session id

Alternate workflows:

  • The received data is malformed or invalid
    • The received data is rejected
    • The web server replies with a “400 Bad Request” HTTP Response
  • The login information is invalid
    • A session id is not created
    • The web server replies with a “401 Unauthorized” HTTP Response

Employee Information Storage

URI: /update-employee
Method: POST

Description: This method will allow the application to update an employee's information such as: employee name, phone number, and email address.

Workflow:

  • The application sends a request to update the user information
  • The web server finds the session id in the database and update’s its information
  • The web server replies with a “200 OK” HTTP response

Alternate Workflow:

  • The received data is malformed or invalid
    • The received data is rejected
    • The web server replies with a “400 Bad Request” HTTP Response
  • The request was sent by an unauthorized application (session id not found)
    • The received data is rejected
    • The web server replies with a “401 Unauthorized” HTTP Response

Ticket Submission

URI: /submit-ticket
Method: POST

Description: This method will allow a ticket to be submitted and posted to the database as a new ticket. Each ticket will contain various information such as description of the issue and a picture of the issue they are having trouble with.

Workflow:

  • The application submits a request to post a ticket
  • The web server validates the ticket data (e.g. ensure base64, PNG, resolution is low enough, size of picture in MB is low enough, and description exists)
  • The ticket data is committed to the database
  • The web server replies with a “200 OK” HTTP response

Alternate Workflow:

  • The received data is malformed or invalid
    • The received data is rejected
    • The web server replies with a “400 Bad Request” HTTP Response
  • The request was sent by an unauthorized application
    • The received data is rejected
    • The web server replies with a “401 Unauthorized” HTTP Response

Clone this wiki locally