Rest API
Exponential 6 has a REST interface for reading and writing content from other applications: mobile apps, other sites, scripts. It answers JSON below /api, with OAuth 2.0 tokens or personal API keys, and checks every call against the user's roles and policies, like the administration does.
What serves what
- The REST framework is in the kernel (kernel/private/rest/, settings/rest.ini): routing, versions, authentication, the answer cache, output renderers. The entry point is index_rest.php; the shipped .htaccess_root sends /api/ to it.
- The content API is the extension ezprestapi, which a new installation activates. It answers at /api/ezp/v1/... (read only, the API existing clients use) and /api/ezp/v2/... (also create and remove).
- OAuth is in the kernel: applications are registered on Setup > oAuth admin, users authorize them on /oauth/authorize, and tokens come from /api/auth/v1/oauth/token.
- Other providers of the kernel use the same framework: the help (/api/help/...), GraphQL (/api/graphql/...) and the migrations status (/api/migration/...).
A first call
export EXP_API_KEY='expk_...' # a personal API key (My account > API access) curl -s -H "Authorization: Bearer $EXP_API_KEY" https://www.example.com/api/ezp/v1/content/node/2
The pages of this section
- Getting started and Installation
- Authentication: OAuth 2.0 and API keys
- Resources: the content routes
- REST API configuration settings
- Extending the REST API and custom output renderers
Related pages
- REST API v1 and v2: one extension, the full guide
- Personal API keys
- rest.ini
In this section
- Installation What an Exponential 6 site needs for the REST API: rewrite rule, extension, policies and HTTPS.
- REST API configuration settings Every group of rest.ini for the Exponential 6 REST API, with the shipped values.
- Getting started with the Exponential REST API Make a first call to the Exponential 6 REST API with a personal API key.
- Authentication Authentication of the Exponential 6 REST API: OAuth tokens, personal API keys and basic authentication.
- Resources The routes of the Exponential 6 content REST API, their options and answers.
- Extension functionality Extend the Exponential 6 REST API with a provider and controllers of your own.
Contributors
- Geir Arne Waaler Maintainer
- Bertrand Dunogier Maintainer
- Graham Brookins Updated Maintainer
Comments
Add a comment