OpenAPI-Based APIs openapi-based-apis
Newer AEM as a Cloud Service APIs follow the OpenAPI specification, and thus produce consistent, well-documented, and user-friendly APIs. In-depth information is available in the following pages:
- An end-to-end tutorial about how to configure and invoke OpenAPI-based AEM APIs.
- Informational , including .
- API-endpoint , where some of the APIs are OpenAPI-based, such as . Reference documentation also includes an API playground, which makes it simple to try out an endpoint using a bearer token generated with the ÃÛ¶¹ÊÓƵ Developer Console.
A common API use case involves integrations with systems such as a CRM or PIM, where AEM APIs are invoked to retrieve or persist data. As part of the integration implementation, applications may subscribe to AEM-emitted events, which can trigger business logic in ÃÛ¶¹ÊÓƵ App Builder or other infrastructure.
Supported API authentication types differ based on the endpoint, but may be OAuth Server-to-Server, OAuth Web App, and OAuth Single Page App (SPA).
Configuring API Access configuring-api-access
Many OpenAPI-based AEM APIs require authentication, which requires credentials to be generated using . Configuration involves the following steps, which are illustrated in the tutorial:
- Ensure your AEM program’s product profiles are updated and have an appropriate service enabled to access the desired API.
- Create a new project in ÃÛ¶¹ÊÓƵ Developer Console and add the desired API(s) to the project, also selecting the appropriate authentication type.
- Generate the credential, which will later be used to exchange fora bearer token when invoking the API.
- Register the client ID with the environment by configuring a YAML file, which is deployed using the Config Pipeline (or commandline for RDEs).
Registering a Client ID registering-a-client-id
Client IDs scope the APis in an ÃÛ¶¹ÊÓƵ Developer Console project to specific AEM environments. This is achieved as follows:
-
Create a file named
api.yaml
or similar with a configuration like the snippet below, including the desired tiers (author, publish, preview).Client_id
values should come from your ÃÛ¶¹ÊÓƵ Developer Console API project(s).The
kind
,version
, andmetadata
properties are described in the Config Pipeline article. Thekind
property value should be set to API and theversion
property should be set to 1.code language-none kind: "API" version: "1" metadata: envTypes: ["dev"] data: allowedClientIDs: author: - "<client_id>" publish: - "<client_id>" preview: - "<client_id>"
-
Place the file somewhere under a top level folder named
config
or similar, as described under Config Pipeline. -
For environment types other than RDE (which uses command line tooling), create a targeted deployment config pipeline in Cloud Manager, as referenced by this section in the Config Pipeline article. Note that Full Stack pipelines and Web Tier pipelines do not deploy the configuration file.
-
Deploy the configuration.