OpenFolia

List retrieval chunks

GET
/chunks

The content as retrieval chunks: one per module and language the reader may see at ?ref=, ordered by module ID and language, each followed by one per FAQ entry in it (attributes.entry, the entry alone as its text), each the module as Markdown with the metadata to filter on (type, audience, facets, keywords, manuals, variant conditions, the newest release) and contentHash, the SHA-256 of the text, so a pipeline re-embeds only what changed. Scoped like every read: a module outside the reader’s scope is never listed, counted or inlined into another chunk, and the filters run before paging. A module too large to cut once its module references are included has no chunk, and only it: meta.leftOut names it. Modules too large to cut together (many each including a lot, past a budget of four times the content they are made from) make the whole commit a 422 chunk-set-too-large, for readers who see them.

Authorization

bearer
headerAuthorizationBearer <JWT>

A service account's token (ccms_sat_…, issued by POST /service-accounts/{id}/tokens), or, for local use and demo mode, the server's shared CCMS_API_TOKEN.

Query Parameters

filter[module]?string

Only the chunks of this module (a module ID), one per language the reader may read it in (and one per FAQ entry in it). A module outside the reader’s scope, or that does not exist, has none.

Match^[a-z0-9]+(?:-[a-z0-9]+)*$
Lengthlength <= 100
filter[lang]?string

Only chunks in this language.

Match^[a-zA-Z]{2,3}(?:-[A-Za-z0-9]{2,8})*$
filter[type]?string

Only modules of this module type.

Match^[a-z][a-z0-9-]*$
Lengthlength <= 64
filter[audience]?string

Only modules that count as this audience level: their own, or the last, most restricted level for a module naming none, as manuals and the access check place it. A level the configuration does not list matches nothing, and a module naming such a level matches no level.

Match^[a-z][a-z0-9-]*$
Lengthlength <= 64
filter[facet]?|array<string>

Only modules with this facet value, as <facet>:<value> (e.g. region:north). Repeat it for several, at most 32: a module has to have every one.

filter[keyword]?|array<string>

Only modules with this keyword, case and diacritics aside (Wärme is warme); 1 to 64 characters, no comma. Repeat it for several, at most 32: a module has to have every one.

filter[manual]?string

Only the modules this manual includes, as the reader may see it (with filter[variant]: the entries it includes for that variant). A manual the reader may not see, or that does not exist, includes nothing.

Match^[a-z0-9]+(?:-[a-z0-9]+)*$
Lengthlength <= 100
filter[variant]?string

A variant slug such as model=large,software=2.3 (as GET /manuals/{id} lists them, or any configured attribute values): variant blocks are resolved for it, so one for another variant is not in the text. Without it, each variant block is kept, headed by its condition. An attribute or value the configuration does not hold is a 422 unknown-variant.

Lengthlength <= 500
filter[changedSince]?string

A full commit ID in the history of the commit read (one a previous sync got in X-Ccms-Commit): only the chunks that may have changed since, because a module file their text was made from or depends on (an included module, a translation of it, a cross-reference target), the configuration or a manifest naming the module changed. meta.release is no file: a new release lists nothing here. Any other commit is a 400 invalid-parameter. Only files you may read now count: a deleted module, or a chunk whose included module was deleted or left your scope since, is not listed, so a full sync now and then catches those.

Match^[0-9a-f]{40}([0-9a-f]{24})?$
page[number]?integer

Page to return, from 1. Default: 1.

Range1 <= value
page[size]?integer

Resources per page. Default: 50, at most 200.

Range1 <= value <= 200
ref?string

Branch, tag or commit ID to read from. Default: the server's CCMS_DEFAULT_REF.

Response Body

application/vnd.api+json
  1. response
data*array<>
meta*
links*
Example Request
curl -X GET 'http://localhost:3000/chunks'
Example Response
{  "data": [    {      "type": "Chunk",      "id": "string",      "attributes": {        "moduleId": "string",        "lang": "string",        "title": "string",        "moduleType": "string",        "audience": "string",        "facets": {},        "keywords": [          "string"        ],        "manuals": [          "string"        ],        "conditions": [          "string"        ],        "text": "string",        "sourceHash": "string",        "contentHash": "string",        "entry": {          "blockId": "string",          "question": "string"        }      },      "relationships": {        "module": {          "data": {            "type": "Module",            "id": "string"          },          "links": {            "related": "string"          }        }      },      "meta": {        "ref": "string",        "commit": "string",        "sources": [          {            "moduleId": "string",            "lang": "string"          }        ],        "release": {          "tag": "string",          "commit": "string",          "same": true        }      }    }  ],  "meta": {    "page": {      "currentPage": -9007199254740991,      "lastPage": -9007199254740991,      "perPage": -9007199254740991,      "total": -9007199254740991    },    "leftOut": [      {        "moduleId": "string",        "lang": "string",        "reason": "size"      }    ]  },  "links": {    "self": "string",    "first": "string",    "last": "string",    "prev": "string",    "next": "string"  }}