1.33.1 JSON

The API described here is outdated. We recommend switching to the REST API.

General

The Goobi viewer has the option of providing metadata and images for selected records in a JSON document via URL calls in order to present them on a self-defined page, for example.

Configuration

The metadata fields contained in the JSON document can be configured (in addition to statically defined fields such as image URLs):

<webapi>
    <fields>
        <field jsonField="date" luceneField="YEAR" />
        <field jsonField="personsList" luceneField="MD_PERSON" multivalue="true" />
        <field jsonField="institution" luceneField="PARTNERID" />
        <field jsonField="dateCreated" luceneField="MD_DATECREATED" />
        <field jsonField="dateCreatedStart" luceneField="MD_DATECREATEDSTART" />
        <field jsonField="dateCreatedEnd" luceneField="MD_DATECREATEDEND" />
    </fields>
</webapi>

The individual <field> elements each define a metadata field and must contain the following attributes:

Attribute

Description

luceneField

Name of the index field in the Solr index from which the value is read.

multivalue

(optional) If this attribute is set to true, not only the first value found is copied to the JSON document, but all of them.

Usage

The API allows information on plants to be obtained as JSON records via a simple GET URL call. The data records of the hit set each consist of statically defined, as well as optional freely configurable fields.

The following static fields are always included:

Field name

Content

id

Record identifier

title

Record title

dateCreated

Import date of the record into the Goobi viewer

collection

First collection entry for this record

thumbnailUrl

URL to the thumbnail image of the record in (if available) size 100x120px

mediumimage

URL to the thumbnail image of the record in (if available) size 600x500px

url

URL to the image view of

Query

In this mode, the data records are filtered using a self-defined Solr query.

https://viewer.example.org/viewer/rest/records/q/{query}/{sortField}/{sortOrder}/{jsonFormat}/{count}/{offset}/{randomize}/

Example

https://viewer.example.org/viewer/rest/records/q/DC:varia/DATECREATED/desc/datecentric/100/false/

Parameter

Description

query

Solr query definition

count

Maximum number of data records to be delivered (-1 if no restriction desired)

offset

Hit offset (REST only; 0 for no offset)

sortField

Optional (may occur multiple times): Solr sort fields for the hit set ("-" for empty value)

sortOrder

Sorting direction of the datasets for all fields from sortField. Possible values are desc and asc. Default value is asc. ("-" for empty value)

random

Optional: If the value is true, the hit set is sorted randomly. The default value is false. ("-" for empty value)

jsonFormat

Optional: Format of the JSON array. The only possible value is datecentric. In this case, the records are grouped according to their import date. ("-" for empty value)

Count

In this mode, the data records are also filtered using a self-defined Solr query, but only the number of hits found is returned here.

https://viewer.example.org/viewer/rest/records/count/{query}/

‌Example

https://viewer.example.org/viewer/rest/records/count/DC:varia/

Parameter

Description

query

Solr query definition

Timeline

In timeline mode, a random selection of data records is delivered for a display in a timeline or time matrix.

Call with time span

https://viewer.example.org/viewer/rest/records/timematrix/range/{minYear}/{maxYear}/{count}/

Example

https://viewer.example.org/viewer/rest/recorcs/timematrix/range/1900/2000/100/

Calling with your own Solr Query

https://viewer.example.org/viewer/rest/records/timematrix/q/{query}/{count}/

Example

https://viewer.example.org/viewer/rest/records/timematrix/q/ISWORK:true/100/

Parameter

Description

minYear / maxYear

Years from - to, from which data records are to be delivered

q

Definition of own Solr query, replaces minYear / maxYear

count

Optional: Maximum number of data records to be delivered; -1 if no restriction is desired

Authority data

The API allows you to send requests to the intranda standards data service or GND and to receive the standards data records as JSON objects.

https://viewer.example.org/viewer/rest/normdata/get/{url}/{language}/

Example

https://viewer.example.org/viewer/rest/normdata/get/http%3A%2F%2Fd-nb.info%2Fgnd%2F123524652/de/

Parameter

Description

url

Escapte URL to the authority service

language

Optional language; "-" if no preference is given

Last updated