Resources

Update a resource

Changed on

Update an existing resource in the database

patch/resources/{id}

Request

  • Base URL: http://localhost:8080/api/v1
  • URL: http://localhost:8080/api/v1/resources/{id}
  • Auth: none declared

Path parameters

idstring uuid required

ID of the resource to update

Request body

theme_idstring uuid nullable

ID of the theme associated with the resource (optional)

grade_levelinteger nullable

Grade level for the resource (optional). 0 = kindergarten, 1-12 = grades 1-12

weekinteger nullable

Week associated with the resource (optional)

typestring nullable

Type of resource (optional)

titlestring nullable

Title of the resource (optional)

categorystring nullable

Category of the resource (optional)

contentstring nullable

Content/URL of the resource (optional)

Example request

{
  "theme_id": "123e4567-e89b-12d3-a456-426614174000",
  "grade_level": 5,
  "week": 2,
  "title": "Coping with Anxiety",
  "content": "https://example.com/resource"
}

Response

Resource updated successfully

idstring uuid required

Unique identifier for the resource

theme_idstring uuid required

ID of the theme associated with the resource

grade_levelinteger nullable

Grade level for the resource (optional). 0 = kindergarten, 1-12 = grades 1-12

weekinteger nullable

Week associated with the resource (optional)

typestring nullable

Type of resource (optional)

titlestring nullable

Title of the resource (optional)

categorystring nullable

Category of the resource (optional)

contentstring nullable

Content/URL of the resource (optional)

Example response

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "theme_id": "123e4567-e89b-12d3-a456-426614174000",
  "grade_level": 5,
  "week": 2,
  "title": "Reading Exercises: b vs d",
  "content": "https://example.com/resource",
  "theme": {
    "theme_name": "Jungle Adventure",
    "theme_month": 6,
    "theme_year": 2024,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:35:00Z"
  }
}

Changes

    • ●

      removed the request property

    • ●

      removed the optional property from the response with the status

    • ○

      added the new optional request property

    • ○

      added the optional property to the response with the status

    • ▲

      the request property type changed from string to integer

    • ▲

      the response's property type changed from string to integer for status

    • ●

      the request property's max was set to 12.00

    • ●

      the request property's min was set to 0.00