How to access your AEM instance in AEM as a Cloud Service with cURL

The article outlines the steps to access an Adobe Experience Manager (AEM) instance in AEM as a Cloud Service using cURL commands.

Description description

Environment

  • Adobe Experience Manager
  • Adobe Experience Manager as a Cloud Service

Issue/Symptoms

How to access AEM instance in AEM as a Cloud Service with cURL.

Resolution resolution

Follow the steps given below:

  1. Access Cloud Manager

  2. Open the Developer Console of the environment (dev, stage, prod) that you want to access

  3. Click on Integrations > Local Token > Get Local Development Token

    Example:

    code language-none
    {
      "ok": true,
      "statusCode": 200,
      "accessToken": "eyJh...3XAA"
    }
    
  4. Execute the cURL command using the accessToken

    code language-none
    $ curl -H "Authorization: Bearer <Value of accessToken>" "<URL of AEM>"
    

    Example

    code language-none
    $ curl -H "Authorization: Bearer eyJh...3XAA" "https://author-p12345-e6789.adobeaemcloud.com/content/wknd/us/en.json"
    {"jcr:created":"Wed Feb 22 2023 04:07:45 GMT+0000","jcr:createdBy":"admin","jcr:primaryType":"cq:Page"}
    

The accessToken value is valid for 24 hours.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f