OpenFolia

Read a page design template’s text file

GET
/page-design-templates/{templateId}/file

One text file of the template’s folder at ?ref= by its path in it (#396), as committed; with workingCopy=true (the change set’s author) the working copy’s text in its place. To change it, save a working copy in a change set (PUT /change-sets/{changeSetId}/page-design-templates/{templateId}/files/working-copy?path=). Every reader of the ref reads it.

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.

Path Parameters

templateId*string

The template’s folder name (templates/<templateId>/).

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

Query Parameters

path*string

The file’s path in the template’s folder. One that is no template text file’s (a name starting with ., a path leaving the folder, an image) is 404.

Lengthlength <= 1000
workingCopy?string

For authors (left out of the delivery document): true reads the change set’s working copies (what its editor autosaved, not committed yet) in place of their files, modules and manuals alike; module references resolve to their own working copies where there are any; an image uploaded into the change set links to GET /change-sets/{changeSetId}/assets/{hash} in an HTML page, and the PDF shows it. Needs ref to name the change set’s branch (change-sets/<id>; else 400 invalid-parameter) and only for its author: 403 for anyone else who may read drafts, 404 for anyone who may not. private, no-cache, without the commit’s ETag. Default: false.

Default"false"
Value in"true""false"
ref?string

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

Header Parameters

X-Ccms-User?string

Demo mode only (CCMS_AUTH_MODE=demo): the user ID to act as. The bearer token is still required; without demo mode the header is refused (400).

Response Body

application/vnd.api+json
  1. response
data*

id is the file’s path in the template’s folder.

Example Request
curl -X GET 'http://localhost:3000/page-design-templates/house/file?path=manual.typ'
Example Response
{  "data": {    "type": "PageDesignTemplateFileText",    "id": "string",    "attributes": {      "path": "string",      "text": "string"    }  }}