Skip to content

Latest commit

 

History

History
350 lines (300 loc) · 6.91 KB

assignments.md

File metadata and controls

350 lines (300 loc) · 6.91 KB

Assignments

Represents a task and is description.

Properties

Domain specific

  • id - Unique and stable global identifier
    • mandatory
    • non editable
    • type: number
    • example: 1
  • realeaseDate - Date of release.
    • mandatory
    • editable
    • type: string
    • possible values: 2025/07/05

Media-type Siren

  • class
  • properties
  • entities
  • links
  • actions

Standard

  • item
  • rel

Link Relations

Domain Specific

Standard - IANA

Actions


Success Responses

List Assignments

List all the Assignments that the user has access to.

GET /api/orgs/{orgId}/classrooms/{classId}/assignments
Status:  200 OK
{
  "class": [ "assignments", "collection" ],
  "properties": {
    "pageIndex": 0,
    "pageSize": 1
  },
  "entities": [
    {
      "class": [ "assignment" ],
      "rel": [ "item" ],
      "properties": {
        "id": 123123,
        "releaseDate": "2028/05/04",
      },
      "links": [
        {
          "rel": ["self"],

          "href": "/api/orgs/852/classrooms/123123/assignments/123123"
        }
      ]
    }
  ],
  "links": [
    {
      "rel": ["self"],
      "href": "/api/orgs/852/classrooms/123123/assignments"
    },
    {
    "rel": ["next"],
    "href": "/api/orgs/852/classrooms/123123/assignments?page=1&limit=10"
    },
    {
    "rel": ["prev"],
    "href": "/api/orgs/852/classrooms/123123/assignments?page=1&limit=10"
    },
    {
      "rel": ["organization"],
      "href": "/api/orgs/123123"
    },
    {
      "rel": ["classroom"],
      "href": "api/orgs/3/classrooms/4"
    },
    {
      "rel": ["home"],
      "href": "/api"
    },
    {
      "rel": ["logout"],
      "href": "/api/logout"
    }
  ]
}

Get Assignment (Student)

This returns a single team item. The user must be a part of the classroom to make such request.

GET /api/orgs/{orgId}/classrooms/{classId}/assignments/{assignmentId}
Status:  200 OK
{
  "class": ["assignment"],
  "properties": {
    "id": 123123,
    "releaseDate": "2028/05/04",
  },
  "entities": [
    {
      "class": ["delivery"],
      "rel": ["item"],
      "properties": {
        "id": 9,
        "name": "phase 1",
        "date": "23/03/2022"
      },
      "links": [
        {
          "rel": ["self"],
          "href": "/api/orgs/123123/classrooms/9"
        },
      ]
    }
  ]
  "links": [
    {
      "rel": ["self"],
      "href": "/api/orgs/123123/classrooms/1/assignments/234342"
    },
    {
      "rel": ["home"],
      "href": "/api"
    },
    {
      "rel": ["classroom"],
      "href": "/api/orgs/123123/classrooms/1"
    },
    {
      "rel": ["assignments"],
      "href": "/api/orgs/123123/classrooms/1/assignments"
    },
    {
      "rel": ["logout"],
      "href": "/api/logout"
    }
  ]
}

Get Assignment (Teacher)

This returns a single response. The user must be a part of the classroom to make such request.

GET /api/orgs/{orgId}/classrooms/{classId}/assignments/{assignmentId}
Status:  200 OK
{
  "class": ["assignment"],
  "properties": {
    "id": 123123,
    "releaseDate": "2028/05/04",
  },
  "entities": [
    {
      "class": ["delivery"],
      "rel": ["item"],
      "properties": {
        "id": 9,
        "name": "phase 1",
        "date": "23/03/2022"
      },
      "links": [
        {
          "rel": ["self"],
          "href": "/api/orgs/123123/classrooms/9"
        },
      ]
    }
  ],
  "actions": [
    {
      "name": "create-delivery",
      "title": "Create Delivery",
      "method": "POST",
      "href": "/api/orgs/{orgId}/class/{classId}/assignments/{assignmentId}/deliveries}",
      "type": "application/json",
      "field": [
        {"name": "name", "type": "string"},
        {"name": "date", "type": "string"}
      ]
    },
    {
      "name": "update-assignment",
      "title": "Update Assignment",
      "method": "PUT",
      "href": "/api/orgs/{orgId}/class/{classId}/assignments{assignmentId}",
      "type": "application/json",
      "field": [
        {"name": "releaseDate", "type": "string"},
        {"name": "cId", "type": "number"},
        {"name": "description", "type": "string"}
      ]
    },
    {
    "name": "delete-assignment",
    "title": "Delete Assignment",
    "method": "DELETE",
    "href": "/api/orgs/{orgId}/class/{classId}/assignments/{assignmentId}"
    }
  ],
  "links": [
    {
      "rel": ["self"],
      "href": "/api/orgs/123123/classrooms/1/assignments/123123"
    },
    {
      "rel": ["home"],
      "href": "/api"
    },
    {
      "rel": ["classroom"],
      "href": "/api/orgs/123123/classrooms/1"
    },
    {
      "rel": ["assignments"],
      "href": "/api/orgs/123123/classrooms/1/assignments"
    },
    {
      "rel": ["logout"],
      "href": "/api/logout"
    }
  ]
}

Error Responses

Bad Request

Used in requests that return both collection and individual items.

Status: 400 Bad Request
{
  "type": "https://github.com/i-on-project/teams/blob/main/docs/api/problems/bad_request.md",
  "title": "The request parameters are invalid.",
  "status": 400,
  "detail": "Some parameters are missing or are of an invalid type."
}

Unauthorized

Used in requests that return both collection and individual items.

Status: 401 Unauthorized
{
  "type": "https://github.com/i-on-project/teams/blob/main/docs/api/problems/unauthorized.md",
  "title": "The request parameters are invalid.",
  "status": 401,
  "detail": "Some parameters are missing or are of an invalid type."
}

Not Found

Used only in requests that return individual items.

Status: 404 Not Found
{
  "type": "https://github.com/i-on-project/teams/blob/main/docs/api/problems/not_found.md",
  "title": "The request parameters are invalid.",
  "status": 404,
  "detail": "Some parameters are missing or are of an invalid type."
}

Conflict

Used in requests that return both collection and individual items.

Status: 409 Conflict
{
  "type": "https://github.com/i-on-project/teams/blob/main/docs/api/problems/conflict.md",
  "title": "There is a conflict with the request.",
  "status": 409,
  "detail": "There is a conflict with the request because the resource already exists."
}