Expand my Community achievements bar.

SOLVED

Trouble with .initiateUpload.json call

Avatar

Level 4

Since we are using AEM as a cloud service, I've been told not to use the AssetManager to programmatically upload images. I've implemented the .initiateUpload.json call but I am seeing a "No Host" exception when I make the initial call to start the upload. Using the URL in a browser returns that the servlet could not be found.

 

Is there something I need to configure in my local instance to enable uploading images so that I can make sure my code will work when we deploy it?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@Robert-Harper - No host exception can occur if the AEM Author Cloud Environment URL is incorrect. Since uploading an asset is a three step process - initiate upload, upload binary files, complete the upload. All these APIs need to be called with correct authentication header/token [1] . For more details on asset upload APIs, there are also a few open source libraries which you can implement in your project code based on preferred programming language [2] or you can even create one as shown here [3]

 

[1]: https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/a...

[2]: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/develo...

[3]: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/develo...

 

Hope this helps!

Jineet

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@Robert-Harper - No host exception can occur if the AEM Author Cloud Environment URL is incorrect. Since uploading an asset is a three step process - initiate upload, upload binary files, complete the upload. All these APIs need to be called with correct authentication header/token [1] . For more details on asset upload APIs, there are also a few open source libraries which you can implement in your project code based on preferred programming language [2] or you can even create one as shown here [3]

 

[1]: https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/a...

[2]: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/develo...

[3]: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/develo...

 

Hope this helps!

Jineet