SPC Digital Library Documentation
GetEvents
Summary
Returns event metadata (and nested presentations, documents and links) filtered by repository code, SEF page name or event id.
Results are camel-cased JSON and ordered by year then startDate.
HTTP
- Method: GET
- Route:
/Api/GetEvents - Example:
/Api/GetEvents?repositoryCode=FAME&SEFPageName=HOF_15
Query parameters
repositoryCode(string, optional)
Limit results to events from the repository with this code. When supplied the method also enforces publish visibility (PublishAtDate == null || PublishAtDate < now).SEFPageName(string, optional)
Filter events with a matchingSEFPageName.eventId(GUID, optional)
Return the single event with this id.
Behavior
- Uses server local time (
DateTime.Now) to evaluatePublishAtDate. - When
repositoryCodeis provided, events are filtered to that repository and only those published (or withoutPublishAtDate) are returned. - If multiple filters are supplied they are combined (AND).
- Results are mapped into a projection and serialized with camelCase (via the controller's
jsonSerializerSettings). - The returned list is ordered by
yearthenstartDate.
Response (200 JSON)
Top-level: JSON array of event objects. Each event contains:
id(GUID)sefPageName(string)year(int?)title(string)siteURL(string)bannerURL(string)venue(string)startDate(datetime)endDate(datetime)publishAtDate(datetime?)description(string)eventTypeId(GUID)dateCreated(datetime)lastModified(datetime)keywords(array): domain keyword objects:id(GUID),code(string),name(string)
presentations(array): only non-deleted presentations, ordered byindex. Each presentation contains:id(GUID)title(string)language(string)presenters(string)organizations(string)reference(string)index(int)dateCreated(datetime)lastModified(datetime)documents(array): presentation documents where!doc.Deleted:id(GUID)name(string)filetype(string)size(int)mimeType(string)url(string) —"https://www.spc.int/digitallibrary/get/{shortId}"md5(string)dateCreated,lastModified(datetime)
links(array):id(GUID),title(string),url(string)
Example request
curl "https://www.spc.int/DigitalLibrary/Api/GetEvents?repositoryCode=FAME&SEFPageName=HOF_15"
Example response (truncated)
[
{
"id": "115645ae-5913-4558-a719-14100164a656",
"sefPageName": "HOF_15",
"year": 2023,
"title": "15th SPC Heads of Fisheries Meeting",
"siteURL": null,
"bannerURL": null,
"venue": null,
"startDate": "2023-03-20T00:00:00",
"endDate": "2023-03-24T00:00:00",
"publishAtDate": null,
"description": "The SPC Heads of Fisheries Meeting provides technical oversight of all SPC work in the field of fisheries and aquaculture(...)",
"eventTypeId": "1730f4fb-37c7-42e0-b11e-ded22246fe49",
"dateCreated": "2023-03-17T14:26:49.073",
"lastModified": "2023-03-17T14:26:49.073",
"keywords": [],
"presentations": [
{
"id": "44178f9e-7ca1-4145-b944-61d0d7601470",
"title": "Day 2 - Progress report against outcomes from HoF14 and RFMM3 \r\n",
"language": "EN",
"presenters": "Terry Opa",
"organizations": "The Pacific Community",
"reference": null,
"index": 201,
"dateCreated": "2023-03-19T18:25:02.563",
"lastModified": "2023-03-19T18:25:02.563",
"documents": [
{
"id": "c5a90318-dc6d-4b8f-904b-cf971a167874",
"name": "Day2_01_IP1.pptx",
"filetype": "PPTX",
"size": 884806,
"mimeType": "application/vnd.openxmlformats",
"url": "https://www.spc.int/digitallibrary/get/kpwma",
"md5": "748b81bcd2af5d074a07c1375391b812",
"dateCreated": "2023-03-19T18:25:19.6",
"lastModified": "2023-03-20T16:31:34.01"
}
],
"links": []
}
]
}
]