The public list of events can be accessed using the following endpoint:
https://test.pears.io/events/<org_slug>/events-api/
To use the endpoint replace org_slug with your organization’s public slug (contact PEARS support if you don’t know what it is).
Pagination
Results will be paginated with a default page size of 20. The following query parameters can be used to navigate the paginated results:
- page – The page number to retrieve.
- page_size – The number of results to return per page.
Example:
httpps://test.pears.io/events/<org_slug>/events-api/?page=2&page_size=10
This will return the second page of results with 10 events per page.
The following fields related to pagination are included:
- next – The URL to retrieve the next page of results.
- previous – The URL to retrieve the previous page of results.
- count – The total number of results.
- num_pages – The total number of pages.
- page_size – The number of results per page.
- current_page_num – The current page number.
Ordering
In order to order the results, the following query parameter can be used:
- ordering – The field to order the results by. Prefix the field with a “–” to order in descending order.
Example:
https://test.pears.io/events/<org_slug>/events-api/?ordering=-start_date
This will return the results ordered by the start_date field in descending order.
Results can be ordered by the following fields:
- title – The title of the event.
- start_date – The date and time the event starts.
- created_at – The date and time the event was created.
- modified_at – The date and time the event was last modified.
Search
The following query parameter can be used to search for events:
- q – The search to filter events by title.
Example:
https://test.pears.io/events/<org_slug>/events-api/?q=agriculture
Filtering
The following query parameter can be used to filter the results:
- unit – The unique identifier for the unit associated with the event.
- has_fee – A boolean indicating if the event has a fee.
- zip_code – The zip code associated with the event.
- is_virtual – true if the event is virtual, false if the event is in person.
- max_range – The maximum range of the event.
Example:
https://test.pears.io/events/<org_slug>/events-api/?unit=1&
has_fee=true&zip_code=66502&is_virtual=false&max_range=50
Fields
The results key in the results will contain the list of events. The following fields are returned for each event:
- id – The unique identifier for the event.
- title – The title of the event.
- summary – A brief description of the event.
- event_image_upload – The unique identifier for the event image.
- event_image_download_url – The URL to download the event image.
- start_date – The date and time the event starts.
- end_date – The date and time the event ends.
- site_display – The name of the location of the event.
- is_published – A boolean indicating if the event is published.
- is_in_person – A boolean indicating if the event is in person.
- is_virtual – A boolean indicating if the event is virtual.
- created_at – The date and time the event was created.
- modified_at – The date and time the event was last modified.
- confirmation_message – A message to display to the user after they register for the event.
- payment_instructions – Instructions for payment if the event has a fee.
- has_fee – A boolean indicating if the event has a fee.
- time_zone – The time zone of the event.
- display_name – The display name of the event (same as event title).
Example Response:
{
"default_ordering": "",
"ordering": "",
"next": null,
"previous": null,
"count": 3,
"num_pages": 1,
"page_size": 20,
"current_page_num": 1,
"results": [
{
"id": 1,
"title": "The Art and Science of Agricultural Technology (Symposium)",
"summary": "Agricultural Technology stands as a pillar in our quest for advancement and understanding.",
"event_image_upload": 428743,
"event_image_download_url": "http://localhost:8000/uploads/download/428743/",
"start_date": "2024-04-23T00:00:00-05:00",
"end_date": null,
"site_display": "4-H",
"is_published": true,
"is_in_person": true,
"is_virtual": true,
"created_at": "2024-03-11T20:44:40.225542-05:00",
"modified_at": "2024-04-03T08:59:16.416519-05:00",
"confirmation_message": "<p>Thank you for registering for the The Art and Science of Agricultural Technology...",
"payment_instructions": null,
"has_fee": false,
"time_zone": "US/Central",
"display_name": "The Art And Science Of Agricultural Technology (Symposium)"
},
{
"id": 39,
"title": "USD 383 LEGO Robotics After School Program",
"summary": "Join USD 383's LEGO Robotics After School Program and spark your child's passion for STEM through...",
"event_image_upload": 428748,
"event_image_download_url": "http://localhost:8000/uploads/download/428748/",
"start_date": "2024-05-13T00:00:00-05:00",
"end_date": null,
"site_display": "Amanda Arnold Elementary",
"is_published": true,
"is_in_person": true,
"is_virtual": true,
"created_at": "2024-03-20T08:38:50.652326-05:00",
"modified_at": "2024-04-03T15:17:54.641795-05:00",
"confirmation_message": "<p>Thank you for registering for the USD 383 LEGO Robotics After School Program!<br>...",
"payment_instructions": "<p>Please pay using this link:</p><p>https://cashnet.com/234234</p>",
"has_fee": true,
"time_zone": "US/Central",
"display_name": "Usd 383 Lego Robotics After School Program"
},
{
"id": 6,
"title": "Future of Sustainable Agriculture (Conference)",
"summary": "This event serves as a beacon for those intrigued by Sustainable Agriculture, offering an unparalleled...",
"event_image_upload": 428746,
"event_image_download_url": "http://localhost:8000/uploads/download/428746/",
"start_date": "2024-05-27T00:00:00-05:00",
"end_date": null,
"site_display": "ABC community center",
"is_published": true,
"is_in_person": true,
"is_virtual": false,
"created_at": "2024-03-11T20:44:45.142025-05:00",
"modified_at": "2024-04-03T08:59:11.046380-05:00",
"confirmation_message": "<p>Thank you for registering for the Future of Sustainable Agriculture (Conference)!...",
"payment_instructions": null,
"has_fee": true,
"time_zone": "US/Central",
"display_name": "Future Of Sustainable Agriculture (Conference)"
}
]
}