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?type={contact_type}

Collection/Resource/Sub-Collection?Query

Return a modified collection based on the query parameter's value.

This will return all the contacts of the given course that are of contact type X.

On each newly added query parameter, evaluate if it should be structured as a sub-collection in the URI.

Query parameters are rarely used to modify the newly added resource or change the endpoint's behaviour.

Don't pass query parameters in POST requests. Pass data fields as POST parameters instead of query parameters.

This is very uncommon and usually not recommended.

Query parameters are rarely used to modify the newly added resource or change the endpoint's behaviour.

It should be implied that this would replace the entire subset of contacts that match the query.

Don't pass query parameters in PUT requests. Pass data fields as PUT parameters instead of query parameters.

This is uncommon and not recommended.

Query parameters are used to modify the newly added resource or change the endpoint's behaviour.

This would imply modifying a subset of data matching the query.

For example, reordering a large dataset of a course's contacts of a specific type (faster than looping PUT requests).

This is uncommon and not recommended because it's difficult to interpret what the endpoint is doing based on the URI alone.

Deletes all entities that match the query parameter.

For example, delete all the contacts of the given course that are of contact type X.

Use with care.

Previous/courses/{course}/contactsNext/courses/{course}/contacts/{contact}

Last updated 2 years ago