Parameters #
Event API Parameters #
Resource URL
GET https://cornwall365.com/wp-json/wp/v2/event
The following parameters you can pass as a query string in the url to refine your search.
| Name | Required | Description | Values | Default |
|---|---|---|---|---|
| per_page | no | Limit the number of results returned | 1 - 99 | 10 |
| area | no | Limit events to specific area | Area ID | - |
| venue | no | Limit events to a specific venue | Venue ID | - |
| type | no | Limit events to a specific type | Type ID | - |
| event_date | no | Indicates that a date range is included. event_range is also required. |
“range” | - |
| event_range | yes if event_date is present |
The date range URL encoded | YYYYMMDD YYMMDD | - |
IDs
The IDs for all areas, venues and types can be found in the Ids section
Event Examples #
Event Basic defaults #
Make a request for the 10 of the latest events:
https "https://cornwall365.com/wp-json/wp/v2/event" "Authorization: Basic YXBpX3VzZXI6dGhpcyBpcyBhIHRlc3Q="
example response
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 2642
Content-Type: application/json; charset=UTF-8
Date: Thu, 14 Oct 2021 15:04:08 GMT
allow: GET
vary: Accept-Encoding
x-content-type-options: nosniff
x-robots-tag: noindex
x-wp-total: 440
x-wp-totalpages: 440
[ ... ]
Event get a date range #
To get events that are taking place on 14th of October 2021 to 30th October 2021 :
https "https://cornwall365.com/wp-json/wp/v2/event?event_date=range&event_range=20211014%2C20211030" "Authorization: Basic YXBpX3VzZXI6dGhpcyBpcyBhIHRlc3Q="
example response
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 22
Content-Type: application/json; charset=UTF-8
Date: Thu, 14 Oct 2021 16:21:42 GMT
allow: GET
vary: Accept-Encoding
x-content-type-options: nosniff
x-robots-tag: noindex
x-wp-total: 0
x-wp-totalpages: 0
[ ... ]
Return All Events for an area #
The following example URL will return all of the events for an area, and all associated child areas.
Ensure you replace the {Area ID} with your chosen area.
Resource URL
GEThttps://cornwall365.com/wp-json/wp/v2/event?area[terms][0]={Area ID}&area[include_children]=true
The following parameters can be passed in addition query string in the url to refine your search.
| Name | Required | Description | Values | Default |
|---|---|---|---|---|
| per_page | no | Limit the number of results returned | 1 - 99 | 10 |
| type | no | Limit events to a specific type | Type ID | - |
| event_date | no | Indicates that a date range is included. event_range is also required. |
“range” | - |
| event_range | yes if event_date is present |
The date range URL encoded | YYYYMMDD YYMMDD | - |
IDs
The IDs for all areas and types can be found in the Ids section
At Home API Parameters #
Resource URL
GET https://cornwall365.com/wp-json/wp/v2/at-home
The following parameters you can pass as a query string in the url to refine your search.
| Name | Required | Description | Values | Default |
|---|---|---|---|---|
| per_page | no | Limit the number of results returned | 1 - 99 | 10 |
| collection | no | Limit events to a specific collection | Collection ID | - |
| genre | no | Limit events to a specific genre | Genre ID | - |
| media_type | no | Limit events to a specific media type | Type ID | - |
IDs
The IDs for all collections, genres and media types can be found in the Ids section
At Home Examples #
At Home Basic defaults #
Make a request for the 10 of the latest events:
https "https://cornwall365.com/wp-json/wp/v2/at-home" "Authorization: Basic YXBpX3VzZXI6dGhpcyBpcyBhIHRlc3Q="
example response
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 2642
Content-Type: application/json; charset=UTF-8
Date: Thu, 14 Oct 2021 15:04:08 GMT
allow: GET
vary: Accept-Encoding
x-content-type-options: nosniff
x-robots-tag: noindex
x-wp-total: 440
x-wp-totalpages: 440
[ ... ]
Making requests from the command line?
We recommend httpie