Elentra API
  • Introduction
  • Developers
    • Getting Started
    • Quickstart Guide
      • Set up Repositories
      • Validate the setup
      • Exploring the API
      • Creating a new Module
      • Setup Routing
      • Introduction to Postman
      • Create a Controller
      • Using Eloquent Models
      • Input Validation
      • API Resource Authorization
  • Elentra API Standards
    • HTTP Methods & Status Codes
    • Routing & Parameters
      • Example Routing Patterns with HTTP Method
        • /courses/{course}/contacts
        • /courses/{course}/contacts?type={contact_type}
        • /courses/{course}/contacts/{contact}
        • /courses/{course}/syllabus
      • Common Mistakes
        • [GET] /admissions/file-review/file/rubric-score/{cycle_id}/{pool_id}/{subpool_id}
        • [DELETE] /notices/1,2,3
        • [GET] /cbe/curriculum/framework/{framework_id}/hierarchy-by-depth
        • [GET] /admissions/file-review/file/rubric-score/delete/{id}
        • [GET] /portfolio/entries/{entry_id}/get-file
        • [POST] /cbe/curriculum/updateframework
  • Automated Testing
    • Getting Started
      • Setting up a testing environment
      • Running Automated Tests
    • Seed Data
      • Folder Structure
      • Creating Seed Data
    • Functional Tests
      • Creating a Functional Test File
      • Testing HTTP Verbs
        • Creating an HTTP Test
        • GET Requests
        • POST / PUT / DELETE Requests
        • GraphQL Requests
      • Asserting API Response
      • Annotations
    • Code Style Linting
Powered by GitBook
On this page
  1. Elentra API Standards
  2. Routing & Parameters
  3. Example Routing Patterns with HTTP Method

/courses/{course}/contacts/{contact}

Collection/Resource/Sub-Collection/Sub-Resource

Returns the sub-resource.

Not allowed to use POST. In this example, a 404 would be returned.

  • Update or Create a course contact.

  • If {contact} is 1, then the expected behaviour is to do one of the following:

    • Create if no record exists with ID 1.

    • Overwrite if a record exists with ID 1.

  • The request body should not contain an ID for the entity.

  • This should return the ID, if applicable, in the response.

  • Updates a subset of the resource's attributes.

    • Update specific attributes or relationships.

    • Can pass partial data set to update resources.

For example, updating X amount of entities where only a select few attributes need to be updated.

Use with care. PATCH's loose requirements will introduce a higher risk, such as having poor data constraints or difficult-to-read URIs.

Consider using PUT instead of PATCH.

  • Deletes the resource.

    • This can be a soft/hard delete or deactivate/archive.

Previous/courses/{course}/contacts?type={contact_type}Next/courses/{course}/syllabus

Last updated 2 years ago