Jul 09, 2024
Using the Cloud Manager and its API can sometimes be oversimplified. Although using the API appears straightforward, some details may become stumbling blocks, especially for those unfamiliar with the configurations.
In this post, we'll explain how to configure and use the Cloud Manager API through a simple example using a REST client such as Postman.
What is Cloud Manager?
Cloud Manager is a cloud service offered by Adobe for building, testing, and deploying Adobe Experience Manager (AEM) applications hosted by Adobe Managed Service. Some key features and functionalities of Adobe Cloud Manager include:
-
Continuous Integration/Continuous Deployment (CI/CD).
-
Environment Management, Automated Testing.
-
Rollback and Versioning.
-
Monitoring and Reporting.
-
Security and Compliance.
What is the Cloud Manager API?
The Cloud Manager API allows customers to access the same features in the web interface programmatically. This enables seamless integration of Cloud Manager with other systems, making it easier to automate tasks and connect the CI/CD pipeline with various software tools such as versioning systems, reporting systems, audit systems, etc. Overall, the Cloud Manager API simplifies the management of Adobe Experience Manager applications in the cloud and enables the creation of more efficient workflows.
For example, with the Cloud Manager API, you can set up automated workflows to trigger deployments when code changes are merged into a specific branch in your version control system. This streamlines the deployment process and ensures updates are promptly pushed to your Adobe Experience Manager applications in the cloud. Another valuable application is feeding this information into external systems. In doing so, teams can gain deeper insights into deployment performance, identify areas for improvement, and take proactive measures to address any issues that arise during the deployment process.
Using Cloud Manager API
For this next step, you must have access to the Adobe Developer Console, which requires either an Admin or API Developer role.
Creating an API Integration Project
You must establish a project in the Adobe Developer Console to execute API requests via the Cloud Manager API. This involves either creating a new project or utilizing an existing one. This project sets up the credentials used during API calls and defines the permissions associated with these credentials. You can follow the steps below:
-
Go to the Adobe Developer Console.
-
Create or select a project.
-
By clicking the button Add to Project add the Cloud Manager API to the selected project.
-
Select the type of Authentication supported. Please note that the JWT option is deprecated and should no longer be used.
-
Choose the Product Profile that will determine the features available through the API.
-
Finally, Save the new configured API.
Generate the Access Token
An access token is a credential that represents the authorization granted by the resource owner to the client application. It enables the client application to access protected resources on behalf of the resource owner without exposing the resource owner's credentials to the client application. In other words, it serves as the key that the Cloud Manager API requires to access the resources previously agreed upon to share.
In the Admin console, you can simply click the Generate access token button to manually obtain a temporary token and thus verify that everything is functioning correctly. It's important to note that the access token has a specific Time to live (TTL) period, meaning it will expire after some time. Therefore, you may use this manual method to generate the access token solely for testing purposes.
In a real-world scenario, using OAuth 2.0, your client application should manage token refreshment. However, Cloud Manager OAuth Server-to-Server configuration does not support refresh tokens. Hence, you would need to either extend the TTL of the access token or generate the access token programmatically to avoid issues, with the latter being recommended by Adobe.
For this blog, we’ll generate the access token via Postman by providing the following information:
-
grant_type
-
client_id
-
client_secret
-
scope
You can find the above information on the "OAuth Server to Server" screen from the project you created in the Adobe Developer Console. In our case, this call will appear as follows:
Now that we have the access token, we are ready to use any endpoints available as part of the Cloud Manager API. You can find all the details about each endpoint in the official documentation.
Testing with Postman
Before we move forward, here's a little reminder: you will be able to use only those endpoints related to the roles and permissions granted when you select the profiles in the API integration project creation in the Admin Developer Console.
For the following example, we will list the last 2 executions of the pipeline using the List Executions endpoint. By referring to the Cloud Manager API Documentation, you can see the available options, required parameters, and headers to fit your needs. In our case, we will use the start and limit query parameters to get only the latest two executions. The request would look like this in Postman:
A few things to note from the above image: the headers will include whatever information the endpoint requires. In this case, the "List Executions" endpoint requires the x-api-key, x-gw-ims-org-id, and Authorization headers. The Authorization header will be included in all endpoints, where the access token will be utilized.
Conclusion
The Cloud Manager API enables seamless integration with other systems and tools, streamlining workflows and enhancing automation capabilities. Developers can leverage this Adobe tool to enhance operational efficiency, reduce manual errors, and accelerate the deployment of creative content and digital experiences.
Learn more about the wealth of Adobe Experience Manager products and services on our blogs.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.