如何使用cURL在AEM as a Cloud Service中访问AEM实例

本文概述了在AEM as a Cloud Service中使用cURL命令访问Adobe Experience Manager (AEM)实例的步骤。

描述 description

环境

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

问题/症状

如何使用cURL访问AEM as a Cloud Service中的AEM实例。

解决方法 resolution

请按照以下步骤操作:

  1. 访问 Cloud Manager

  2. 打开要访问的环境(开发、暂存、生产)的 Developer Console

  3. 单击 集成 > 本地令牌 > 获取本地开发令牌

    示例:

    code language-none
    {
      "ok": true,
      "statusCode": 200,
      "accessToken": "eyJh...3XAA"
    }
    
  4. 使用​ accessToken ​执行cURL命令

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

    示例

    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"}
    

accessToken值的有效期限为24小时。

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