Search Shifts
This endpoint allows for the efficient searching and filtering of shift records based on specified query parameters such as title, timing, capacity, opportunity, category, and created date. It is designed to support operations that require accessing detailed shift information quickly and effectively.
Endpoint and Usage:
Endpoint: GET /api/shifts/search/
Base URL: https://api.vomevolunteer.com
Query Parameters:
Core Filters
id(uuid): Filters shifts by ID.title(string): Filters shifts by title.shift_title(string): Alias fortitle.description(string): Filters shifts by description.shift_description(string): Alias fordescription.created_at(string, ISO-8601): Filters shifts by exactcreated_at.created_at.gt(string, ISO-8601): Filters bycreated_at > value.created_at.gte(string, ISO-8601): Filters bycreated_at >= value.created_at.lte(string, ISO-8601): Filters bycreated_at <= value.created_at.lt(string, ISO-8601): Filters bycreated_at < value.created_date(string, ISO-8601 date): Filters by the date portion ofcreated_at.created_on(string, ISO-8601 date): Alias forcreated_date.created_date.gt/created_on.gt: Filters by created date greater than value.created_date.gte/created_on.gte: Filters by created date greater than or equal to value.created_date.lt/created_on.lt: Filters by created date less than value.created_date.lte/created_on.lte: Filters by created date less than or equal to value.ordering(string): Sorts results bycreated_at,shift_start_at,shift_end_at, orspots, in ascending or descending order.
Shift Timing Filters
shift_date(string, ISO-8601 date): Filters by the date portion ofshift_start_at.date(string, ISO-8601 date): Alias forshift_date.shift_date.gt/date.gt: Filters by shift date greater than value.shift_date.gte/date.gte: Filters by shift date greater than or equal to value.shift_date.lt/date.lt: Filters by shift date less than value.shift_date.lte/date.lte: Filters by shift date less than or equal to value.shift_start_at(string, ISO-8601): Filters by exact shift start timestamp.shift_start_at.gt,shift_start_at.gte,shift_start_at.lt,shift_start_at.lte: Range filters for shift start timestamp.shift_start_time(string): Filters by the time portion ofshift_start_at.start_time(string): Alias forshift_start_time.shift_start_time.gt,shift_start_time.gte,shift_start_time.lt,shift_start_time.lte: Range filters for shift start time.shift_end_at(string, ISO-8601): Filters by exact shift end timestamp.shift_end_at.gt,shift_end_at.gte,shift_end_at.lt,shift_end_at.lte: Range filters for shift end timestamp.shift_end_time(string): Filters by the time portion ofshift_end_at.end_time(string): Alias forshift_end_time.shift_end_time.gt,shift_end_time.gte,shift_end_time.lt,shift_end_time.lte: Range filters for shift end time.
Capacity Filters
spots(integer): Filters shifts by exact spot count.spots.gt(integer): Filters shifts byspots > value.spots.gte(integer): Filters shifts byspots >= value.spots.lt(integer): Filters shifts byspots < value.spots.lte(integer): Filters shifts byspots <= value.
Opportunity and Category Filters
opportunity.id(uuid): Filters by related opportunity ID.opportunity_id(uuid): Alias foropportunity.id.opportunity.title(string): Filters by related opportunity title.opportunity_title(string): Alias foropportunity.title.category.id(uuid): Filters by related category ID.category_id(uuid): Alias forcategory.id.category.title(string): Filters by related category title.category_title(string): Alias forcategory.title.
Sample Requests
Authorization:
Requests to this endpoint require an API-KEY in the header for authentication.
Response Structure:
The response from this endpoint returns a paginated list of shifts that match the query parameters, including timing, spot counts, and the public share URL for each shift.
Example Response Object:
Example Response Structure
Summary Information
count: Total number of matching shifts.next: URL for the next page of results, ornull.previous: URL for the previous page of results, ornull.
Shift Object
id: Unique ID of the shift.created_at: Created timestamp of the shift.shift_start_at: Start timestamp of the shift.shift_end_at: End timestamp of the shift.spots: Total shift capacity.spots_reserved: Number of currently filled spots.spots_available: Number of remaining spots.opportunity: Related opportunity role object with nested category data.shift_location: Derived display location for the shift.shift_title: Stored shift title.shift_description: Stored shift description.share_shift_url: Public share URL for the shift.title: Alias ofshift_title.description: Alias ofshift_description.
Validation Rules
Invalid date, datetime, time, or integer values return
400 Bad Request.orderingonly acceptscreated_at,-created_at,shift_start_at,-shift_start_at,shift_end_at,-shift_end_at,spots, or-spots.If no
orderingis supplied, results default toshift_start_at, thencreated_at.
Example validation error:
Last updated