mekell
(me-kell)
1
Both Plone 6 classic
and Plone 5
expose the REST API
directly:
curl -s \
--user admin:admin \
-H "Accept: application/json" \
-X GET https://6-classic.demo.plone.org
curl -s \
--user admin:admin \
-H "Accept: application/json" \
-X GET https://demo.plone.org
Volto
itself access internally the REST API
but: is the REST API
externally accessible on a Plone 6 Volto
site (e.g. on 6.demo.plone.org
)?
curl -s \
--user admin:admin \
-H "Accept: application/json" \
-X GET https://6.demo.plone.org
Maybe I miss the port?
mtrebron
(Norbert )
2
I suppose you would have to have access to the Plone instance. You are now attempting to access Volto directly.
jensens
(Jens W. Klein)
3
Follow the instructions here: Authentication — plone.restapi v8.24.2.dev0 - I tried it with JWT and all worked.
mekell
(me-kell)
4
It works only for 6-classic.demo.plone.org
and demo.plone.org
.
But not for 6.demo.plone.org
because this URL access Volto
directly:
$ curl -i -X POST https://6.demo.plone.org/@login -H "Accept: application/json" -H "Content-Type:
...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /@login</pre>
</body>
</html>
Is the REST API
on 6.demo.plone.org
externally accessible at all?
fredvd
(Fred van Dijk)
5
It bettee be, otherwise the Volto frontend doesn't work.
If you look at the network tab of loading the demo site you can see request like these:
https://6.demo.plone.org/++api++/@navigation?expand.navigation.depth=1
The demo setup is using the seamless mode and you can find the restapi behind ++api++ .
3 Likes
mekell
(me-kell)
6
@fredvd: Thank you! ++api++
was the missing part.