Skip to content

Instantly share code, notes, and snippets.

@benjaminoakes
Last active December 18, 2015 02:44
Show Gist options
  • Save benjaminoakes/b8324ec42e3ebd54e4b9 to your computer and use it in GitHub Desktop.
Save benjaminoakes/b8324ec42e3ebd54e4b9 to your computer and use it in GitHub Desktop.
{
"$schema": "http://json-schema.org/draft-04/hyper-schema",
"id": "schemata/program",
"title": "Program",
"description": "An applicant applies to a **program** at an organization.",
"definitions": {
"href": {
"type": "string",
"description": "Hypertext reference to this resource.",
"pattern": "/api/v1/user_identities/\\d+/programs",
"example": "/api/v1/user_identities/1/programs"
},
"id": {
"description": "Unique identifier of this program.",
"readOnly": true,
"type": "integer"
},
"name": {
"description": "Human-readable name of this program. Likely to be repeated between organizations.",
"readOnly": true,
"example": "Potions",
"type": "string"
},
"organization_name": {
"description": "Human-readable name of organization whose program this is.",
"readOnly": true,
"example": "Hogwarts School of Witchcraft and Wizardry",
"type": ["string", "null"]
}
},
"links": [
{
"description": "List existing programs.",
"href": "/api/v1/user_identity/:user_identity_id/programs",
"method": "GET",
"rel": "self",
"title": "List"
}
],
"type": "object",
"required": ["id", "name", "organization_name"],
"strictProperties": true,
"properties": {
"href": {
"$ref": "/schemata/program#/definitions/href"
},
"programs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"$ref": "/schemata/program#/definitions/id"
},
"name": {
"$ref": "/schemata/program#/definitions/name"
},
"organization_name": {
"$ref": "/schemata/program#/definitions/organization_name"
}
}
}
}
}
}

Program

An applicant applies to a program at an organization.

Attributes

Name Type Description Example
href string Hypertext reference to this resource.
pattern: /api/v1/user_identities/\d+/programs
"/api/v1/user_identities/1/programs"
programs/id integer Unique identifier of this program. 42
programs/name string Human-readable name of this program. Likely to be repeated between organizations. "Potions"
programs/organization_name nullable string Human-readable name of organization whose program this is. "Hogwarts School of Witchcraft and Wizardry"

Program List

List existing programs.

GET /api/v1/user_identity/:user_identity_id/programs

Curl Example

$ curl -n https://api.webadmit.org/api/v1/user_identity/:user_identity_id/programs

Response Example

HTTP/1.1 200 OK
{
  "href": "/api/v1/user_identities/1/programs",
  "programs": [
    {
      "id": 42,
      "name": "Potions",
      "organization_name": "Hogwarts School of Witchcraft and Wizardry"
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment