How to access the REST API on `6.demo.plone.org`?

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?

I suppose you would have to have access to the Plone instance. You are now attempting to access Volto directly.

Follow the instructions here: Authentication — plone.restapi v8.24.2.dev0 - I tried it with JWT and all worked.

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?

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

@fredvd: Thank you! ++api++ was the missing part.