# Configuration

Provider API v0.6.7 · 4 operations
Source: https://plasapi.com/provider/v0.6.7/configuration/

What this provider supports and how the vendor should use it, read once per customer and cached. It covers patron login, registration and deletion, payment, search, holdings, content, whether checkout and checkin are available, and where events should be sent.

## Get Open Library API configuration

`GET` `/configuration` · `GetConfiguration`

### Example request

**cURL**

```bash
curl -X GET "$PLAS_BASE_URL/configuration?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?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",
    params={
        "version": "0.6.7",
    },
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
)
data = response.json()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

### Responses

#### `200` Success

`ConfigurationResponseBody`

Example (Generated from the schema):

```json
{
  "circulation": {
    "checkin": {
      "isEnabled": true,
      "offline": {
        "isAllowed": true
      }
    },
    "checkout": {
      "isEnabled": true,
      "offline": {
        "defaultLoanPeriodDays": 28,
        "isAllowed": true
      }
    },
    "securityTags": {
      "isDisabled": false
    }
  },
  "content": {
    "api": {
      "delegated": {
        "url": "https://nordby.bibliotek.example/url"
      }
    },
    "uiLanguages": {
      "default": "nob",
      "supported": [
        "nob"
      ]
    }
  },
  "events": {
    "receiver": "https://app.nordby.bibliotek.example/events"
  },
  "holding": {
    "periodical": {
      "groupOrdering": [
        "year"
      ]
    }
  },
  "patron": {
    "credentials": {
      "changeable": [
        "password"
      ],
      "resettable": [
        "password"
      ]
    },
    "deletion": {
      "identifierTypes": [
        "local"
      ],
      "identityProviders": [
        "norway_id_portal"
      ]
    },
    "fields": [
      {
        "field": "emails",
        "maxNumberOfEmailAddresses": 3,
        "verification": "no_verification"
      }
    ],
    "loanHistory": {
      "blockManuallyAddingLoans": false
    },
    "login": {
      "allowWithoutCredential": false,
      "credentials": [
        "password"
      ],
      "identifierTypes": [
        "local"
      ],
      "identityProviders": [
        "norway_id_portal"
      ]
    },
    "registration": {
      "identifierTypes": [
        "local"
      ],
      "identityProviders": [
        "norway_id_portal"
      ]
    }
  },
  "payment": {
    "initialize": {
      "state": "do_not_use_initialize"
    },
    "methods": [
      {
        "type": "mobile_pay"
      }
    ],
    "partial": false
  },
  "search": {
    "api": {
      "delegated": {
        "url": "https://nordby.bibliotek.example/url"
      }
    },
    "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"
          }
        ]
      }
    }
  },
  "version": "1.0",
  "mainBranch": "nordby-main"
}
```

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

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

Example (Generated from the schema):

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

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

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

## Get content configuration

`GET` `/configuration/content` · `GetContentConfiguration`

### Example request

**cURL**

```bash
curl -X GET "$PLAS_BASE_URL/configuration/content?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/content?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/content",
    params={
        "version": "0.6.7",
    },
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
)
data = response.json()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

### Responses

#### `200` Success

`ConfigurationContentResponseBody`

Example (Generated from the schema):

```json
{
  "uiLanguages": {
    "default": "nob",
    "supported": [
      "nob"
    ]
  }
}
```

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

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

Example (Generated from the schema):

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

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

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

## Register an event receiver

`POST` `/configuration/event/register/receiver` · `RegisterEventReceiver`

Register a URL for receiving events. See the Vendor API for more information about which events.

### Example request

**cURL**

```bash
curl -X POST "$PLAS_BASE_URL/configuration/event/register/receiver?version=0.6.7" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN" \
  -d '{
  "secret": "Qm8x2Lp7Vn4Kt9Rs",
  "url": "https://nordby.bibliotek.example/events/84410"
}'
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/configuration/event/register/receiver?version=0.6.7`, {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
  body: JSON.stringify({
    "secret": "Qm8x2Lp7Vn4Kt9Rs",
    "url": "https://nordby.bibliotek.example/events/84410"
  }),
});
```

**Python**

```python
import os
import requests

response = requests.post(
    f"{os.environ['PLAS_BASE_URL']}/configuration/event/register/receiver",
    params={
        "version": "0.6.7",
    },
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
    json={
        "secret": "Qm8x2Lp7Vn4Kt9Rs",
        "url": "https://nordby.bibliotek.example/events/84410",
    },
)
response.raise_for_status()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

### Request body

`application/json` · required

[`RegisterEventReceiverRequestBody`](https://plasapi.com/provider/v0.6.7/schemas/#RegisterEventReceiverRequestBody)

### Responses

#### `204` Success

No response body.

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

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

Example (Generated from the schema):

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

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

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

## Get search configuration

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

### Example request

**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()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

### Responses

#### `200` Success

`ConfigurationSearchResponseBody`

Example (Generated from the schema):

```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`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)

Example (Generated from the schema):

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

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

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.7/)
