Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
This page describes the delivery
endpoint version 1 for obtaining JCR data as JSON. The endpoint provides two resources methods that can be called with HTTP
Mgnl get |
---|
Info | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Currently we only support a single delivery endpoint configuration. Please note that a preconfigured endpoint is delivered by default in bundles that contain the demo. We plan to support multiple endpoints soon. Keep an eye on
|
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
readNode
. You can only create a single configuration that is required to use it.
Note |
---|
Version 1 of the delivery endpoint is deprecated. We recommend using version 2 instead. |
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
Returns one node by a given path, including its properties and child nodes down to a certain depth.
Mgnl get |
---|
<magnolia-base-path>/.rest/delivery/{endpointPrefix}/v1/{path}
Advanced Tables - Table Plus | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
Get the node of the first component in the main
area of the /travel/about
page.
...
Expand | |||||
---|---|---|---|---|---|
| |||||
The result is based on the basic configuration . |
queryNodes
Returns a list of nodes matching a query composed of the given query parameters. You also can apply filters to the query.
Mgnl get |
---|
/delivery/{endpointPrefix}/v1?param1=value1¶m2=value2&...
Use any of the optional query parameters or none.
...
highlightColor | @default |
---|---|
multiple | false |
enableHeadingAttributes | false |
enableSorting | false |
enableHighlighting | false |
...
Parameter
...
Description
...
Parameter type
...
Data type
...
endpointPrefix
...
required
The name of an endpoint prefix as configured. Also can be a real workspace name.
...
path
...
String
...
q
...
optional
A search phrase (full-text search)
...
query
...
String
...
orderBy
...
optional
The properties by which to order the nodes.
Example: mgnl:lastModified desc,title asc
Note that special characters such as a space (
) must be encoded when sent in an HTTP request. When using tools to generate a REST request, this may happen automatically. With simple cURL you have to encode it manually or with an additional tool. Example: orderBy=title%20asc
...
query
...
String
...
The start position in a result list (for pagination)
...
limit
...
optional, default is as set in configuration
The number of nodes displayed in a pagequery. Used together with offset
for pagination.
...
query
...
Integer
...
optional
There are multiple filter options to filter for a property of the node, for node names, for nodes which must be ancestors of a given path, you can combine filters with AND
operator. See filter options.
...
queryNodes
provides a filtering mechanism. Filters are added as request parameters. Filter values must be properly URL encoded. You can use multiple filters within the same request.
The filter parameter has the following format: property[operator]=value
Example filter used in a URL:
Code Block |
---|
https://example.com/.rest/delivery/pages/v1?title[like]=tour |
eq
(means =
)ne
(means <>
)lt
(means <
)gt
(means >
)lte
(means <=
)gte
(means >=
)like
(means LIKE
) %
(percentage, URL encoded as %25
) stand for zero or more additional characters._
(underscore) stands for any one character.in
(means IN
)not-in
(means NOT IN
)Filter for a node property. The property value must be an exact match.
Code Block |
---|
author=Magnolia%20Travels |
@name
property filterFilter by a node name.
Code Block |
---|
@name=travel |
@ancestor
filterFind nodes for whom the path provided is the ancestor. The path must be absolute in the given workspace of the given workspace prefix.
Code Block |
---|
@ancestor=/travel/about/careers/marketing-associate |
If no operator is provided, eq
is used by default.
The value
in the filter parameter is treated as String
.
Use brackets to pass an operator, for example [eq]
, [ne]
, [lt]
, and so on.
For in
and not-in
, a range symbol ~
(the tilde) should be provided, for example:
Code Block |
---|
https://example.com/.rest/delivery/pages/v1?mgnl:created[in]=2018-01-01~2018-02-01 |
...
This result is based on the basic configuration. |
Returns a list of nodes matching a query composed of the query parameters provided. You can also apply filters to the query.
Mgnl get |
---|
<magnolia-base-path>/.rest/delivery/{endpointPrefix}/v1?param1=value1¶m2=value2&...
Use any of the optional query parameters or none.
Advanced Tables - Table Plus | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
|
Anchor | ||||
---|---|---|---|---|
|
queryNodes
provides a filtering mechanism. Filters are added as request parameters. Filter values must be properly URL-encoded. You can use multiple filters within the same request.
The filter parameter has the following format: property[operator]=value
Example filter used in a URL:
Code Block |
---|
https://example.com/.rest/delivery/pages/v1?title[like]=tour |
Include Page | ||||
---|---|---|---|---|
|
Property filter
Filter for a node property. The property value must be an exact match.
Code Block |
---|
author=Magnolia%20Travels |
@name
property filter
Filter by a node name.
Code Block |
---|
@name=travel |
@ancestor
filter
Find nodes for which the path provided is the ancestor. The path must be absolute in the given workspace of the given workspace prefix.
Code Block |
---|
@ancestor=/travel/about/careers/marketing-associate |
If no operator is provided, eq
is used by default.
The value
in the filter parameter is treated as String
.
Use brackets to pass an operator, for example [eq]
, [ne]
, [lt]
, and so on.
For in
and not-in
, a range symbol ~
(the tilde) should be provided, for example:
Code Block |
---|
https://example.com/.rest/delivery/pages/v1?mgnl:created[in]=2018-01-01~2018-02-01 |
price[in]=100~200
is interpreted as price >= 100 AND price <= 200
.Date: yyyy-MM-dd
Code Block |
---|
2018-01-01 |
Datetime: yyyy-MM-dd'T'HH:mm:ss.SSSXXX
Code Block |
---|
2018-01-11T10:26:47.438+07:00 |
If a filter can take multiple possible values which must match, use |
(OR):
Code Block |
---|
@name=travel|about |
Anchor | ||||
---|---|---|---|---|
|
Include Page | ||||
---|---|---|---|---|
|
...
Date: yyyy-MM-dd
Code Block |
---|
2018-01-01 |
Datetime: yyyy-MM-dd'T'HH:mm:ss.SSSXXX
Code Block |
---|
2018-01-11T10:26:47.438+07:00 |
...
If a filter can take multiple possible values which must match, use |
(OR):
Code Block |
---|
@name=travel|about |
...
Find webpages in the Travel Demo which were last modified before or on June 3, 2015:
Code Pro | ||
---|---|---|
| ||
curl -X GET 'http://localhost:8080/magnoliaAuthor/.rest/delivery/website/v1?mgnl:lastModified\[lte\]=2015-06-03' \
-u superuser:superuser |
(The brackets have been escaped with the backslash character ( \
) for the command to work correctly in bash.)
Expand | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
The result is returned for the following configuration:
|
Find webpages whose title is either Story or Stories. This can be done in two ways:
Code Pro |
---|
curl -X GET 'http://localhost:8080/magnoliaAuthor/.rest/delivery/website/v1?title=Story|Stories' \
-u superuser:superuser |
Code Pro |
---|
curl -X GET 'http://localhost:8080/magnoliaAuthor/.rest/delivery/website/v1?title\[like\]=Stor%25' \
-u superuser:superuser |
(The brackets have been escaped with the backslash character ( \
) for the command to work correctly in bash.)
Expand | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
The result is returned for the following configuration:
|
Find nodes in the tours
workspace which contain the keyword vietnam. Return the results in the descending order by the location
property and restrict the limit to one:
Code Pro |
---|
curl -X GET 'http://localhost:8080/magnoliaAuthor/.rest/delivery/tours/v1?q=vietnam&orderBy=location%20desc&limit=1' \
-u superuser:superuser |
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
The result is based on the basic configuration. |
Find a tour whose description
is Get photobombed by a Sea Turtle:
Code Block |
---|
curl -X GET \
'http://localhost:8080/magnoliaAuthor/.rest/delivery/tours/v1?description=Get%20photobombed%20by%20a%20Sea%20Turtle' \
-u superuser:superuser |
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
The result is based on the basic configuration. |
In the website
workspace, find all nodes for whom /travel/about/careers is the ancestor:
Code Block |
---|
curl -X GET \
'http://localhost:8080/magnoliaAuthor/.rest/delivery/website/v1?@ancestor=/travel/about/careers' \
-u superuser:superuser |
...
title | Click to see the resulting JSON |
---|
Code Pro | ||||
---|---|---|---|---|
| ||||
{
"results": [{
"@name": "customer-experience-agent",
"@path": "/travel/about/careers/customer-experience-agent",
"@id": "1f8af166-258f-4351-a543-3d0fc8bb00c0",
"@nodeType": "mgnl:page",
"hideInNav": "false",
"title": "Customer Experience Agent",
"title_de": "Kundenerlebnisvermittler",
"@nodes": []
}, {
"@name": "customer-experience-supervisor",
"@path": "/travel/about/careers/customer-experience-supervisor",
"@id": "c8e6902a-499a-44d7-9de9-45fd93d60a6b",
"@nodeType": "mgnl:page",
"hideInNav": "false",
"title": "Customer Experience Supervisor",
"title_de": "Kundenerlebnisteamleiter",
"@nodes": []
}, {
"@name": "marketing-associate",
"@path": "/travel/about/careers/marketing-associate",
"@id": "f19c60f2-3049-4883-a170-4bf65e3abb91",
"@nodeType": "mgnl:page",
"hideInNav": "false",
"title": "Marketing Associate",
"title_de": "Marketingmitarbeiter/in",
"@nodes": []
}]
} |
The result is returned for the following configuration:
...
language | yaml |
---|
...
Anchor | ||||
---|---|---|---|---|
|
Multiexcerpt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The delivery endpoint requires a configuration, which can be done in YAML file or via JCR, otherwise, it cannot deliver content. Version 2.0 of the Add the configuration to the
Properties:
A node may contain references to other nodes. With the
Properties of
|
...