REST service for getting records from raw repo
This service offers the following endpoints:
GET /api/v1/record/{agencyid}/{bibliographicrecordid}
This endpoint returns a JSON document with all data from the corresponding record row. Content is present in both JSON format (contentJSON field) and as byte encoded MarcXchange XML. $ Parameters:
mode - raw | merged | expanded
allow-deleted
exclude-dbc-fields
use-parent-agency
keep-aut-fields
exclude-attribute
GET /api/v1/record/{agencyid}/{bibliographicrecordid}/content
This returns the content of the record as MarcXchange XML.
Parameters:
mode - merged | expanded
allow-deleted
exclude-dbc-fields
use-parent-agency
keep-aut-fields
GET /api/v1/record-entries/{agencyid}/{bibliographicrecordid}/raw
This endpoint returns a JSON document with all data from the corresponding record row entry in its raw form.
Content is presented as MarcJson.
GET /api/v1/record/{agencyid}/{bibliographicrecordid}/exists
Returns a JSON document with a 'value' element which is true is the record is found - otherwise false is returned.
Note that by default this function will only look for active records. To also include deleted record the allow-deleted url param can be used.
Parameters:
allow-deleted
GET /api/v1/record/{agencyid}/{bibliographicrecordid}/meta
Returns a JSON document with a record, but without the content fields.
Parameters:
allow-deleted
GET /api/v1/record/{agencyid}/{bibliographicrecordid}/parents
Returns a list of record ids of all parent records.
GET /api/v1/record/{agencyid}/{bibliographicrecordid}/children
Returns a list of record ids of all child records.
GET /api/v1/record/{agencyid}/{bibliographicrecordid}/siblings-from
Returns a list of record ids of all parent records with same bibliographicrecordid.
GET /api/v1/record/{agencyid}/{bibliographicrecordid}/siblings-to
Returns a list of record ids of all child records with same bibliographicrecordid.
GET /api/v1/record/{agencyid}/{bibliographicrecordid}/relations-from
Returns a list of record ids of all records which this record has relations to.
GET v1/record/{agencyid}/{bibliographicrecordid}/history
Returns a list of list metadata including modified date of all previous versions of the record.
GET v1/record/{agencyid}/{bibliographicrecordid}/{date}
Returns the raw record as it looked on {date}. Date must a 'modified' date from /history
GET /api/v1/records/{agencyid}/{bibliographicrecordid}
This endpoint return a JSON document containing a list of all records which the input record depends on. The format for each record is the same as the /record endpoint.
Parameters:
allow-deleted
exclude-dbc-fields
use-parent-agency
expand
keep-aut-fields
exclude-attribute
for-corepo
GET /api/v1/records/{agencyid}/{bibliographicrecordid}/content
This endpoint returns a MarcXchange collection document containing all records which the input record depends on.
Parameters:
allow-deleted
exclude-dbc-fields
use-parent-agency
expand
keep-aut-fields
for-corepo
POST /api/v1/records/bulk
This endpoint returns a JSON document with a collection of all records from the input. Input is in the form of:
{
"recordIds": [
{"bibliographicRecordId":"19000117","agencyId":191919},
{"bibliographicRecordId":"19029174","agencyId":191919},
{"bibliographicRecordId":"69998402","agencyId":191919}
]
}
Currently, there is no hard upper limit as for how many records can be loaded but the recommended limit is 200.
Parameters:
allow-deleted
exclude-dbc-fields
use-parent-agency
expand
keep-aut-fields
GET /api/v1/agencies
Returns a list of agencies which have at least one record.
GET /api/v1/agency/{agencyid}/recordids
Returns a list of ids on all records for the given agency. Note that the response object can be very large (> 100 MB)
Parameters:
allow-deleted
internal-agency-handling
created-before
created-after
modified-before
modified-after
The endpoints make use of the following parameters:
Mode is used to determine whether the content should be raw, merged or expanded. Mode is applicable to.
Param name: 'mode'
Valid values: 'raw', 'merged', 'expanded'.
Default: 'raw' for record data endpoint, 'merged' for record content endpoint
The allow-deleted param is used to specify whether a record should be returned in case the record is deleted.
Param name: 'allow-deleted'
Valid values: 'true', 'false'
Default: 'false'
If the letter fields (xYY where x is a letter and YY are numbers) should not be returned the exclude-dbc-fields param should be set to true.
Param name: 'exclude-dbc-fields'
Valid values: 'true', 'false'
Default: 'false'
Used by the record content endpoints to define if the content should be expanded in addition to be merged.
Param name: 'expand'
Valid values: 'true', 'false'
Default: 'false'
In case subfields *5 and *6 should not be removed while expanding a record the keep-aut-fields param can be set to true.
Param name: 'keep-aut-fields'
Valid values: 'true', 'false'
Default: 'false'
All DBC enrichments have the same agency regardless the type of record they belong to (e.g. 870970, 870971 or 870979) while make it impossible to determine the type of record only by looking at the enrichment. A way around this is to find the record using 191919 but then overwrite the agency with the parent record.
Setting use-parent-agency to true returns record with the parent agency - not that this should ONLY be used for DBC enrichments, never for FBS enrichments!
Param name: 'use-parent-agency'
Valid values: 'true', 'false'
Default: 'false'
This parameter is used for telling record service to find the most relevant active record. In the case of deleted enrichments it means the active common record is returned. Setting for-corepo to true might mean the returned record is not from the specified agency!
Cases:
Active common record and active enrichment -> Enrichment is returned
Active common record and deleted enrichment -> Common record is returned
Deleted common record and deleted enrichment -> The deleted enrichment is returned
The use case for this parameter is when creating searchable volume records for corepo. If an enrichment agency has a deleted volume record but an active head record the corepo record has to be a combination of the common volume record and the enrichment head record
Param name: 'for-corepo'
Valid values: 'true', 'false'
Default: 'false'
This is used specifically for getting record id pairs with agency 191919 instead of a common agency. The param is used for agency record list. Without internal-agency-handling = true the response will contain sets of bibliographic record id and the input agency id. When internal-agency-handling = true and the agency is one of the DBC common libraries (870970/870971/870979) the response will contain sets of bibliographic record id and agency 191919.
This parameter is used for getting sets of record ids which can be used for either getting merged common records or record ids for queuing.
Param name: 'internal-agency-handling'
Valid values: 'true', 'false'
Default: 'false'
This parameter is used to narrow the amount of returned records for an agency. This parameter can be used in combination with the other -before and -after parameters.
Note that the 'before' parameter selects 'up until' (exclusive) the defined date while 'after' selects from the beginning of the date (inclusive)
Param-name: 'created-before'
Valid values: YYYY-MM-DD
Default: not set
This parameter is used to narrow the amount of returned records for an agency. This parameter can be used in combination with the other -before and -after parameters.
Note that the 'before' parameter selects 'up until' (exclusive) the defined date while 'after' selects from the beginning of the date (inclusive)
Param-name: 'created-after'
Valid values: YYYY-MM-DD
Default: not set
This parameter is used to narrow the amount of returned records for an agency. This parameter can be used in combination with the other -before and -after parameters.
Note that the 'before' parameter selects 'up until' (exclusive) the defined date while 'after' selects from the beginning of the date (inclusive)
Param-name: 'modified-before'
Valid values: YYYY-MM-DD
Default: not set
This parameter is used to narrow the amount of returned records for an agency. This parameter can be used in combination with the other -before and -after parameters.
Note that the 'before' parameter selects 'up until' (exclusive) the defined date while 'after' selects from the beginning of the date (inclusive)
Param-name: 'modified-after'
Valid values: YYYY-MM-DD
Default: not set
If the request was successful and data is returned the status code is 200.
If the request is successful but no data is returned status code 204 is returned
If the request doesn't hit a valid end point 404 Not found is returned
If an unhandled exception occurs status code 500 is returned
GET /api/v1/record/{agencyid}/{bibliographicrecordid}?mode=merged
GET /api/v1/record/{agencyid}/{bibliographicrecordid}/content?mode=expanded
GET /api/v1/records/{agencyid}/{bibliographicrecordid}/content?expand=true&keep-aut-fields=true&use-parent-agency=true
GET /api/v1/agency/{agencyid}/recordids?allow-deleted=false&modified-after={date}&internal-agency-handling=true
This will result in a JSON with a set of record ids, e.g.:
{
"recordIds": [
{
"bibliographicRecordId": "123456789",
"agencyId": 191919
},
{
"bibliographicRecordId": "123456790",
"agencyId": 191919
}
]
}
POST /api/v1/records/bulk?use-parent-agency=true&expand=true&keep-aut-fields=true
Data is of the same format as the output from endpoint above.