SPC Digital Library Documentation
GetCollectionDocumentsForCountry
Summary
Returns a paged list of bibliographic entries (and their documents) for a given repository/collection and optional country filter. Applies publish-date filtering and supports sorting, pagination and a hard cap on returned records.
HTTP
- Method: GET
- Route:
/Api/GetCollectionDocumentsForCountry - Query string parameters are used.
Query parameters
repositoryCode(string, optional)
Repository code (e.g.FAME). Limits results to that repository when provided.collectionCode(string, optional)
Collection code (e.g.PROCFish_C). When provided withrepositoryCodethe controller resolves the collection by code+repository; if not found, the result is empty.countryCode(string, optional)
ISO 3166-1 alpha-2 country code. When provided, only biblio entries that include this country are returned.sort(string, optional) — accepted values:CreationDateDesc— order byDateCreatedDESC.CollectionIndexTitle— ifcollectionCodeprovided: order by the collection index then title; otherwise order by title.- default (omitted or any other): order by
YearDESC.
limit(int?, optional)
Shortcut to request up tolimitresults (capped at 100). When set, paging is overridden (pageNumber=1, pageSize=limit).pageSize(int?, optional)
Page size (max 100). Defaults to100if not supplied.pageNumber(int?, optional)
Page number (1-based). Defaults to1if not supplied.
Behavior & constraints
- Only bibliographic entries with at least one non-deleted document and with
PublishAtDate == null || PublishAtDate < noware returned. - If
repositoryCode+collectionCoderesolve to a non-existing collection, the result set is empty. limitandpageSizeare capped at 100.- Returns
nbHits(total matching before paging) and returnedpageSize/pageNumber. - CORS enabled (
AllowCORS) and rate-limited byApiPolicy. - Uses server local time (
DateTime.Now) to evaluatePublishAtDate.
Response (200 JSON)
Top-level object:
nbHits(int) — total matches before pagingpageSize(int) — effective page size returnedpageNumber(int) — current page numberhits(array) — list of bibliographic entries
Each hit contains:
id(GUID)title(string)authors(string)year(int?)reference(string)withDisclaimer(bool)disclaimer_EN(string)disclaimer_FR(string)countries(array of objects):id(GUID),name_EN(string),name_FR(string),code(string)
keywords(array of LOC authority objects):id,name_EN,name_FR(currently"")domainKeywords(array):id,name_EN,name_FR,abbrev_EN,abbrev_FRcollections(array):id,code,name_EN,name_FR,sortIndexlanguages(array):name_EN,name_FR,iso_639_1,iso_639_2documents(array of non-deleted docs) each with:id(GUID),shortId(string),link(url),fileName,fileSize,fileType,mimeType,md5,dateCreated,lastModified,thumbnail(derived blob url)
Example request with curl
curl "https://www.spc.int/DigitalLibrary/Api/GetCollectionDocumentsForCountry?repositoryCode=FAME&collectionCode=PROCFish_C&countryCode=WS&sort=CreationDateDesc&pageSize=25&pageNumber=1"
Example response
{
"nbHits": 1,
"pageSize": 25,
"pageNumber": 1,
"hits": [
{
"id": "57b3a841-734b-4c88-8080-ed246ba5c908",
"title": "Samoa country report : profiles and results from survey work at Manono-Uta, Salelavalu, Vailoa and Vaisala (june 2005 and August/September 2005)",
"authors": "Vunisea A., Friedman K.J., Awira R., Kronen M., Pinca S., Chapman L.B., Magron F., Sauni S., Pakoa K., Lasi F.",
"year": 2008,
"reference": "Vunisea A., Friedman K.J., Awira R., Kronen M., Pinca S., Chapman L.B., Magron F., Sauni S., Pakoa K., Lasi F. 2008. Samoa country report : profiles and results from survey work at Manono-Uta, Salelavalu, Vailoa and Vaisala (june 2005 and August/September 2005). Pacific Regional Oceanic and Coastal Fisheries Development Programme (PROCFish/C/CoFish). Noumea, New Caledonia: Secretariat of the Pacific Community (SPC). 383 p. https://www.spc.int/digitallibrary/get/5qo97",
"withDisclaimer": false,
"disclaimer_EN": null,
"disclaimer_FR": null,
"countries": [
{
"id": "c2e91d11-6b70-45a5-a906-5daff131d90f",
"name_EN": "Samoa",
"name_FR": "Samoa",
"code": "WS"
}
],
"keywords": [
{
"id": "sh2006001547",
"name_EN": "Coral reef fisheries",
"name_FR": ""
},
{
"id": "sh2012000067",
"name_EN": "Reef fisheries",
"name_FR": ""
},
{
"id": "sh85048666",
"name_EN": "Fisheries",
"name_FR": ""
},
{
"id": "sh85081257",
"name_EN": "Marine resources",
"name_FR": ""
},
{
"id": "sh97005440",
"name_EN": "Marine invertebrate populations",
"name_FR": ""
}
],
"domainKeywords": [],
"collections": [
{
"id": "b56d54da-3d25-4c32-9130-12eb7fa8f908",
"code": "FAME_PDH",
"name_EN": "Pacific Data Hub",
"name_FR": "Pacific Data Hub",
"sortIndex": null
},
{
"id": "9048aef4-8136-48a1-9321-a3efc9cae905",
"code": "All_Reports",
"name_EN": "Reports",
"name_FR": "Rapports",
"sortIndex": null
},
{
"id": "18225703-972f-4710-9af5-e018034d2da9",
"code": "PROCFish_C",
"name_EN": "PROCFish/C Reports",
"name_FR": "Rapports PROCFish/C",
"sortIndex": null
}
],
"languages": [
{
"name_EN": "English",
"name_FR": "Anglais",
"iso_639_1": "en",
"iso_639_2": "eng"
}
],
"documents": [
{
"id": "bd054646-8c04-46dc-96e0-b3a6246ec47a",
"shortId": "5qo97",
"link": "https://www.spc.int/digitallibrary/get/5qo97",
"fileName": "PROCFish_2008_SamoaReport.pdf",
"fileSize": 10159466,
"fileType": "PDF",
"mimeType": "application/pdf",
"md5": "05d7b4492f0877629114413971c4af48",
"dateCreated": "2014-05-27T16:49:41.977",
"lastModified": "2014-05-27T16:49:41.977",
"thumbnail": "https://spccfpstore1.blob.core.windows.net/digitallibrary-assets/covers/05/05d7b4492f0877629114413971c4af48.png"
}
]
}
]
}