OpenWGA 7.6 - OpenWGA Concepts and Features

Design and development » REST web service » The REST APIs

The CMS API

The CMS API is the real "content management API" for REST. Meaning it provides the "pure" content management view on your apps data. Here you can create pages, content, draft copies and everything else that is in the CMS feature set of OpenWGA.

You find the CMS API under URI path /rest/v1/<databaseKey>/cms if it is enabled.

Operations and their URLs

Operation URL HTTP Method Request Data
Area: Retrieve area collection /cms/areas GET  
Area: Read/Create/Update/Delete area /cms/areas/{areaName} GET/PUT/PUT/DELETE On PUT:
{ ... resource data ... }
Content Type: Retrieve content types collection /cms/contentTypes GET  
Content Type: Read/Create/Update/Delete content types /cms/contentTypes/{contentTypeName} GET/PUT/PUT/DELETE On PUT:
{ ... resource data ... }
Language definition: Retrieve language definition collection /cms/languages GET  
Language definition: Read/Create/Update/Delete language definitions /cms/languages/{languageCode} GET/PUT/PUT/DELETE On PUT:
{ ... resource data ... }
Page: Retrieve root pages of an area /cms/areas/{areaName}/rootPages GET  
Page: Create a root pages of an area /cms/areas/{areaName}/rootPages POST { ... resource data ... }
Page: Read/Update/Delete a page /cms/pages/{pageKey} GET/PUT/DELETE On PUT:
{ ... resource data ... }
Page: Retrieve child pages of a page /cms/pages/{pageKey}/childPages GET  
Page: Create a child page of a page /cms/pages/{pageKey}/childPages POST { ... resource data ... }
Page: Retrieve next and previous page for navigation /cms/pages/{pageKey}/navigation GET  
Page: Lookup page by unique name /cms/pagesByName/{name} GET  
Content: Retrieve released contents of root pages of an area in a certain language /cms/areas/{areaName}/rootContent;language={languageCode} GET  
Content: Retrieve released contents of a page in all languages /cms/pages/{pageKey}/childPages GET  
Content: Retrieve all contents of a page in a certain languages /cms/pages/{pageKey}/{languageCode} GET  
Content: Create a content or a new draft copy for a language /cms/pages/{pageKey}/{languageCode} POST { ... resource data ... }
Content: Read/Update/Delete a content /cms/pages/{pageKey}/{languageCode}/{version} GET/PUT/DELETE On PUT:
{ ... resource data ... }
Content: Publish a content that is in draft or approve a content that is in review /cms/pages/{pageKey}/{languageCode}/{version} PUT { "metaData": { "status": { "string":"p" } } }
Content: Reject a content that is in review /cms/pages/{pageKey}/{languageCode}/{version} PUT { "metaData": { "status": { "string":"w" } } }
Content: Archive a content /cms/pages/{pageKey}/{languageCode}/{version} PUT { "metaData": { "status": { "string":"a" } } }
Content: Retrieve child contents of a content in the same language /cms/pages/{pageKey}/{languageCode}/{version}/childContent GET  
Content: Resolve context expression relative to a content /cms/pages/{pageKey}/{languageCode}/{version}/context?expression={contextExpression} GET  
Content: Retrieve next and previous content for navigation /cms/pages/{pageKey}/{languageCode}/{version}/navigation GET  
Content: Lookup content by content key /cms/content/{contentKey} GET  
Content: Lookup content by unique name /cms/contentByName/{name},{language} GET  
Content: Lookup content by context expression /cms/context?expression={contextExpression} GET  
Content files: Retrieve files attachmed to a content /cms/pages/{pageKey}/{languageCode}/{version}/files GET  
Content files: Read/create/update/delete files /cms/pages/{pageKey}/{languageCode}/{version}/files/{fileName} GET/PUT/PUT/DELETE On PUT:
Binary file data
Content relation groups: Retrieve relation groups of a content /cms/pages/{pageKey}/{languageCode}/{version}/relationGroups} GET  
Content relation groups: Read/create/update/delete relation groups /cms/pages/{pageKey}/{languageCode}/{version}/relationGroups/{groupName} GET/PUT/PUT/DELETE On PUT:
{ ... resource data ... }

Special resources

The relation group is treated like a subresource of the content document it belongs to. This is its JSON structure:

{

  • "type":"hdbmodelRelationGroup",
  • "relations":[
    • {
      • "href":"Target-URI",
      • "protected":true,
      • "reftype":"resource"
      },
    • {
      • "href":"Target-URI",
      • "protected":true,
      • "reftype":"resource"
      },
    • ...
    ]
}

THE URIs address content documents that should be targets of the relation group.