Skip to content

Mir@bel upstream quirks

These are behaviors of the Mir@bel API, observed live against https://reseau-mirabel.info/api in version 1.6.5 and checked against the OpenAPI description that /api/openapi.json serves. Where a quirk affects bibliofabric.mirabel, the behavior of the client is noted.

Booleans travel as 1 and 0

The OpenAPI description types actif, possession, and abonnement as booleans, but the API rejects true and false with HTTP 400 ("Arguments non-valides", the offending field named in fields). The accepted spellings are 1 and 0. bibliofabric.mirabel serializes every filter model with 1/0 instead of the core default true/false.

The route list differs from common third-party descriptions

The API serves /titres, /titres/{id}, /revues/{id}, /editeurs/{id}, /editeurs/idref/{idref}, /acces/revue, /acces/titres, /themes, /themes/revue/{id}, /themes/titre/{id}, /themes/grappe/{id}, and the three partner routes /mes/acces, /mes/acces/changes, /mes/titres. There is no platform or resource listing route and no publisher search; descriptions that name /journals, /publishers, or /platforms routes do not match the live API.

/revues/{id} answers a bare object

The OpenAPI description wraps the answer as {"revue": ...}; the live API returns the Revue fields (id, dermodif, derverif, titres) at the top level. /editeurs/{id} does wrap (editeur plus relations_titres), as described.

Answers are bare JSON, with no envelope

List routes answer a bare JSON array and detail routes answer a bare JSON object. No route reports a matched total or page metadata, so Page.total is always None and count() is not offered on any resource. /titres caps each answer at 1000 records; the offset parameter, in steps of 1000, walks further.

Unknown query parameters answer 400

A parameter the route does not know produces HTTP 400 with the offending name in fields. Filter models therefore use extra="forbid": a typo in a filter name fails client-side before any request.

The text filter titre ignores the leading article

titre=Monde and titre=Le Monde match the same records. "Monde%" anchors the match at the start of the title; without a %, the match runs anywhere in the title. The text needs at least 3 characters.

Merged ids answer 3xx with a JSON body

/titres/{id}, /revues/{id}, and /editeurs/{id} answer a merged id with an HTTP 3xx status and a JSON body {code, nouvelid, url} naming the surviving record. The body carries no Location-style follow instruction that httpx could act on, so bibliofabric.mirabel reads nouvelid and re-requests the new id, up to three hops.

Error bodies are JSON with the offending field named

Errors answer {"code", "message", "fields", "details"} where fields names the rejected parameter and details carries specifics. A request without any filter criterion answers 400 on /acces/revue, but the same omission on /acces/titres answers HTTP 500 with a non-JSON body. bibliofabric.mirabel rejects a criterion-less call client-side on both routes.

Partner keys unlock extra fields

The partenaire query parameter carries the private key a Mir@bel partner activates on their administration page. With a key, the access routes add urlproxy and identifiantpartenaire to each record, private grappes answer /themes/grappe/{id}, and the three /mes/ routes open. The key travels as a query parameter; set it with MIRABEL_PARTNER_KEY.

Data notes

  • Titre.prefixe holds the leading article ("Le "); titre carries the name without it. full_title on the model joins the two.
  • evaluation_par_pairs.statut is documented as a string, but live records also carry the boolean true; the model accepts both.
  • liens is deprecated upstream in favor of liensext, which holds [url, label] pairs. Both still appear in records.
  • /titres and /mes/titres accept unfiltered queries; /acces/* routes require at least one criterion.