# Configuration

Search API v0.6.7 · 1 operasjon
Kilde: https://plasapi.com/no/search/v0.6.7/configuration/

What this provider supports for search, read once per customer and cached. It says which filters, facets and sortings are available when searching for works, which UI languages are supported, and how expressions are grouped into works, so the vendor can build its search screens to match.

## Get search configuration

`GET` `/configuration/search` · `GetSearchConfiguration`

### Eksempel på kall

**cURL**

```bash
curl -X GET "$PLAS_BASE_URL/configuration/search?version=0.6.7" \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/configuration/search?version=0.6.7`, {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
});
const data = await response.json();
```

**Python**

```python
import os
import requests

response = requests.get(
    f"{os.environ['PLAS_BASE_URL']}/configuration/search",
    params={
        "version": "0.6.7",
    },
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
)
data = response.json()
```

Verten og tokenet er miljøvariabler: `PLAS_BASE_URL` providerens adresse · `PLAS_TOKEN` et access token.

### Parametere

Felles for operasjonene: `version`. [Se den felles kontrakten på versjonssiden.](https://plasapi.com/no/search/v0.6.7/)

### Svar

#### `200` Success

`ConfigurationSearchResponseBody`

Eksempel (Generert fra skjemaet):

```json
{
  "expression": {
    "clustering": [
      [
        {
          "type": "mediaTypes"
        },
        {
          "type": "language"
        },
        {
          "codes": [
            "trl"
          ],
          "type": "creatorsAndContributors"
        },
        {
          "codes": [
            "nrt"
          ],
          "type": "creatorsAndContributors"
        }
      ]
    ]
  },
  "suggestions": {
    "available": [
      {
        "description": "Only suggest titles for children.",
        "type": "plas.audience.literal"
      }
    ],
    "disabled": false
  },
  "uiLanguages": {
    "default": "nob",
    "supported": [
      "nob"
    ]
  },
  "workSearch": {
    "facet": {
      "available": [
        {
          "description": "Group the results by media type.",
          "type": "plas.audience.literal"
        }
      ]
    },
    "filter": {
      "available": [
        {
          "description": "Only show works available at the chosen branch.",
          "type": "plas.audience.literal"
        }
      ]
    },
    "sorting": {
      "available": [
        {
          "description": "Newest publications first.",
          "type": "plas.relevance.asc"
        }
      ]
    }
  }
}
```

#### `400` The list of errors.

`Errors`

Felles svar, definert én gang for hele API-et. [Se den felles kontrakten på versjonssiden.](https://plasapi.com/no/search/v0.6.7/)

Eksempel (Generert fra skjemaet):

```json
{
  "errors": [
    {
      "code": 200103,
      "info": "200103: invalid/unsupported query parameter value"
    }
  ]
}
```

#### `401` Bearer token invalid, missing, or expired.

Ikke noe innhold i svaret.

Felles svar, definert én gang for hele API-et. [Se den felles kontrakten på versjonssiden.](https://plasapi.com/no/search/v0.6.7/)
