# Work

Provider API v0.6.5 · 2 operationer
Kilde: https://plas.redia.dk/provider/v0.6.5/work/

Ingen beskrivelse i specifikationen.

## Get Works

`GET` `/work` · `GetWorks`

### Parametre

- `work_ids` (i `query`, `array of string`, påkrævet) — A list of work IDs, work IDs should be url encoded and separated by a comma.

That means that, if you have e.g. three work IDs "work-123", "work-456,abcd" and "789101112", they should be sent as: "work_ids=work-123,work-456%2Cabcd,789101112".


Fælles for operationerne: `ui_language`, `version`. [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)

### Svar

- `200` [`GetWorksResponseBody`](https://plas.redia.dk/provider/v0.6.5/schemas/#GetWorksResponseBody) — Success

Fejlsvar: 400 · 401 · 404 — [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)

## Search Works

`GET` `/work/search` · `SearchWorks`

Search the metadata and returns with a list of works. 

It’s expected that the fields that are arrays in the search result are sorted that same way in /work and /publication.

Filters:

- plas.audience.literal (work)
- plas.audience.ageRange (work) 
- plas.audience.ageGroup (work)
- plas.mediaTypes (publication)
- plas.language (work and publication)
- plas.subjects (work)
- plas.genres (work)
- plas.forms (work)
- plas.agent (work)

Facets:  
All facets should also exist (with the same name) as an filter.

- plas.audience.literal
- plas.audience.ageRange
- plas.audience.ageGroup
- plas.mediaTypes
- plas.language
- plas.subjects
- plas.genres
- plas.forms
- plas.agent

Sorting:

- plas.relevance.asc
- plas.relevance.desc (default)
- plas.titles.asc
- plas.titles.desc
- plas.publicationDate.asc
- plas.publicationDate.desc


### Parametre

- `query` (i `query`, `string`, valgfri) — The search query.
- `page` (i `query`, `integer`, valgfri) — Page number (default 1).
- `size` (i `query`, `integer`, valgfri) — Page size (default 10).
It's important to be aware that, the page size here is only a preferred page size, the result set can be both small and greater, depending on the implementation from the LMS provider.
This is important to consider in any product design.

- `facet` (i `query`, [`array of SearchFacetType`](https://plas.redia.dk/provider/v0.6.5/schemas/#SearchFacetType), valgfri) — Return these facets.
- `facet_terms_size` (i `query`, `integer`, valgfri) — Return this number of facet terms for each requested facet (default 10).
- `sort` (i `query`, [`SearchSortingType`](https://plas.redia.dk/provider/v0.6.5/schemas/#SearchSortingType), valgfri) — Sorting
- `filter` (i `query`, `object`, valgfri) — The individual filter values are OR'ed together, and the filter are then AND'ed together. The hole statement will be AND'ed with the given query.

Eg. filter[plas.mediaTypes]=book,cd&filter[plas.subjects]=dance will be made into plas.mediaTypes=(book OR cd) AND plas.subjects=dance

The possible keys in this map are the filters defined in the `/configuration(/search)` endpoint (field: (search->)workSearch->filter->available) and are the list of strings of the `SearchFilterType` type.


Fælles for operationerne: `ui_language`, `version`. [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)

### Svar

- `200` [`SearchWorksResponseBody`](https://plas.redia.dk/provider/v0.6.5/schemas/#SearchWorksResponseBody) — Success

Fejlsvar: 400 · 401 · 404 — [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)
