Content management
How to use our content endpoints
The content
part of the Delivery API enables access to a range of endpoints that will deliver data and content to websites.
The endpoints available falls into the following categories;
- Areas
- GridRows
- Navigations
- Pages
- PageViews
- Paragraphs
- Translations
Areas
Getting all the areas
for a given DynamicWeb solution is possible through the area
endpoints. It will provide the base for the website depending on which area
is being used
GET <yourHost>/dwapi/content/areas/{id}
Returns the specified area
with all of its items
{
"id": 3,
"name": "Swift B2C demo shop",
"createdDate": "2021-01-04T15:53:06.073",
"updatedDate": "2023-04-04T14:10:56.26",
"item": {
"fields": [
{
"name": "Title",
"systemName": "Title",
"value": "Swift"
},
{
"name": "Header desktop",
"systemName": "HeaderDesktop",
"value": {
"pageId": 121,
"paragraphId": 0,
"url": "/swift-tools/layout/header/desktop",
"isExternal": false
}
},
{
"name": "Header mobile",
"systemName": "HeaderMobile",
"value": {
"pageId": 122,
"paragraphId": 0,
"url": "/swift-tools/layout/header/mobile",
"isExternal": false
}
},
...
],
"id": "6",
"systemName": "Swift_Master",
"pageID": 0,
"paragraphID": 0
},
"languages": [
{
"culture": "en-GB",
"firstPage": {
"id": 150,
"name": "Home"
},
"id": 3,
"isCurrent": true,
"isMaster": true,
"name": "Swift B2C demo shop",
"primaryDomain": ""
},
...
],
"ecomCountryCode": "DE",
"ecomCurrencyCode": "EUR",
"ecomLanguageId": "LANG1",
"ecomPricesWithVat": true,
"ecomShopId": "SHOP1"
}
GridRows
Getting GridRows
for specific pages is possible, providing the possibility for all the information to render a page
with its columns
and paragraphs
, it will be provided.
GET <yourHost>/dwapi/content/rows/{pageId}/{device}
Returns the structure of all the rows for the given page
based on the device
[
{
"id": 192,
"definition": {
"id": "1Column",
"name": "1 Column",
"description": "1 row with 1 column",
"template": "1Column.cshtml",
"columnCount": 1,
"itemType": "Swift_1ColumnFull",
"thumbnail": "/Files/Templates/Designs/Swift/Assets/Images/VisualEditor/DW_Row_Full.svg"
},
"columns": [
{
"columnNumber": 1,
"rowColumnCount": 1,
"paragraph": {
"id": 2269,
"name": "MyColumn",
"createdDate": "2021-05-17T08:39:56.04",
"updatedDate": "2023-02-24T09:06:46.717",
"pageID": 149,
"globalID": 0,
"text": "",
"item": {
"fields": [
{
"name": "Title",
"systemName": "Title",
"value": "MyColumn"
}
],
"id": "4",
"systemName": "Swift_ProductCatalogApp",
"pageID": 149,
"paragraphID": 2269,
"link": "/products#2269"
},
"image": null,
"imageFocalX": 0,
"imageFocalY": 0,
"imageHAlign": "left",
"imageVAlign": "top",
}
}
],
"templatePath": "\\Designs\\Swift\\Grid\\Page\\RowTemplates\\1Column.cshtml",
...
},
...
]
Navigation
A navigation
is a list of links pointing to important areas of a website, often presented as a horizontal bar at the top of every page on a website – but you can have several different types of navigation
on a website.
The navigations
for specific areas and pages can be fetched from the navigation
endpoint
GET <yourHost>/dwapi/frontend/navigations/{areaId}
The areaId
is required and the rest of the properties can enable more layers of navigations
being returned, such as the full tree. A request such as
GET <yourHost>/dwapi/frontend/navigations/3?ExpandMode=all&StartLevel=1&StopLevel=3&IncludeFoldersAndHidden=true
Will return all level 1
and level 2
navigations
regardless of them being hidden
or folders
.
{
"nodes": [
{
"pageId": 150,
"groupId": null,
"name": "Home",
"link": "/home",
"level": 1,
"isClickable": true,
"inPath": false,
"isActive": false,
"showInSitemap": true,
"showInBreadcrumb": true,
"showInMenu": true,
"nodes": []
},
{
"pageId": 149,
"groupId": null,
"name": "Products",
"link": "/products",
"level": 1,
"isClickable": true,
"inPath": false,
"isActive": false,
"showInSitemap": true,
"showInBreadcrumb": true,
"showInMenu": true,
"nodes": [
{
"pageId": 169,
"groupId": null,
"name": "Details",
"link": "/details",
"level": 2,
"isClickable": true,
"inPath": false,
"isActive": false,
"showInSitemap": true,
"showInBreadcrumb": true,
"showInMenu": true,
"nodes": []
},
{
"pageId": 1279,
"groupId": null,
"name": "Clothing",
"link": "/clothing-1",
"level": 2,
"isClickable": true,
"inPath": false,
"isActive": false,
"showInSitemap": true,
"showInBreadcrumb": true,
"showInMenu": true,
"nodes": []
},
...
]
},
...
]
}
Pages
Being able to list all pages out for a given area
or all child pages
for a page
is possible with the pages
endpoints.
They provide all the specific data about a page
, both the option to get a collection of pages
for a given area and all their items
and additional information. It defines the content structure of a website in backend, which in turn can be used to generate dynamic navigation menus in frontend and as containers for content coming from a paragraph or an item.
GET <yourHost>/dwapi/content/pages/{id}
Returns the specifics of the requested page
given the id
{
"id": 150,
"name": "Home",
"createdDate": "2021-01-05T15:07:55.703",
"updatedDate": "2023-04-17T14:50:28.807",
"title": "",
"description": "Description of a page.",
"keywords": "",
"areaID": 3,
"path": [
{
"id": 150,
"name": "Home"
}
],
"languages": [
{
"id": 3,
"name": "Swift B2C demo shop",
"culture": "en-GB",
"primaryDomain": "",
"isCurrent": true,
"isMaster": true,
"page": {
"id": 150,
"name": "Home"
},
"pageIsHidden": false,
"pageIsPublished": true,
"firstPage": {
"id": 150,
"name": "Home"
},
"firstActivePage": {
"id": 150,
"name": "Home"
}
},
...
],
"item": {
"fields": [
{
"name": "Title",
"systemName": "Title",
"value": "Home"
},
...
]
},
"propertyItem": {
"fields": [
{
"name": "Header position",
"systemName": "MoveThisPageBehindTheHeader",
"value": {
"options": [
{
"value": "sticky-top",
"name": "Normal",
"icon": "/FilesTemplates/Designs/Swift/Assets/Images/ItemTypes/HeaderFixed.svg",
"isSelected": true,
"sortIndex": 0
},
...
]
}
},
...
]
}
}
PageViews
A PageView
gives you information about the current page
that your module
is used in. It gives you access to properties like the page
, the areaId
, information like style sheets and templates that are effective and it provides access to the current user
of the page
.
Paragraphs
Paragraphs can be fetched based on pageId
, areaId
, itemType
, and a specific paragraphs id
. They're used to define the content structure internally on a page
and as containers for content
coming from the standard paragraph
fields.
GET <yourHost>/dwapi/content/paragraphs/{id}
Returns all the information about a specific paragraph
including its items
and specific details about the paragraph
itself.
{
"id": 6511,
"name": "Free Shipping",
"createdDate": "2022-01-06T15:32:47.323",
"updatedDate": "2022-09-01T11:05:43.373",
"pageID": 150,
"globalID": 0,
"text": "",
"item": {
"fields": [
{
"name": "Upload new icon",
"systemName": "Image",
"value": [
{
"extension": ".svg",
"name": "truck.svg",
"path": "/Files/Images/Swift Demo Content/Icons/truck.svg",
"focalX": 0,
"focalPositionFromLeft": 50,
"focalY": 0,
"focalPositionFromTop": 50,
"pathUrlEncoded": "%2FFiles%2FImages%2FSwift+Demo+Content%2FIcons%2Ftruck.svg"
}
]
},
{
"name": "Title",
"systemName": "Title",
"value": "Free Shipping"
},
{
"name": "Text",
"systemName": "Text",
"value": "From all orders over $100"
},
...
],
"id": "1260",
"systemName": "Swift_Feature",
"pageID": 150,
"paragraphID": 6511,
"link": "/home#6511"
},
"image": null,
"imageFocalX": 0,
"imageFocalY": 0,
"imageHAlign": "left",
"imageVAlign": "top",
}
Translations
Getting translations will return all the basic elements such as labels, buttons, etc. translated to the approrpriate language depending on the culture used.
When requesting for the translations, an areaId
which will map to a designName
can be used, this will default to the areas culture and give the translations as such.
There's no authentication required to access these endpoints.
GET <yourHost>/dwapi/translations/area/{areaid}
Response contains a list of all the translations for this area
[
{
"key": "Contact",
"defaultValue": "",
"value": "Contact"
},
{
"key": "Request for quote",
"defaultValue": "Request for quote",
"value": "Request for quote"
},
...
]
If they need to be translated to a specific language, the culture can be sent in to a different endpoint
GET <yourHost>/dwapi/translations/{designname}/{culture}
Using a culture such as da-DK
will have the translations as danish
[
{
"key": "Contact",
"defaultValue": "",
"value": "Kontakt"
},
{
"key": "Request for quote",
"defaultValue": "Request for quote",
"value": "Opret en tilbudsførespørgsel"
},
...
]
Some scenarios would require getting a full list of all translation keys
and the translations for each. In that case the endpoint needing the designname will provide the data necessary
GET <yourHost>/dwapi/translations/{designname}
Every property in the response object will be a translation key
and contain all the data necessary with all the translations it has with each culture.
{
"Contact": {
"name": "Contact",
"scope": "designsLocal",
"defaultValue": "",
"translations": {
"en-GB": {
"cultureName": "en-GB",
"value": "Contact"
},
"da-DK": {
"cultureName": "da-DK",
"value": "Kontakt"
},
"nb-NO": {
"cultureName": "nb-NO",
"value": "Kontakt"
},
"en-US": {
"cultureName": "en-US",
"value": "Contact"
},
"nl-NL": {
"cultureName": "nl-NL",
"value": "Contact"
}
},
"tagDefinitions": []
},
"Request for quote": {
"name": "Request for quote",
"scope": "designsLocal",
"defaultValue": "Request for quote",
"translations": {
"en-GB": {
"cultureName": "en-GB",
"value": "Request for quote"
},
"da-DK": {
"cultureName": "da-DK",
"value": "Opret en tilbudsførespørgsel"
},
"en-US": {
"cultureName": "en-US",
"value": "Request for quote"
},
"nl-NL": {
"cultureName": "nl-NL",
"value": "Vraag om citaat"
}
},
"tagDefinitions": []
},
...
}