Endpoints
Contents
This section describes the available API endpoints and how to access and expose them.
Draft and master
The Guillotine application exposes two endpoints per content project:
/site/<project-name>/draft
- draft items/site/<project-name>/master
- published items
As an example, when running the Enonic SDK on your local machine, you may access the items of a project called blog
, using the following URLs:
http://localhost:8080/site/blog/draft
- Drafts APIhttp://localhost:8080/site/blog/master
- Live API
The endpoints handle both POST
and GET
methods, but GET
method is only applicable for Subscriptions
via WebSockets.
Custom domain
When setting up Enonic XP in production, the APIs will normally not be publicly accessible. Using Vhosts, you may explose the APIs and even providing custom domain names:
Examples for a project called myproject
.
mapping.my-api.host = myapi.com
mapping.my-api.source = /
mapping.my-api.target = /site/myproject/master
mapping.my-api.host = example.com
mapping.my-api.source = /api
mapping.my-api.target = /site/myproject/draft
For more details about vhosts, check out the XP documentation