Back to top

PRAMS API

API Written for the CSHP/PRAMS Residency Matching System/Service

Defaults / General Info

This section deals with some key default notions in this API.

The following is how all responses should come back from the API:

{
    "message": "English message for developers",
    "errors": [ "Localized Error Messages Array for display to users" ],
    "status": 200 (status code which should already be the HTTP status of the response)
    "data": { object or objects of data returned by the operation }
}

The default language for the API is English. If the user requests french, please send back the following header to any request:

Accept-Language: fr

Methods that require authentication must be supplied with an “Authorization” header containing the JWTToken, for example:

Authorization: Bearer header.payload.signature

Auth

Resources related to Authentication, Registration, and Password Management

Authenticate

Get a Login Token
POST/api/auth/login

Send the email and password of the person attempting to login and get back a token that can be used for each subsequent request for this session.

Example URI

POST /api/auth/login
Request
HideShow
Body
{
  "email": "somebody@somewhere.com",
  "password": "123456"
}
Schema
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "The user's email address"
    },
    "password": {
      "type": "string",
      "description": "The user's password"
    }
  },
  "required": [
    "email",
    "password"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Successful Verification",
  "errors": [],
  "status": 200,
  "data": {
    "token": "JWTToken",
    "user": {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@marsworks.com",
      "has_payment_token": false,
      "created_at": "2017-04-17T21:24:23+00:00"
    },
    "roles": [
      {
        "id": 1,
        "name": "applicant",
        "label": "Applicant"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "description": "Token for use in future operations in this App session"
        },
        "user": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "has_payment_token": {
              "type": "boolean"
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "first_name",
            "last_name",
            "email",
            "has_payment_token"
          ]
        },
        "roles": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Register

Create a new account
POST/api/auth/register

Create a new user in the application

Example URI

POST /api/auth/register
Request
HideShow
Body
{
  "email": "somebody@somewhere.com",
  "password": "123456",
  "first_name": "John",
  "last_name": "Doe"
}
Schema
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "The user's email address"
    },
    "password": {
      "type": "string",
      "description": "The user's password"
    },
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string"
    }
  },
  "required": [
    "email",
    "password"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User successfully created",
  "errors": [],
  "status": "201",
  "data": {
    "user": {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@marsworks.com",
      "has_payment_token": false,
      "created_at": "2017-04-17T21:24:23+00:00"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "string",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "user": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "has_payment_token": {
              "type": "boolean"
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "first_name",
            "last_name",
            "email",
            "has_payment_token"
          ]
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Verify Signup Token

Verify Token
POST/api/auth/verify

Confirm your ownership of the email address you registered with…in most cases, a token will be sent back which should effectively login the User.

Example URI

POST /api/auth/verify
Request
HideShow
Body
{
  "email": "somebody@somewhere.com",
  "email_token": "7JaEWn6uj4ikyu9G0LsMWXn070mZM8"
}
Schema
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "The user's email address"
    },
    "email_token": {
      "type": "string",
      "description": "The token provided by the app after registration"
    }
  },
  "required": [
    "email",
    "email_token"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User successfully verified",
  "errors": [],
  "status": 200,
  "data": {
    "user": {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@marsworks.com",
      "has_payment_token": false,
      "created_at": "2017-04-17T21:24:23+00:00"
    },
    "token": "JWTToken"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "user": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "has_payment_token": {
              "type": "boolean"
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "first_name",
            "last_name",
            "email",
            "has_payment_token"
          ]
        },
        "token": {
          "type": "string"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Password Recovery

Get a new password
POST/api/auth/recovery

Send an email to this person with a password reset token.

For role, send one of applicant, program, or administrator so we know where to direct the link button to in the email

Example URI

POST /api/auth/recovery
Request
HideShow
Body
{
  "email": "somebody@somewhere.com",
  "role": "program"
}
Schema
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "The user's email address"
    },
    "role": {
      "type": "string",
      "description": "One of `applicant`, `program`, or `administrator` so we know where to direct the link button to in the email"
    }
  },
  "required": [
    "email"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User located, Password recovery email sent",
  "errors": [],
  "status": 200,
  "data": {}
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {},
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Password Reset

Reset a user's password
POST/api/auth/reset

Supply the email, new password and reset token to reset this user’s password and then log them in

Example URI

POST /api/auth/reset
Request
HideShow
Body
{
  "email": "somebody@somewhere.com",
  "password": "123456",
  "password_confirmation": "123456",
  "token": "bba0f0f161ab3326b9226419978708ece3bf9017f7a187b28f26808f1d2057f4"
}
Schema
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "password": {
      "type": "string"
    },
    "password_confirmation": {
      "type": "string"
    },
    "token": {
      "type": "string"
    }
  },
  "required": [
    "email",
    "password",
    "password_confirmation",
    "token"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Successful Verification",
  "errors": [],
  "status": 200,
  "data": {
    "token": "JWTToken",
    "user": {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@marsworks.com",
      "has_payment_token": false,
      "created_at": "2017-04-17T21:24:23+00:00"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "description": "Token for use in future operations in this App session"
        },
        "user": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "has_payment_token": {
              "type": "boolean"
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "first_name",
            "last_name",
            "email",
            "has_payment_token"
          ]
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Authenticate Referee

Login a Referee
POST/api/auth/referee/login

Verify a Referee from their email link sent when an Applicant requests their help (or reminds them)

Example URI

POST /api/auth/referee/login
Request
HideShow
Body
{
  "email": "someone@somewhere.com",
  "token": "lksdhfhdfihahf2308748"
}
Schema
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "token": {
      "type": "string"
    }
  },
  "required": [
    "email",
    "token"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Successful Verification",
  "errors": [],
  "status": 200,
  "data": {
    "token": "JWTToken",
    "user": {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@marsworks.com",
      "has_payment_token": false,
      "created_at": "2017-04-17T21:24:23+00:00"
    },
    "roles": [
      {
        "id": 1,
        "name": "applicant",
        "label": "Applicant"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "description": "Token for use in future operations in this App session"
        },
        "user": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "has_payment_token": {
              "type": "boolean"
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "first_name",
            "last_name",
            "email",
            "has_payment_token"
          ]
        },
        "roles": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

User

Methods to deal with User and Profile management.

User

Get a User's Details
GET/api/users/{user_id}

Return basic information about a user. This can be retrieved by the user him/herself or someone with an admin role.

Example URI

GET /api/users/1
URI Parameters
HideShow
user_id
number (required) Example: 1

The User ID of the details being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved User Data",
  "errors": [],
  "status": 200,
  "data": {
    "user": {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@marsworks.com",
      "has_payment_token": false,
      "created_at": "2017-04-17T21:24:23+00:00"
    },
    "roles": [
      {
        "id": 1,
        "name": "applicant",
        "label": "Applicant"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "user": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "has_payment_token": {
              "type": "boolean"
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "first_name",
            "last_name",
            "email",
            "has_payment_token"
          ]
        },
        "roles": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Profile

Get a User's Profile
GET/api/users/{user_id}/profile

Return a user’s Profile. This can be retrieved by the user him/herself or someone with an admin role.

Example URI

GET /api/users/1/profile
URI Parameters
HideShow
user_id
number (required) Example: 1

The User ID of the details being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved User Data",
  "errors": [],
  "status": 200,
  "data": {
    "profile": {
      "organization": "MARSWorks Inc.",
      "city": "Ottawa",
      "state": "ON",
      "country": "CA",
      "address_formatted": "",
      "phone": "6138606277 x. 203",
      "fax": "6138606277 x. 203",
      "percent_completed": 0,
      "user": {
        "id": 1,
        "first_name": "John",
        "last_name": "Doe",
        "email": "john@marsworks.com",
        "has_payment_token": false,
        "created_at": "2017-04-17T21:24:23+00:00"
      }
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "profile": {
          "type": "object",
          "properties": {
            "organization": {
              "type": "string"
            },
            "city": {
              "type": "string"
            },
            "state": {
              "type": "string"
            },
            "country": {
              "type": "string"
            },
            "address_formatted": {
              "type": "string",
              "description": "HTML formatted Address from the data in this profile"
            },
            "phone": {
              "type": "string"
            },
            "fax": {
              "type": "string"
            },
            "percent_completed": {
              "type": "number",
              "description": "Percentage completion on their profile - 0 to 100"
            },
            "user": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "first_name": {
                  "type": "string"
                },
                "last_name": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "has_payment_token": {
                  "type": "boolean"
                },
                "created_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "first_name",
                "last_name",
                "email",
                "has_payment_token"
              ]
            }
          },
          "required": [
            "city",
            "percent_completed"
          ]
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

User - Password

Change Password
PUT/api/users/{user_id}/password

Change a password for a User, must be the logged in User or an Admin

Example URI

PUT /api/users/1/password
URI Parameters
HideShow
user_id
number (required) Example: 1

The User ID of the details being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "password": "123456"
}
Schema
{
  "type": "object",
  "properties": {
    "password": {
      "type": "string",
      "description": "Must be at least 6 characters"
    }
  },
  "required": [
    "password"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved User Data",
  "errors": [],
  "status": 200,
  "data": {
    "user": {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@marsworks.com",
      "has_payment_token": false,
      "created_at": "2017-04-17T21:24:23+00:00"
    },
    "roles": [
      {
        "id": 1,
        "name": "applicant",
        "label": "Applicant"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "user": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "has_payment_token": {
              "type": "boolean"
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "first_name",
            "last_name",
            "email",
            "has_payment_token"
          ]
        },
        "roles": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Program User

Program User
POST/api/programs/{program_id}/users

Attach a user to a Program - the user may already exist, or may be created before being attached.

NOTE: This is also really an updating Endpoint as well…if you post the same details and change the type, or name this will work. Adding a different email address however will add a new person!

NOTE: If you add a Director and one already exists, the previous Director is changed to coordinator

Example URI

POST /api/programs/1/users
URI Parameters
HideShow
program_id
number (required) Example: 1

The Program ID we’re attaching this User to

Request
HideShow
Body
{
  "first_name": "John",
  "last_name": "Doe",
  "email": "john.doe@marsworks.com",
  "type": "director"
}
Schema
{
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "type": {
      "enum": [
        "director",
        "coordinator"
      ]
    }
  },
  "required": [
    "first_name",
    "last_name",
    "email",
    "type"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User attached to Program",
  "errors": [],
  "status": "200",
  "data": {
    "programs": [
      {
        "id": 1,
        "name": "Mercy Hospital",
        "address1": "123 Oak Street",
        "address2": "Unit 101",
        "organization": "MARSWorks Inc.",
        "city": "Ottawa",
        "state": "ON",
        "country": "CA",
        "postal_code": "K1T 1W6",
        "phone": "6138606277 x. 203",
        "url": "https://cshp.ca/programs/program",
        "extra_uploads": "Please submit a nice cover letter and send it to us!",
        "positions": 10,
        "directors": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "coordinators": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "string",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "programs": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Program User

Program User
DELETE/api/programs/{program_id}/users/{user_id}

Detach a user from a Program.

Example URI

DELETE /api/programs/1/users/1
URI Parameters
HideShow
program_id
number (required) Example: 1

The Program ID we’re attaching this User to

user_id
number (required) Example: 1

The User ID we’re attaching to this Program

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User attached to Program",
  "errors": [],
  "status": "200",
  "data": {
    "programs": [
      {
        "id": 1,
        "name": "Mercy Hospital",
        "address1": "123 Oak Street",
        "address2": "Unit 101",
        "organization": "MARSWorks Inc.",
        "city": "Ottawa",
        "state": "ON",
        "country": "CA",
        "postal_code": "K1T 1W6",
        "phone": "6138606277 x. 203",
        "url": "https://cshp.ca/programs/program",
        "extra_uploads": "Please submit a nice cover letter and send it to us!",
        "positions": 10,
        "directors": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "coordinators": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "string",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "programs": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Applicants

Methods to deal with Applicants

Applicants

Applicants
GET/api/applicants{?download,paid}

Return Applicants, all of them, only for Adminstrators!

Example URI

GET /api/applicants?download=true&paid=true
URI Parameters
HideShow
download
string (required) Example: true

If true, returns an Excel file

paid
string (required) Example: true

If true returns only Paid Applicants, otherwise returns them all

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Applicants Returned",
  "errors": [],
  "status": 200,
  "data": {
    "users": [
      {
        "id": 1,
        "first_name": "John",
        "last_name": "Doe",
        "email": "john@marsworks.com",
        "has_payment_token": false,
        "created_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "users": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  403
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Applications

Methods to deal with Applications

Applications

Applications
GET/api/applications

Return Applications, all of them, only for Adminstrators!

Example URI

GET /api/applications
Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Application Data",
  "errors": [],
  "status": 200,
  "data": {
    "applications": [
      {
        "id": 1,
        "user_id": 1,
        "percent_completed": 100,
        "credits": 8,
        "paid": true,
        "bc_exception_paid": false,
        "references_completed": 1,
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "applications": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Applications

Application Download
GET/api/applications/{application_id}?{program_id}

Return a PDF of the Application

Applicants - get the Application and Attachments stuck together

Program Members or Admins - get Completed References as well

Example URI

GET /api/applications/1?1
URI Parameters
HideShow
application_id
number (required) Example: 1

The Application ID of the details being fetched

program_id
number (optional) Example: 1

If this is a Program User, then the ID they are currently using should be passed so we can return them the actual PDF for that program (which may have Program specific downloads)

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/octet-stream
Body
+ File: A streamed response which is the requested file sent back to the Applicant
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Application Data Download

Application Data Download
GET/api/applications/data

Return an Excel of some of the Application Data for paid Applications

NOTE: this is for Admins only

Example URI

GET /api/applications/data
Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/octet-stream
Body
+ File: A streamed response which is the requested file sent back to the Applicant
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

User Applications

User Applications
GET/api/users/{user_id}/applications

Return the Applications for a User…this should almost always return a single Application. TODO - confirm we’ll only return the “active” Application

Example URI

GET /api/users/1/applications
URI Parameters
HideShow
user_id
number (required) Example: 1

The User ID of the details being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Application Data",
  "errors": [],
  "status": 200,
  "data": {
    "applications": [
      {
        "id": 1,
        "user_id": 1,
        "application": {
          "profile": {
            "title": "Mr.",
            "first_name": "Steve",
            "last_name": "Rogers",
            "former_last_name": "Johnston",
            "preferred_name": "Smith",
            "address": {
              "city": "Ottawa",
              "state": "ON",
              "country": "CA"
            },
            "phone": "6138606277 x. 203",
            "phone2": "6138606277",
            "equity_seeking_group": "First Nations",
            "equity_seeking_group_other": "Some other value",
            "sharing_consent": true
          },
          "canadian_citizen": true,
          "licensed": {
            "status": true,
            "expected_date": "2017-04-17T21:24:23+00:00"
          },
          "education": [
            {
              "school": "Carleton University",
              "type": "post-secondary",
              "program": "Bachelor of Commerce",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "achievement": "Certificate",
              "transcript_id": 100
            }
          ],
          "pharmacy_education": {
            "directed_studies": true,
            "courses": [
              {
                "course": "Putting Pills into bottles",
                "description": "Lorem ipsum dolor sit amet"
              }
            ],
            "experiential_placements": true,
            "placements": [
              {
                "name": "MARSWorks Inc.",
                "course_number": "42.101",
                "facility_name": "Mercy Hospital",
                "site_type": "Hospital Pharmacy",
                "description": "Lorem ipsum dolor sit amet",
                "length": "4 months",
                "status": "complete",
                "skill": "Lorem ipsum dolor sit amet"
              }
            ]
          },
          "work_experience": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "community_service": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "leadership_experience": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "extracurricular": [
            {
              "name": "Choir",
              "organization": "MARSWorks Inc.",
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "description": "lorem ipsum",
              "hours": "4 / week"
            }
          ],
          "publications": "lorem ipsum",
          "memberships": [
            {
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "description": "lorem ipsum"
            }
          ],
          "awards": [
            {
              "name": "Walkley Road Scholarship",
              "description": "Lorem ipsum dolor sit amet",
              "date": "2019-01-01"
            }
          ],
          "essay": "lorem ipsum"
        },
        "percent_completed": 100,
        "credits": 8,
        "paid": true,
        "bc_exception_paid": false,
        "empty_sections": {
          "status": false,
          "education": false,
          "pharmacy_education": false,
          "work experience": false,
          "community service": false,
          "leadership experience": false,
          "essay": false
        },
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "applications": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Application

Get an Application
GET/api/users/{user_id}/applications/{application_id}

Return the Application. This can be retrieved by the user him/herself, by someone with an admin role, or by someone in a Program to which this Applicant has Applied.

Example URI

GET /api/users/1/applications/1
URI Parameters
HideShow
user_id
number (required) Example: 1

The User ID of the details being fetched

application_id
number (required) Example: 1

The Application ID of the Application being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Application Data",
  "errors": [],
  "status": 200,
  "data": {
    "applications": [
      {
        "id": 1,
        "user_id": 1,
        "application": {
          "profile": {
            "title": "Mr.",
            "first_name": "Steve",
            "last_name": "Rogers",
            "former_last_name": "Johnston",
            "preferred_name": "Smith",
            "address": {
              "city": "Ottawa",
              "state": "ON",
              "country": "CA"
            },
            "phone": "6138606277 x. 203",
            "phone2": "6138606277",
            "equity_seeking_group": "First Nations",
            "equity_seeking_group_other": "Some other value",
            "sharing_consent": true
          },
          "canadian_citizen": true,
          "licensed": {
            "status": true,
            "expected_date": "2017-04-17T21:24:23+00:00"
          },
          "education": [
            {
              "school": "Carleton University",
              "type": "post-secondary",
              "program": "Bachelor of Commerce",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "achievement": "Certificate",
              "transcript_id": 100
            }
          ],
          "pharmacy_education": {
            "directed_studies": true,
            "courses": [
              {
                "course": "Putting Pills into bottles",
                "description": "Lorem ipsum dolor sit amet"
              }
            ],
            "experiential_placements": true,
            "placements": [
              {
                "name": "MARSWorks Inc.",
                "course_number": "42.101",
                "facility_name": "Mercy Hospital",
                "site_type": "Hospital Pharmacy",
                "description": "Lorem ipsum dolor sit amet",
                "length": "4 months",
                "status": "complete",
                "skill": "Lorem ipsum dolor sit amet"
              }
            ]
          },
          "work_experience": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "community_service": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "leadership_experience": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "extracurricular": [
            {
              "name": "Choir",
              "organization": "MARSWorks Inc.",
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "description": "lorem ipsum",
              "hours": "4 / week"
            }
          ],
          "publications": "lorem ipsum",
          "memberships": [
            {
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "description": "lorem ipsum"
            }
          ],
          "awards": [
            {
              "name": "Walkley Road Scholarship",
              "description": "Lorem ipsum dolor sit amet",
              "date": "2019-01-01"
            }
          ],
          "essay": "lorem ipsum"
        },
        "percent_completed": 100,
        "credits": 8,
        "paid": true,
        "bc_exception_paid": false,
        "empty_sections": {
          "status": false,
          "education": false,
          "pharmacy_education": false,
          "work experience": false,
          "community service": false,
          "leadership experience": false,
          "essay": false
        },
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "applications": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Save an Application
POST/api/users/{user_id}/applications/{application_id}

Store the Application, this should only be possible by the Applicant him/herself

Example URI

POST /api/users/1/applications/1
URI Parameters
HideShow
user_id
number (required) Example: 1

The User ID of the details being fetched

application_id
number (required) Example: 1

The Application ID of the Application being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "application": {
    "profile": {
      "title": "Mr.",
      "first_name": "Steve",
      "last_name": "Rogers",
      "former_last_name": "Johnston",
      "preferred_name": "Smith",
      "address": {
        "city": "Ottawa",
        "state": "ON",
        "country": "CA"
      },
      "phone": "6138606277 x. 203",
      "phone2": "6138606277",
      "equity_seeking_group": "LGBTQ2S+",
      "equity_seeking_group_other": "Some other value",
      "sharing_consent": true
    },
    "canadian_citizen": true,
    "licensed": {
      "status": true,
      "expected_date": "2017-04-17T21:24:23+00:00"
    },
    "education": [
      {
        "school": "Carleton University",
        "type": "post",
        "program": "Bachelor of Commerce",
        "address": {
          "city": "Ottawa",
          "state": "ON",
          "country": "CA"
        },
        "start_date": "2010-09-01",
        "end_date": "2013-04-30",
        "achievement": "Certificate",
        "transcript_id": 100
      }
    ],
    "pharmacy_education": {
      "directed_studies": true,
      "courses": [
        {
          "course": "Putting Pills into bottles",
          "description": "Lorem ipsum dolor sit amet"
        }
      ],
      "experiential_placements": true,
      "placements": [
        {
          "name": "MARSWorks Inc.",
          "course_number": "42.101",
          "facility_name": "Mercy Hospital",
          "site_type": "Hospital Pharmacy",
          "description": "Lorem ipsum dolor sit amet",
          "length": "4 months",
          "status": "complete",
          "skill": "Lorem ipsum dolor sit amet"
        }
      ]
    },
    "work_experience": [
      {
        "position": "Application Developer",
        "organization": "MARSWorks Inc.",
        "address": {
          "city": "Ottawa",
          "state": "ON",
          "country": "CA"
        },
        "start_date": "2010-09-01",
        "end_date": "2013-04-30",
        "hours": "40 / week",
        "supervisor": "John Doe",
        "supervisor_phone": "613-555-1212",
        "supervisor_email": "supervisor@somewhere.com",
        "duties": "lorem ipsum"
      }
    ],
    "community_service": [
      {
        "position": "Application Developer",
        "organization": "MARSWorks Inc.",
        "address": {
          "city": "Ottawa",
          "state": "ON",
          "country": "CA"
        },
        "start_date": "2010-09-01",
        "end_date": "2013-04-30",
        "hours": "40 / week",
        "supervisor": "John Doe",
        "supervisor_phone": "613-555-1212",
        "supervisor_email": "supervisor@somewhere.com",
        "duties": "lorem ipsum"
      }
    ],
    "leadership_experience": [
      {
        "position": "Application Developer",
        "organization": "MARSWorks Inc.",
        "address": {
          "city": "Ottawa",
          "state": "ON",
          "country": "CA"
        },
        "start_date": "2010-09-01",
        "end_date": "2013-04-30",
        "hours": "40 / week",
        "supervisor": "John Doe",
        "supervisor_phone": "613-555-1212",
        "supervisor_email": "supervisor@somewhere.com",
        "duties": "lorem ipsum"
      }
    ],
    "extracurricular": [
      {
        "name": "Choir",
        "organization": "MARSWorks Inc.",
        "start_date": "2010-09-01",
        "end_date": "2013-04-30",
        "description": "lorem ipsum",
        "hours": "4 / week"
      }
    ],
    "publications": "lorem ipsum",
    "memberships": [
      {
        "start_date": "2010-09-01",
        "end_date": "2013-04-30",
        "description": "lorem ipsum"
      }
    ],
    "awards": [
      {
        "name": "Walkley Road Scholarship",
        "description": "Lorem ipsum dolor sit amet",
        "date": "2019-01-01"
      }
    ],
    "essay": "lorem ipsum"
  }
}
Schema
{
  "type": "object",
  "properties": {
    "application": {
      "type": "object",
      "properties": {
        "profile": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "former_last_name": {
              "type": "string"
            },
            "preferred_name": {
              "type": "string"
            },
            "address": {
              "type": "object",
              "properties": {
                "city": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                }
              },
              "required": [
                "city"
              ]
            },
            "phone": {
              "type": "string"
            },
            "phone2": {
              "type": "string"
            },
            "equity_seeking_group": {
              "enum": [
                "LGBTQ2S+",
                "First Nations",
                "Inuit",
                "Métis or other Indigenous group",
                "Black or Person of Colour",
                "Person with a disability",
                "Woman",
                "Other",
                "No"
              ]
            },
            "equity_seeking_group_other": {
              "type": "string"
            },
            "sharing_consent": {
              "type": "boolean"
            }
          }
        },
        "canadian_citizen": {
          "type": "boolean"
        },
        "licensed": {
          "type": "object",
          "properties": {
            "status": {
              "type": "boolean"
            },
            "expected_date": {
              "type": "string"
            }
          }
        },
        "education": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "school": {
                "type": "string"
              },
              "type": {
                "enum": [
                  "post",
                  "secondary"
                ]
              },
              "program": {
                "type": "string"
              },
              "address": {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                },
                "required": [
                  "city"
                ]
              },
              "start_date": {
                "type": "string"
              },
              "end_date": {
                "type": "string"
              },
              "achievement": {
                "enum": [
                  "Certificate",
                  "Diploma",
                  "Degree"
                ]
              },
              "transcript_id": {
                "type": "number"
              }
            },
            "required": [
              "school",
              "program",
              "start_date",
              "end_date"
            ]
          }
        },
        "pharmacy_education": {
          "type": "object",
          "properties": {
            "directed_studies": {
              "type": "boolean"
            },
            "courses": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "course": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  }
                }
              }
            },
            "experiential_placements": {
              "type": "boolean"
            },
            "placements": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "course_number": {
                    "type": "string"
                  },
                  "facility_name": {
                    "type": "string"
                  },
                  "site_type": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "length": {
                    "type": "string"
                  },
                  "status": {
                    "enum": [
                      "complete",
                      "in-progress"
                    ]
                  },
                  "skill": {
                    "type": "string"
                  }
                },
                "required": [
                  "length",
                  "status"
                ]
              }
            }
          }
        },
        "work_experience": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "position": {
                "type": "string"
              },
              "organization": {
                "type": "string"
              },
              "address": {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                },
                "required": [
                  "city"
                ]
              },
              "start_date": {
                "type": "string"
              },
              "end_date": {
                "type": "string"
              },
              "hours": {
                "type": "string"
              },
              "supervisor": {
                "type": "string"
              },
              "supervisor_phone": {
                "type": "string"
              },
              "supervisor_email": {
                "type": "string"
              },
              "duties": {
                "type": "string"
              }
            }
          }
        },
        "community_service": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "position": {
                "type": "string"
              },
              "organization": {
                "type": "string"
              },
              "address": {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                },
                "required": [
                  "city"
                ]
              },
              "start_date": {
                "type": "string"
              },
              "end_date": {
                "type": "string"
              },
              "hours": {
                "type": "string"
              },
              "supervisor": {
                "type": "string"
              },
              "supervisor_phone": {
                "type": "string"
              },
              "supervisor_email": {
                "type": "string"
              },
              "duties": {
                "type": "string"
              }
            }
          }
        },
        "leadership_experience": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "position": {
                "type": "string"
              },
              "organization": {
                "type": "string"
              },
              "address": {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                },
                "required": [
                  "city"
                ]
              },
              "start_date": {
                "type": "string"
              },
              "end_date": {
                "type": "string"
              },
              "hours": {
                "type": "string"
              },
              "supervisor": {
                "type": "string"
              },
              "supervisor_phone": {
                "type": "string"
              },
              "supervisor_email": {
                "type": "string"
              },
              "duties": {
                "type": "string"
              }
            }
          }
        },
        "extracurricular": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "organization": {
                "type": "string"
              },
              "start_date": {
                "type": "string"
              },
              "end_date": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "hours": {
                "type": "string"
              }
            }
          }
        },
        "publications": {
          "type": "string"
        },
        "memberships": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "start_date": {
                "type": "string"
              },
              "end_date": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "start_date",
              "end_date",
              "description"
            ]
          }
        },
        "awards": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "date": {
                "type": "string"
              }
            }
          }
        },
        "essay": {
          "type": "string"
        }
      }
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Application Data",
  "errors": [],
  "status": 200,
  "data": {
    "applications": [
      {
        "id": 1,
        "user_id": 1,
        "application": {
          "profile": {
            "title": "Mr.",
            "first_name": "Steve",
            "last_name": "Rogers",
            "former_last_name": "Johnston",
            "preferred_name": "Smith",
            "address": {
              "city": "Ottawa",
              "state": "ON",
              "country": "CA"
            },
            "phone": "6138606277 x. 203",
            "phone2": "6138606277",
            "equity_seeking_group": "First Nations",
            "equity_seeking_group_other": "Some other value",
            "sharing_consent": true
          },
          "canadian_citizen": true,
          "licensed": {
            "status": true,
            "expected_date": "2017-04-17T21:24:23+00:00"
          },
          "education": [
            {
              "school": "Carleton University",
              "type": "post-secondary",
              "program": "Bachelor of Commerce",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "achievement": "Certificate",
              "transcript_id": 100
            }
          ],
          "pharmacy_education": {
            "directed_studies": true,
            "courses": [
              {
                "course": "Putting Pills into bottles",
                "description": "Lorem ipsum dolor sit amet"
              }
            ],
            "experiential_placements": true,
            "placements": [
              {
                "name": "MARSWorks Inc.",
                "course_number": "42.101",
                "facility_name": "Mercy Hospital",
                "site_type": "Hospital Pharmacy",
                "description": "Lorem ipsum dolor sit amet",
                "length": "4 months",
                "status": "complete",
                "skill": "Lorem ipsum dolor sit amet"
              }
            ]
          },
          "work_experience": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "community_service": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "leadership_experience": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "extracurricular": [
            {
              "name": "Choir",
              "organization": "MARSWorks Inc.",
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "description": "lorem ipsum",
              "hours": "4 / week"
            }
          ],
          "publications": "lorem ipsum",
          "memberships": [
            {
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "description": "lorem ipsum"
            }
          ],
          "awards": [
            {
              "name": "Walkley Road Scholarship",
              "description": "Lorem ipsum dolor sit amet",
              "date": "2019-01-01"
            }
          ],
          "essay": "lorem ipsum"
        },
        "percent_completed": 100,
        "credits": 8,
        "paid": true,
        "bc_exception_paid": false,
        "empty_sections": {
          "status": false,
          "education": false,
          "pharmacy_education": false,
          "work experience": false,
          "community service": false,
          "leadership experience": false,
          "essay": false
        },
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "applications": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Rankings

Apply To/Rank a Program
POST/api/applications/{application_id}/rankings

Create an Application to this Program, which creates a Ranking Object

Example URI

POST /api/applications/1/rankings
URI Parameters
HideShow
application_id
number (required) Example: 1

The Application ID of the Application being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "program_id": 10
}
Schema
{
  "type": "object",
  "properties": {
    "program_id": {
      "type": "number"
    }
  },
  "required": [
    "program_id"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Ranked Program",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "application_id": 1,
        "program_id": 1,
        "program_rank": 1,
        "applicant_rank": 1,
        "no_interview": false,
        "status": "prematch",
        "status_description": "Pre-Match",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        },
        "program": {
          "id": 1,
          "name": "Mercy Hospital",
          "address1": "123 Oak Street",
          "address2": "Unit 101",
          "organization": "MARSWorks Inc.",
          "city": "Ottawa",
          "state": "ON",
          "country": "CA",
          "postal_code": "K1T 1W6",
          "phone": "6138606277 x. 203",
          "url": "https://cshp.ca/programs/program",
          "extra_uploads": "Please submit a nice cover letter and send it to us!",
          "positions": 10,
          "created_at": "2017-04-17T21:24:23+00:00",
          "updated_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Rankings

Delete Ranking
DELETE/api/applications/{application_id}/rankings/{ranking_id}

Deletes an Application to this Program, which deletes a Ranking Object

Example URI

DELETE /api/applications/1/rankings/1
URI Parameters
HideShow
application_id
number (required) Example: 1

The Application ID of the Application being fetched

ranking_id
number (required) Example: 1

The Ranking ID of the Ranking being deleted

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Successfully canceled a Ranking",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "application_id": 1,
        "program_id": 1,
        "program_rank": 1,
        "applicant_rank": 1,
        "no_interview": false,
        "status": "prematch",
        "status_description": "Pre-Match",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        },
        "program": {
          "id": 1,
          "name": "Mercy Hospital",
          "address1": "123 Oak Street",
          "address2": "Unit 101",
          "organization": "MARSWorks Inc.",
          "city": "Ottawa",
          "state": "ON",
          "country": "CA",
          "postal_code": "K1T 1W6",
          "phone": "6138606277 x. 203",
          "url": "https://cshp.ca/programs/program",
          "extra_uploads": "Please submit a nice cover letter and send it to us!",
          "positions": 10,
          "created_at": "2017-04-17T21:24:23+00:00",
          "updated_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Rankings

Rankings from an Application
GET/api/users/{user_id}/applications/{application_id}/rankings

Return the Rankings made by an Application/Applicant. This can be retrieved by the user him/herself, by someone with an admin role, or by someone in a Program to which this Applicant has Applied.

NOTE: Return shape may differ depending on Role…if Program Member, ranking orders are null and includes of Applicant and Program info are not included, and “program_name” is added.

Example URI

GET /api/users/1/applications/1/rankings
URI Parameters
HideShow
user_id
number (required) Example: 1

The User ID of the details being fetched

application_id
number (required) Example: 1

The Application ID of the Application being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Application Data",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "application_id": 1,
        "program_id": 1,
        "program_rank": 1,
        "applicant_rank": 1,
        "no_interview": false,
        "status": "prematch",
        "status_description": "Pre-Match",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        },
        "program": {
          "id": 1,
          "name": "Mercy Hospital",
          "address1": "123 Oak Street",
          "address2": "Unit 101",
          "organization": "MARSWorks Inc.",
          "city": "Ottawa",
          "state": "ON",
          "country": "CA",
          "postal_code": "K1T 1W6",
          "phone": "6138606277 x. 203",
          "url": "https://cshp.ca/programs/program",
          "extra_uploads": "Please submit a nice cover letter and send it to us!",
          "positions": 10,
          "created_at": "2017-04-17T21:24:23+00:00",
          "updated_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Ranking Orders

Change Rankings by Applicant
POST/api/applications/{application_id}/ranking-orders

Only the Applicant should be able to order their Program Rankings

NOTE: TODO - Policy to lock this down to the Applicant, its OPEN at the moment!

Example URI

POST /api/applications/1/ranking-orders
URI Parameters
HideShow
application_id
number (required) Example: 1

The Application ID of the Application being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "new_ranking_ids": [
    1,
    14,
    25,
    12
  ]
}
Schema
{
  "type": "object",
  "properties": {
    "new_ranking_ids": {
      "type": "array",
      "items": {
        "type": "number"
      }
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Applicant Rankings Re-Ordered",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "application_id": 1,
        "program_id": 1,
        "program_rank": 1,
        "applicant_rank": 1,
        "no_interview": false,
        "status": "prematch",
        "status_description": "Pre-Match",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        },
        "program": {
          "id": 1,
          "name": "Mercy Hospital",
          "address1": "123 Oak Street",
          "address2": "Unit 101",
          "organization": "MARSWorks Inc.",
          "city": "Ottawa",
          "state": "ON",
          "country": "CA",
          "postal_code": "K1T 1W6",
          "phone": "6138606277 x. 203",
          "url": "https://cshp.ca/programs/program",
          "extra_uploads": "Please submit a nice cover letter and send it to us!",
          "positions": 10,
          "created_at": "2017-04-17T21:24:23+00:00",
          "updated_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Program Rankings

Program Ranking
PUT/api/rankings/{ranking_id}

Only an Admin or Program Member can do this.

Pass in an integer from 1 to 1000 to move this Ranking to that place in the Order.

NOTE: you can pass null to de-rank an Applicant. NOTE: if you pass an integer already taken, others may be bumped lower

Example URI

PUT /api/rankings/1
URI Parameters
HideShow
ranking_id
number (required) Example: 1

The Ranking ID being re-ordered

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "program_rank": 1
}
Schema
{
  "type": "object",
  "properties": {
    "program_rank": {
      "type": "number",
      "description": "Can be `null` as well if de-ranking the Applicant"
    }
  },
  "required": [
    "program_rank"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Successful Re-Ordered a Program Ranking",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "application_id": 1,
        "application_phone": "+1-613-555-1212 x. 203",
        "application_phone2": "+1-613-555-1212 x. 203",
        "program_id": 1,
        "program_rank": 1,
        "status": "prematch",
        "status_description": "Pre-Match",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Program Ranking Tags

Program Ranking Tags
PUT/api/rankings/{ranking_id}/tags

Add or remove a tag for a Ranking…can only be done during the Ranking phase of the application and by a program user.

For now, the only possible tag is no_interview to indicate if the Program has decided not to interview a candidate.

Example URI

PUT /api/rankings/1/tags
URI Parameters
HideShow
ranking_id
number (required) Example: 1

The Ranking ID being re-ordered

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "no_interview": true
}
Schema
{
  "type": "object",
  "properties": {
    "no_interview": {
      "type": "boolean"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Successfully changed tags for a ranking",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "application_id": 1,
        "application_phone": "+1-613-555-1212 x. 203",
        "application_phone2": "+1-613-555-1212 x. 203",
        "program_id": 1,
        "program_rank": 1,
        "status": "prematch",
        "status_description": "Pre-Match",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Program Rankings

Program Rankings
GET/api/programs/{program_id}/rankings

Only a Member of the chosen Program should be able to see this list

Example URI

GET /api/programs/1/rankings
URI Parameters
HideShow
program_id
number (required) Example: 1

The Program ID that you’re fetching Rankings for

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Program Rankings",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "application_id": 1,
        "application_phone": "+1-613-555-1212 x. 203",
        "application_phone2": "+1-613-555-1212 x. 203",
        "program_id": 1,
        "program_rank": 1,
        "status": "prematch",
        "status_description": "Pre-Match",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Program Applications

Program Applications
GET/api/programs/{program_id}/applications{?download}

Only a Member of the chosen Program should be able to see this list of Applications

NOTE: Not sure we actually need this method…it uses an abbreviated “Application” object in the response

Example URI

GET /api/programs/1/applications?download=true
URI Parameters
HideShow
program_id
number (required) Example: 1

The Program ID that you’re fetching Applications for

download
boolean (required) Example: true

If true this will return a .zip file of all applications to a program

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Application Data",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "user_id": 1,
        "percent_completed": 100,
        "references_completed": 2,
        "rankings": 4,
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Application File Operations

Application Files
GET/api/applications/{application_id}/files?{ranking_id}

Get a list of the files attached to an Application

Example URI

GET /api/applications/1/files?1
URI Parameters
HideShow
application_id
number (required) Example: 1

The Application we want files from

ranking_id
number (optional) Example: 1

Specify the Ranking ID to retrieve files for this Ranking only

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Application Files",
  "errors": [],
  "status": 200,
  "data": {
    "files": [
      {
        "id": 1,
        "title": "File Title",
        "description": "Lorem ipsum dolor si amet",
        "filename": "Some_File_Name.pdf",
        "filesize": 123456,
        "filetype": "application/pdf",
        "created_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "files": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Application File
POST/api/applications/{application_id}/files?

Upload a file linked to this Application

Example URI

POST /api/applications/1/files?
URI Parameters
HideShow
application_id
number (required) Example: 1

The Application this Applicant is uploading a file to

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "title": "My Resume",
  "filename": "resume.pdf",
  "filesize": 12345,
  "filetype": "application/pdf",
  "ranking_id": 1,
  "attachment": "JHIUH6f8agsdgfqgw876fq8werfgfd"
}
Schema
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string"
    },
    "filename": {
      "type": "string"
    },
    "filesize": {
      "type": "number"
    },
    "filetype": {
      "type": "string"
    },
    "ranking_id": {
      "type": "number",
      "description": "If this is a Ranking/Program specific upload, supply the Ranking ID"
    },
    "attachment": {
      "type": "string",
      "description": "Base64 encoded string representing the file to upload"
    }
  },
  "required": [
    "title",
    "filename",
    "filesize",
    "filetype",
    "attachment"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "File successfully uploaded",
  "errors": [],
  "status": 200,
  "data": {
    "file": {
      "id": 1,
      "title": "File Title",
      "description": "Lorem ipsum dolor si amet",
      "filename": "Some_File_Name.pdf",
      "filesize": 123456,
      "filetype": "application/pdf",
      "created_at": "2017-04-17T21:24:23+00:00"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "file": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "title": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "filename": {
              "type": "string"
            },
            "filesize": {
              "type": "number"
            },
            "filetype": {
              "type": "string"
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "title"
          ]
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

File

Download a File
GET/api/files/{file_id}

Download a file to the browser

Example URI

GET /api/files/1
URI Parameters
HideShow
file_id
number (required) Example: 1

The file being requested

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/octet-stream
Body
+File: A streamed response which is the requested file sent back to the Applicant
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Delete a File
DELETE/api/files/{file_id}

Delete a file attached to this Application.

This should return a list of all Files remaining on this Application

Example URI

DELETE /api/files/1
URI Parameters
HideShow
file_id
number (required) Example: 1

The file being requested

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "File Successfully Deleted",
  "errors": [],
  "status": 200,
  "data": {
    "files": [
      {
        "id": 1,
        "title": "File Title",
        "description": "Lorem ipsum dolor si amet",
        "filename": "Some_File_Name.pdf",
        "filesize": 123456,
        "filetype": "application/pdf",
        "created_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "files": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Referees

Methods to deal with Referees

Referees

Referees
GET/api/referees{?download}

Return Referees, all of them, only for Adminstrators!

Example URI

GET /api/referees?download=true
URI Parameters
HideShow
download
string (required) Example: true

If true, returns an Excel file

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Referees Returned",
  "errors": [],
  "status": 200,
  "data": {
    "users": [
      {
        "id": 1,
        "first_name": "John",
        "last_name": "Doe",
        "email": "john@marsworks.com",
        "has_payment_token": false,
        "created_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "users": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  403
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

References

Methods to deal with References and Referees

References

Get References
GET/api/references{?own}

Return References for a Referee, or the entire list if you are an Administrator

Example URI

GET /api/references?own=true
URI Parameters
HideShow
own
string (optional) Example: true

If this parameter is passed (with any value other than false) and the authorized User is an Administrator, they will only get References returned that belong to them (as the Referee)

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved References",
  "errors": [],
  "status": 200,
  "data": {
    "references": [
      {
        "id": 1,
        "application_id": 1,
        "referee_id": 96,
        "request": "Nemo quis nihil accusantium voluptatem.",
        "reference": {
          "profile": {
            "position": "Professor",
            "organization": "Last Chance U",
            "location": "Ottawa, ON",
            "phone": "613"
          },
          "relationship": {
            "faculty": true,
            "preceptor": false,
            "employer": true,
            "other": true,
            "other_description": "Other relationship value"
          },
          "known": "post-secondary",
          "hours": "10",
          "ratings": {
            "independence": 1,
            "problem_solving": 1,
            "communication": 1,
            "adpatability": 1,
            "professionalism": 1,
            "feedback": 1
          },
          "opportunity_for_improvement": "Lorem ipsum dolor sit amet",
          "comments": "Lorem ipsum dolor sit amet",
          "would_hire": true,
          "would_hire_comments": "Lorem ipsum dolor sit amet"
        },
        "status": "requested",
        "percent_complete": 100,
        "valid_sections": {
          "relationship": true,
          "ratings": true,
          "recommendations": true,
          "your_info": true
        },
        "token_sent": "2017-08-23T17:12:18+00:00",
        "token_resend": "2017-08-30T17:12:18+00:00",
        "can_resend": false,
        "link_login": "http://localhost:4200/referees/login",
        "link_decline": "http://localhost:4200/referees/decline",
        "created_at": "2017-08-08T17:13:50+00:00",
        "updated_at": "2017-08-08T17:13:50+00:00",
        "referee": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "references": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Reference

Get a Reference
GET/api/references/{reference_id}{?download}

Return a specific References, only the Referee, Administrator, or a Program user who has been ranked by the Application can “get” this Reference

NOTE: The Reference sent back in the Response will not contain the Reference “Content” if this is the Applicant!

NOTE: If an Applicant tries to download a PDF, they will simply be returned the reference info they can see in a normal JSON response

Example URI

GET /api/references/1?download=true
URI Parameters
HideShow
reference_id
number (required) Example: 1

The ID of the Reference being fetched

download
boolean (required) Example: true

If true a PDF is sent instead

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved References",
  "errors": [],
  "status": 200,
  "data": {
    "references": [
      {
        "id": 1,
        "application_id": 1,
        "referee_id": 96,
        "request": "Nemo quis nihil accusantium voluptatem.",
        "reference": {
          "profile": {
            "position": "Professor",
            "organization": "Last Chance U",
            "location": "Ottawa, ON",
            "phone": "613"
          },
          "relationship": {
            "faculty": true,
            "preceptor": false,
            "employer": true,
            "other": true,
            "other_description": "Other relationship value"
          },
          "known": "post-secondary",
          "hours": "10",
          "ratings": {
            "independence": 1,
            "problem_solving": 1,
            "communication": 1,
            "adpatability": 1,
            "professionalism": 1,
            "feedback": 1
          },
          "opportunity_for_improvement": "Lorem ipsum dolor sit amet",
          "comments": "Lorem ipsum dolor sit amet",
          "would_hire": true,
          "would_hire_comments": "Lorem ipsum dolor sit amet"
        },
        "status": "requested",
        "percent_complete": 100,
        "valid_sections": {
          "relationship": true,
          "ratings": true,
          "recommendations": true,
          "your_info": true
        },
        "token_sent": "2017-08-23T17:12:18+00:00",
        "token_resend": "2017-08-30T17:12:18+00:00",
        "can_resend": false,
        "link_login": "http://localhost:4200/referees/login",
        "link_decline": "http://localhost:4200/referees/decline",
        "created_at": "2017-08-08T17:13:50+00:00",
        "updated_at": "2017-08-08T17:13:50+00:00",
        "referee": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "references": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Cancel/Decline Reference
DELETE/api/references/{reference_id}{?download}

Cancel or Decline a Reference - must be the Applicant who requested it, or the Referee

NOTE: The Reference sent back in the Response will not contain the Reference “Content” if this is the Applicant!

Example URI

DELETE /api/references/1?download=true
URI Parameters
HideShow
reference_id
number (required) Example: 1

The ID of the Reference being fetched

download
boolean (required) Example: true

If true a PDF is sent instead

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Reference successfully deleted",
  "errors": [],
  "status": 200,
  "data": {
    "references": [
      {
        "id": 1,
        "application_id": 1,
        "referee_id": 96,
        "request": "Nemo quis nihil accusantium voluptatem.",
        "reference": {
          "profile": {
            "position": "Professor",
            "organization": "Last Chance U",
            "location": "Ottawa, ON",
            "phone": "613"
          },
          "relationship": {
            "faculty": true,
            "preceptor": false,
            "employer": true,
            "other": true,
            "other_description": "Other relationship value"
          },
          "known": "post-secondary",
          "hours": "10",
          "ratings": {
            "independence": 1,
            "problem_solving": 1,
            "communication": 1,
            "adpatability": 1,
            "professionalism": 1,
            "feedback": 1
          },
          "opportunity_for_improvement": "Lorem ipsum dolor sit amet",
          "comments": "Lorem ipsum dolor sit amet",
          "would_hire": true,
          "would_hire_comments": "Lorem ipsum dolor sit amet"
        },
        "status": "requested",
        "percent_complete": 100,
        "valid_sections": {
          "relationship": true,
          "ratings": true,
          "recommendations": true,
          "your_info": true
        },
        "token_sent": "2017-08-23T17:12:18+00:00",
        "token_resend": "2017-08-30T17:12:18+00:00",
        "can_resend": false,
        "link_login": "http://localhost:4200/referees/login",
        "link_decline": "http://localhost:4200/referees/decline",
        "created_at": "2017-08-08T17:13:50+00:00",
        "updated_at": "2017-08-08T17:13:50+00:00",
        "referee": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "references": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Update a Reference
PUT/api/references/{reference_id}{?download}

Save a Reference, this can be done by either the

  • Referee - who would send the reference content and optionally a status

  • Applicant - who would send the token_sent value, which must be 7 days from the time the Referee was last reminded, OR could try to uncancel a canceled reference by sending the status of requested

NOTE: Only one of token_sent or status can be sent by the Applicant on a single request

At the moment, the value of token_sent is irrelevant, any non-NULL value will trigger a Notification if enough time has passed since the last Notification to the Referee.

Example URI

PUT /api/references/1?download=true
URI Parameters
HideShow
reference_id
number (required) Example: 1

The ID of the Reference being fetched

download
boolean (required) Example: true

If true a PDF is sent instead

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "reference": {
    "profile": {
      "position": "Professor",
      "organization": "Last Chance U",
      "location": "Ottawa, ON",
      "phone": "613"
    },
    "relationship": {
      "faculty": true,
      "preceptor": false,
      "employer": true,
      "other": true,
      "other_description": "Other relationship value"
    },
    "known": "less_than_1_year",
    "hours": "10",
    "ratings": {
      "independence": 1,
      "problem_solving": 1,
      "communication": 1,
      "adpatability": 1,
      "professionalism": 1,
      "feedback": 1
    },
    "opportunity_for_improvement": "Lorem ipsum dolor sit amet",
    "comments": "Lorem ipsum dolor sit amet",
    "would_hire": true,
    "would_hire_comments": "Lorem ipsum dolor sit amet"
  },
  "status": "requested",
  "token_sent": "2017-04-17T21:24:23+00:00"
}
Schema
{
  "type": "object",
  "properties": {
    "reference": {
      "type": "object",
      "properties": {
        "profile": {
          "type": "object",
          "properties": {
            "position": {
              "type": "string"
            },
            "organization": {
              "type": "string"
            },
            "location": {
              "type": "string"
            },
            "phone": {
              "type": "string",
              "description": "555-1212"
            }
          }
        },
        "relationship": {
          "type": "object",
          "properties": {
            "faculty": {
              "type": "boolean"
            },
            "preceptor": {
              "type": "boolean"
            },
            "employer": {
              "type": "boolean"
            },
            "other": {
              "type": "boolean"
            },
            "other_description": {
              "type": "string"
            }
          }
        },
        "known": {
          "enum": [
            "less_than_1_year",
            "1_or_2_years",
            "3_to_5_years",
            "more_than_5_years",
            "null"
          ]
        },
        "hours": {
          "type": "string"
        },
        "ratings": {
          "type": "object",
          "properties": {
            "independence": {
              "type": "number"
            },
            "problem_solving": {
              "type": "number"
            },
            "communication": {
              "type": "number"
            },
            "adpatability": {
              "type": "number"
            },
            "professionalism": {
              "type": "number"
            },
            "feedback": {
              "type": "number"
            }
          }
        },
        "opportunity_for_improvement": {
          "type": "string"
        },
        "comments": {
          "type": "string"
        },
        "would_hire": {
          "type": "boolean"
        },
        "would_hire_comments": {
          "type": "string"
        }
      }
    },
    "status": {
      "enum": [
        "requested",
        "completed"
      ]
    },
    "token_sent": {
      "type": "string"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved References",
  "errors": [],
  "status": 200,
  "data": {
    "references": [
      {
        "id": 1,
        "application_id": 1,
        "referee_id": 96,
        "request": "Nemo quis nihil accusantium voluptatem.",
        "reference": {
          "profile": {
            "position": "Professor",
            "organization": "Last Chance U",
            "location": "Ottawa, ON",
            "phone": "613"
          },
          "relationship": {
            "faculty": true,
            "preceptor": false,
            "employer": true,
            "other": true,
            "other_description": "Other relationship value"
          },
          "known": "post-secondary",
          "hours": "10",
          "ratings": {
            "independence": 1,
            "problem_solving": 1,
            "communication": 1,
            "adpatability": 1,
            "professionalism": 1,
            "feedback": 1
          },
          "opportunity_for_improvement": "Lorem ipsum dolor sit amet",
          "comments": "Lorem ipsum dolor sit amet",
          "would_hire": true,
          "would_hire_comments": "Lorem ipsum dolor sit amet"
        },
        "status": "requested",
        "percent_complete": 100,
        "valid_sections": {
          "relationship": true,
          "ratings": true,
          "recommendations": true,
          "your_info": true
        },
        "token_sent": "2017-08-23T17:12:18+00:00",
        "token_resend": "2017-08-30T17:12:18+00:00",
        "can_resend": false,
        "link_login": "http://localhost:4200/referees/login",
        "link_decline": "http://localhost:4200/referees/decline",
        "created_at": "2017-08-08T17:13:50+00:00",
        "updated_at": "2017-08-08T17:13:50+00:00",
        "referee": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "references": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Reference Quick Decline

Quick Decline Reference
DELETE/api/references/decline

One-Click Decline a Reference.

Example URI

DELETE /api/references/decline
Request
HideShow
Body
{
  "email": "someone@somewhere.com",
  "token": "lksdhfhdfihahf2308748"
}
Schema
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "token": {
      "type": "string"
    }
  },
  "required": [
    "email",
    "token"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Reference successfully declined",
  "errors": [],
  "status": 200,
  "data": {}
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {},
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Application References

Get Application References
GET/api/applications/{application_id}/references

Return the References for a specific Application

Example URI

GET /api/applications/1/references
URI Parameters
HideShow
application_id
number (required) Example: 1

The Application ID of the Application References being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Application References",
  "errors": [],
  "status": 200,
  "data": {
    "references": [
      {
        "id": 1,
        "application_id": 1,
        "referee_id": 96,
        "request": "Nemo quis nihil accusantium voluptatem.",
        "reference": {
          "profile": {
            "position": "Professor",
            "organization": "Last Chance U",
            "location": "Ottawa, ON",
            "phone": "613"
          },
          "relationship": {
            "faculty": true,
            "preceptor": false,
            "employer": true,
            "other": true,
            "other_description": "Other relationship value"
          },
          "known": "post-secondary",
          "hours": "10",
          "ratings": {
            "independence": 1,
            "problem_solving": 1,
            "communication": 1,
            "adpatability": 1,
            "professionalism": 1,
            "feedback": 1
          },
          "opportunity_for_improvement": "Lorem ipsum dolor sit amet",
          "comments": "Lorem ipsum dolor sit amet",
          "would_hire": true,
          "would_hire_comments": "Lorem ipsum dolor sit amet"
        },
        "status": "requested",
        "percent_complete": 100,
        "valid_sections": {
          "relationship": true,
          "ratings": true,
          "recommendations": true,
          "your_info": true
        },
        "token_sent": "2017-08-23T17:12:18+00:00",
        "token_resend": "2017-08-30T17:12:18+00:00",
        "can_resend": false,
        "link_login": "http://localhost:4200/referees/login",
        "link_decline": "http://localhost:4200/referees/decline",
        "created_at": "2017-08-08T17:13:50+00:00",
        "updated_at": "2017-08-08T17:13:50+00:00",
        "referee": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "references": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Request Application Reference
POST/api/applications/{application_id}/references

Request a Reference for an Application/Applicant

Example URI

POST /api/applications/1/references
URI Parameters
HideShow
application_id
number (required) Example: 1

The Application ID of the Application References being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "first_name": "John",
  "last_name": "Doe",
  "email": "john.doe@somewhere.com",
  "request": "Please provide me with a reference!"
}
Schema
{
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "request": {
      "type": "string"
    }
  },
  "required": [
    "first_name",
    "last_name",
    "email",
    "request"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Application References",
  "errors": [],
  "status": 200,
  "data": {
    "references": [
      {
        "id": 1,
        "application_id": 1,
        "referee_id": 96,
        "request": "Nemo quis nihil accusantium voluptatem.",
        "reference": {
          "profile": {
            "position": "Professor",
            "organization": "Last Chance U",
            "location": "Ottawa, ON",
            "phone": "613"
          },
          "relationship": {
            "faculty": true,
            "preceptor": false,
            "employer": true,
            "other": true,
            "other_description": "Other relationship value"
          },
          "known": "post-secondary",
          "hours": "10",
          "ratings": {
            "independence": 1,
            "problem_solving": 1,
            "communication": 1,
            "adpatability": 1,
            "professionalism": 1,
            "feedback": 1
          },
          "opportunity_for_improvement": "Lorem ipsum dolor sit amet",
          "comments": "Lorem ipsum dolor sit amet",
          "would_hire": true,
          "would_hire_comments": "Lorem ipsum dolor sit amet"
        },
        "status": "requested",
        "percent_complete": 100,
        "valid_sections": {
          "relationship": true,
          "ratings": true,
          "recommendations": true,
          "your_info": true
        },
        "token_sent": "2017-08-23T17:12:18+00:00",
        "token_resend": "2017-08-30T17:12:18+00:00",
        "can_resend": false,
        "link_login": "http://localhost:4200/referees/login",
        "link_decline": "http://localhost:4200/referees/decline",
        "created_at": "2017-08-08T17:13:50+00:00",
        "updated_at": "2017-08-08T17:13:50+00:00",
        "referee": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "references": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  422
HideShow
Headers
Content-Type: application/json
Body
There can be many reasons to get this response, invalid parameters/data sent, but also the Application may be at the max number, or the proposed Referee may have already referred this application.
Response  500
HideShow
Headers
Content-Type: application/json

Programs

Methods to deal with Programs

Programs

Get Programs
GET/api/programs

Return a list of Programs, only Applicants and Admins can do this

Example URI

GET /api/programs
Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Programs",
  "errors": [],
  "status": 200,
  "data": {
    "programs": [
      {
        "id": 1,
        "name": "Mercy Hospital",
        "address1": "123 Oak Street",
        "address2": "Unit 101",
        "organization": "MARSWorks Inc.",
        "city": "Ottawa",
        "state": "ON",
        "country": "CA",
        "postal_code": "K1T 1W6",
        "phone": "6138606277 x. 203",
        "url": "https://cshp.ca/programs/program",
        "extra_uploads": "Please submit a nice cover letter and send it to us!",
        "positions": 10,
        "directors": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "coordinators": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "programs": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Program

Get Program
GET/api/programs/{program_id}

Return a specific Program’s details, only Applicants and Admins can do this, or a Program User for this Program

Example URI

GET /api/programs/1
URI Parameters
HideShow
program_id
number (required) Example: 1

The Program ID of the details being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Program",
  "errors": [],
  "status": 200,
  "data": {
    "programs": [
      {
        "id": 1,
        "name": "Mercy Hospital",
        "address1": "123 Oak Street",
        "address2": "Unit 101",
        "organization": "MARSWorks Inc.",
        "city": "Ottawa",
        "state": "ON",
        "country": "CA",
        "postal_code": "K1T 1W6",
        "phone": "6138606277 x. 203",
        "url": "https://cshp.ca/programs/program",
        "extra_uploads": "Please submit a nice cover letter and send it to us!",
        "positions": 10,
        "directors": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "coordinators": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "programs": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Update Program
PUT/api/programs/{program_id}

Update a Program - only a Director assigned to this Program, and an Admin can do this!

Example URI

PUT /api/programs/1
URI Parameters
HideShow
program_id
number (required) Example: 1

The Program ID of the details being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "name": "Hello, world!",
  "address1": "Hello, world!",
  "city": "Hello, world!",
  "state": "Hello, world!",
  "country": "Hello, world!",
  "postal_code": "Hello, world!",
  "phone": "Hello, world!",
  "url": "Hello, world!",
  "positions": 1,
  "extra_uploads": "Hello, world!"
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "address1": {
      "type": "string"
    },
    "city": {
      "type": "string"
    },
    "state": {
      "type": "string"
    },
    "country": {
      "type": "string"
    },
    "postal_code": {
      "type": "string"
    },
    "phone": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "positions": {
      "type": "number",
      "description": "Must be between 1 and 100"
    },
    "extra_uploads": {
      "type": "string"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Program",
  "errors": [],
  "status": 200,
  "data": {
    "programs": [
      {
        "id": 1,
        "name": "Mercy Hospital",
        "address1": "123 Oak Street",
        "address2": "Unit 101",
        "organization": "MARSWorks Inc.",
        "city": "Ottawa",
        "state": "ON",
        "country": "CA",
        "postal_code": "K1T 1W6",
        "phone": "6138606277 x. 203",
        "url": "https://cshp.ca/programs/program",
        "extra_uploads": "Please submit a nice cover letter and send it to us!",
        "positions": 10,
        "directors": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "coordinators": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "programs": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Member Programs

Member's Program
GET/api/users/{user_id}/programs

Return the list of Programs to which this user has been assigned

Example URI

GET /api/users/1/programs
URI Parameters
HideShow
user_id
number (required) Example: 1

The Member fetching a list of Programs

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Programs for this Member",
  "errors": [],
  "status": 200,
  "data": {
    "programs": [
      {
        "id": 1,
        "name": "Mercy Hospital",
        "address1": "123 Oak Street",
        "address2": "Unit 101",
        "organization": "MARSWorks Inc.",
        "city": "Ottawa",
        "state": "ON",
        "country": "CA",
        "postal_code": "K1T 1W6",
        "phone": "6138606277 x. 203",
        "url": "https://cshp.ca/programs/program",
        "extra_uploads": "Please submit a nice cover letter and send it to us!",
        "positions": 10,
        "directors": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "coordinators": [
          {
            "id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@marsworks.com",
            "has_payment_token": false,
            "created_at": "2017-04-17T21:24:23+00:00"
          }
        ],
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "programs": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Payments

Methods to deal with Payments

Payments

Get Payments
GET/api/payments

Example URI

GET /api/payments
Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Returned Payments",
  "errors": [],
  "status": 200,
  "data": {
    "payments": [
      {
        "id": 1,
        "user_id": 1,
        "application_id": 1,
        "amount": 75,
        "fee": 1.75,
        "card_details": {
          "brand": "Visa",
          "last4": "1234",
          "exp_year": 2019,
          "exp_month": 11
        },
        "description": "PRAMS Registration Fee",
        "charge_id: `ch_1AuXOqCb8oe0EMPlWFvPXgic`": "",
        "created_at": "2017-04-17T21:24:23+00:00",
        "payer": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "payments": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Application Payments

Make Payment
POST/api/applications/{application_id}/payments

Buy credits for Applying to Programs, or the BC Exception, or the initial Registration Fee.

If this is the initial Registration Fee…credits is ignored and set to the default value you get when you Register

email presumably comes from what they entered into the Stripe form?

token if they already have a Stripe Token saved in their record, this can be ommitted. Look for has_payment_token in the Applicant information returned with the Application.

Example URI

POST /api/applications/1/payments
URI Parameters
HideShow
application_id
number (required) Example: 1

The Application ID of the Application being fetched

Request
HideShow
Headers
Authorization: Bearer JWTToken
Body
{
  "email": "sean+applicant@marsworks.com",
  "token": "tok_1AuXOqCb8oe0EMPlWFvPXgic",
  "credits": 1,
  "bc_exception": true
}
Schema
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "token": {
      "type": "string"
    },
    "credits": {
      "type": "number"
    },
    "bc_exception": {
      "type": "boolean"
    }
  },
  "required": [
    "email",
    "credits",
    "bc_exception"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Payment Successful",
  "errors": [],
  "status": 200,
  "data": {
    "applications": [
      {
        "id": 1,
        "user_id": 1,
        "application": {
          "profile": {
            "title": "Mr.",
            "first_name": "Steve",
            "last_name": "Rogers",
            "former_last_name": "Johnston",
            "preferred_name": "Smith",
            "address": {
              "city": "Ottawa",
              "state": "ON",
              "country": "CA"
            },
            "phone": "6138606277 x. 203",
            "phone2": "6138606277",
            "equity_seeking_group": "First Nations",
            "equity_seeking_group_other": "Some other value",
            "sharing_consent": true
          },
          "canadian_citizen": true,
          "licensed": {
            "status": true,
            "expected_date": "2017-04-17T21:24:23+00:00"
          },
          "education": [
            {
              "school": "Carleton University",
              "type": "post-secondary",
              "program": "Bachelor of Commerce",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "achievement": "Certificate",
              "transcript_id": 100
            }
          ],
          "pharmacy_education": {
            "directed_studies": true,
            "courses": [
              {
                "course": "Putting Pills into bottles",
                "description": "Lorem ipsum dolor sit amet"
              }
            ],
            "experiential_placements": true,
            "placements": [
              {
                "name": "MARSWorks Inc.",
                "course_number": "42.101",
                "facility_name": "Mercy Hospital",
                "site_type": "Hospital Pharmacy",
                "description": "Lorem ipsum dolor sit amet",
                "length": "4 months",
                "status": "complete",
                "skill": "Lorem ipsum dolor sit amet"
              }
            ]
          },
          "work_experience": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "community_service": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "leadership_experience": [
            {
              "position": "Application Developer",
              "organization": "MARSWorks Inc.",
              "address": {
                "city": "Ottawa",
                "state": "ON",
                "country": "CA"
              },
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "hours": "40 / week",
              "supervisor": "John Doe",
              "supervisor_phone": "613-555-1212",
              "supervisor_email": "supervisor@somewhere.com",
              "duties": "lorem ipsum"
            }
          ],
          "extracurricular": [
            {
              "name": "Choir",
              "organization": "MARSWorks Inc.",
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "description": "lorem ipsum",
              "hours": "4 / week"
            }
          ],
          "publications": "lorem ipsum",
          "memberships": [
            {
              "start_date": "2010-09-01",
              "end_date": "2013-04-30",
              "description": "lorem ipsum"
            }
          ],
          "awards": [
            {
              "name": "Walkley Road Scholarship",
              "description": "Lorem ipsum dolor sit amet",
              "date": "2019-01-01"
            }
          ],
          "essay": "lorem ipsum"
        },
        "percent_completed": 100,
        "credits": 8,
        "paid": true,
        "bc_exception_paid": false,
        "empty_sections": {
          "status": false,
          "education": false,
          "pharmacy_education": false,
          "work experience": false,
          "community service": false,
          "leadership experience": false,
          "essay": false
        },
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "applications": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Utility

Utility Methods to help with the app

Get App Phases

Get Phases
GET/api/phases

Return a list of the key app Phase “End” times, along with the current “Phase” we’re actually in right now

Example URI

GET /api/phases
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Application Phases Returned",
  "errors": [],
  "status": 200,
  "data": {
    "phases": {
      "application": "2017-10-16T00:00:00+00:00",
      "rankings": "2018-01-08T00:00:00+00:00",
      "match": "2018-03-31T00:00:00+00:00"
    },
    "current": "application",
    "match_status: `not_started`": "tentative"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "phases": {
          "type": "object",
          "properties": {
            "application": {
              "type": "string"
            },
            "rankings": {
              "type": "string"
            },
            "match": {
              "type": "string"
            }
          }
        },
        "current": {
          "type": "string",
          "description": "Possible values can also include `ranking` and `match`\nPossible values can also include `ranking` and `match`"
        },
        "match_status: `not_started`": {
          "type": "string",
          "enum": [
            "tentative",
            "complete"
          ]
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  500
HideShow
Headers
Content-Type: application/json

Get Countries

Get Countries
GET/api/countries

Return a list of the Countries we are using in this application for user Profiles

Example URI

GET /api/countries
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "List of countries returned",
  "errors": [],
  "status": 200,
  "data": {
    "countries": [
      {
        "id": "CA",
        "name": "Canada"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "countries": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  500
HideShow
Headers
Content-Type: application/json

Get States

Get Provinces or States
GET/api/states/{country_id}

Return a list of the Provinces or States for a supplied Country, we are using in this application for user Profiles

Example URI

GET /api/states/CA
URI Parameters
HideShow
country_id
string (required) Example: CA

The country for which you wish to see province/states

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "List of states returned",
  "errors": [],
  "status": 200,
  "data": {
    "states": [
      {
        "id": "BC",
        "name": "British Columbia"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "states": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

App Stats

Get App Stats
GET/api/admin/stats

Return some stats to display on the Admin Dashboard

Example URI

GET /api/admin/stats
Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Retrieved Application Data",
  "errors": [],
  "status": 200,
  "data": {
    "applications": 486,
    "applicantsComplete": 354,
    "applicantsIncomplete": 132,
    "applicantsByProvince": {
      "CA": [
        {
          "id": "BC",
          "count": 112
        },
        {
          "id": "ON",
          "count": 114
        }
      ],
      "US": [
        {
          "id": "NY",
          "count": 1
        }
      ]
    },
    "registrationPayments": 353,
    "bcExceptionPayments": 180,
    "creditsPurchased": 546,
    "rankingTotals": [
      {
        "id": "1",
        "count": 1
      },
      {
        "id": "2",
        "count": 5
      }
    ],
    "rankingsByProgramProvince": [
      {
        "id": "BC",
        "count": 112
      },
      {
        "id": "ON",
        "count": 114
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "applications": {
          "type": "number"
        },
        "applicantsComplete": {
          "type": "number"
        },
        "applicantsIncomplete": {
          "type": "number"
        },
        "applicantsByProvince": {
          "type": "object",
          "properties": {
            "CA": {
              "type": "array"
            },
            "US": {
              "type": "array"
            }
          }
        },
        "registrationPayments": {
          "type": "number"
        },
        "bcExceptionPayments": {
          "type": "number"
        },
        "creditsPurchased": {
          "type": "number"
        },
        "rankingTotals": {
          "type": "array"
        },
        "rankingsByProgramProvince": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Match

Retrieve the Match
GET/api/admin/match{?sort}

Retrieves the Match - may be empty if it hasn’t been run yet!

Example URI

GET /api/admin/match?sort=program
URI Parameters
HideShow
sort
string (required) Example: program

Sorts by applicant by default, but by program if that value is provided

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Match Data Returned",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "application_id": 1,
        "program_id": 1,
        "program_rank": 1,
        "applicant_rank": 1,
        "no_interview": false,
        "status": "prematch",
        "status_description": "Pre-Match",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        },
        "program": {
          "id": 1,
          "name": "Mercy Hospital",
          "address1": "123 Oak Street",
          "address2": "Unit 101",
          "organization": "MARSWorks Inc.",
          "city": "Ottawa",
          "state": "ON",
          "country": "CA",
          "postal_code": "K1T 1W6",
          "phone": "6138606277 x. 203",
          "url": "https://cshp.ca/programs/program",
          "extra_uploads": "Please submit a nice cover letter and send it to us!",
          "positions": 10,
          "created_at": "2017-04-17T21:24:23+00:00",
          "updated_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ],
    "match_status: `not_started`": "tentative"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        },
        "match_status: `not_started`": {
          "type": "string",
          "enum": [
            "tentative",
            "complete"
          ]
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Run the Match
POST/api/admin/match

Runs the Match - may just retrieve it if its already been run!

Example URI

POST /api/admin/match
Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Match Data Returned",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "application_id": 1,
        "program_id": 1,
        "program_rank": 1,
        "applicant_rank": 1,
        "no_interview": false,
        "status": "prematch",
        "status_description": "Pre-Match",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        },
        "program": {
          "id": 1,
          "name": "Mercy Hospital",
          "address1": "123 Oak Street",
          "address2": "Unit 101",
          "organization": "MARSWorks Inc.",
          "city": "Ottawa",
          "state": "ON",
          "country": "CA",
          "postal_code": "K1T 1W6",
          "phone": "6138606277 x. 203",
          "url": "https://cshp.ca/programs/program",
          "extra_uploads": "Please submit a nice cover letter and send it to us!",
          "positions": 10,
          "created_at": "2017-04-17T21:24:23+00:00",
          "updated_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ],
    "match_status: `not_started`": "tentative"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        },
        "match_status: `not_started`": {
          "type": "string",
          "enum": [
            "tentative",
            "complete"
          ]
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Reset the Match
DELETE/api/admin/match

Resets the Match

Example URI

DELETE /api/admin/match
Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Match Reset",
  "errors": [],
  "status": 200,
  "data": {
    "match_status: `not_started`": "tentative"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "match_status: `not_started`": {
          "type": "string",
          "enum": [
            "tentative",
            "complete"
          ]
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Match - Confirm

Confirm the Match
GET/api/admin/match/confirm

The match must be in a tentative state, this confirms the match and ends the program for this year.

Example URI

GET /api/admin/match/confirm
Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Match Data Returned",
  "errors": [],
  "status": 200,
  "data": {
    "rankings": [
      {
        "id": 1,
        "application_id": 1,
        "program_id": 1,
        "program_rank": 1,
        "applicant_rank": 1,
        "no_interview": false,
        "status": "prematch",
        "status_description": "Pre-Match",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        },
        "program": {
          "id": 1,
          "name": "Mercy Hospital",
          "address1": "123 Oak Street",
          "address2": "Unit 101",
          "organization": "MARSWorks Inc.",
          "city": "Ottawa",
          "state": "ON",
          "country": "CA",
          "postal_code": "K1T 1W6",
          "phone": "6138606277 x. 203",
          "url": "https://cshp.ca/programs/program",
          "extra_uploads": "Please submit a nice cover letter and send it to us!",
          "positions": 10,
          "created_at": "2017-04-17T21:24:23+00:00",
          "updated_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "rankings": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Matched Applications

Matched Applications
GET/api/admin/matched/applications{?export}

A list of the Applications/Applicants without a match

Example URI

GET /api/admin/matched/applications?export=true
URI Parameters
HideShow
export
string (required) Example: true

Exports the names and email addresses to Excel if this is present

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Matched Applications Returned",
  "errors": [],
  "status": 200,
  "data": {
    "applications": [
      {
        "id": 1,
        "user_id": 1,
        "percent_completed": 100,
        "references_completed": 2,
        "rankings": 4,
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "applications": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Unmatched Applications

Unmatched Applications
GET/api/admin/unmatched/applications{?export}

A list of the Applications/Applicants without a match

Example URI

GET /api/admin/unmatched/applications?export=true
URI Parameters
HideShow
export
string (required) Example: true

Exports the names and email addresses to Excel if this is present

Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Unmatched Applications Returned",
  "errors": [],
  "status": 200,
  "data": {
    "applications": [
      {
        "id": 1,
        "user_id": 1,
        "percent_completed": 100,
        "references_completed": 2,
        "rankings": 4,
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00",
        "applicant": {
          "id": 1,
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@marsworks.com",
          "has_payment_token": false,
          "created_at": "2017-04-17T21:24:23+00:00"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "applications": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Unmatched Programs

Unmatched Programs
GET/api/admin/unmatched/programs

A list of the Programs with 1 or more unfilled positions

Example URI

GET /api/admin/unmatched/programs
Request
HideShow
Headers
Authorization: Bearer JWTToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Unmatched Programs Returned",
  "errors": [],
  "status": 200,
  "data": {
    "programs": [
      {
        "id": 1,
        "name": "Mercy Hospital",
        "address1": "123 Oak Street",
        "address2": "Unit 101",
        "organization": "MARSWorks Inc.",
        "city": "Ottawa",
        "state": "ON",
        "country": "CA",
        "postal_code": "K1T 1W6",
        "phone": "6138606277 x. 203",
        "url": "https://cshp.ca/programs/program",
        "extra_uploads": "Please submit a nice cover letter and send it to us!",
        "positions": 10,
        "filled": 9,
        "created_at": "2017-04-17T21:24:23+00:00",
        "updated_at": "2017-04-17T21:24:23+00:00"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Message for developers, not for display to App users"
    },
    "errors": {
      "type": "array",
      "description": "Localized error messages if any are relevant, to display to the App user"
    },
    "status": {
      "type": "number",
      "description": "HTTP Status code repeated here for some reason"
    },
    "data": {
      "type": "object",
      "properties": {
        "programs": {
          "type": "array"
        }
      },
      "description": "Data and objects appropriate to the API call"
    }
  },
  "required": [
    "status"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  500
HideShow
Headers
Content-Type: application/json

Generated by aglio on 02 Jul 2024