gbv / paia

Specification of Patrons Account Information API (PAIA)
http://gbv.github.io/paia
15 stars 12 forks source link

Feature: PAIA info endpoints #76

Open nichtich opened 5 years ago

nichtich commented 5 years ago

patron types can be arbitrary URIs defined anywhere but the ILS backend will likely know best about user types, so it should also make information about it available. Example:

https://example.org/paia/info/patrontype/42

=>

{
  "title": "student"
}

Similar information could be made available for storageid and feeid

nichtich commented 5 years ago

Suggestion: extend PAIA with an additional part PAIA info in addition to PAIA core and PAIA auth.

GET https://example.org/info/

Return an JSON object with information about the PAIA server. Minimum information should be base URL of PAIA core and PAIA auth, if available, for instance:

{
  "core": "https://example.org/core/",
  "auth":  "https://example.org/auth/"
}

GET https://example.org/info/storage/

Return a JSON array with storages supported by the PAIA server or HTTP 501 if this list is not supported. Storages are found in document field storageid

GET https://example.org/info/storage/{storageid}

Return a JSON object describing a storage if this storage is known to the PAIA server or HTTP 501 if storage lookup is not supported or HTTP 404 if the storage is not known. Example:

https://example.org/info/storage/http://uri.gbv.de/organization/isil/DE-999@xxx

{
  "id": "http://uri.gbv.de/organization/isil/DE-999@xxx",
  "description": "Magazin",
  "href": "...optional URL..."
}

GET https://example.org/info/fee/

Return a JSON array with fee types supported by the PAIA server or HTTP 501 if this list is not supported. Fees are found in fee field feeid.

GET https://example.org/info/fee/{feeid}

https://example.org/info/fee/de-999:fee-type:123

{
  "id": "de-999:fee-type:123",
  "description": "Mahngebühr",
  "amount": "1.00 EUR"
}

GET https://example.org/info/user-type/

Return a JSON array with user types supported by the PAIA server or HTTP 501 if this list is not supported. User types are found in patron field type

GET https://example.org/info/user-type/{type}

https://example.org/info/user-type/de-999:user-type:42

{
  "id": "de-999:user-type:42",
  "description": "Studierende"
}

See also #70 for conditions (this includes delivery places aka desks).