Can we change the default Assets HTTP API Path /api/assets ?

Avatar

Avatar
Validate 1
Level 2
surenk
Level 2

Likes

9 likes

Total Posts

48 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
surenk
Level 2

Likes

9 likes

Total Posts

48 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
surenk
Level 2

21-08-2020

As listed in the docs https://docs.adobe.com/content/help/en/experience-manager-65/assets/extending/mac-api-assets.html to access assets using API..

  1. https://[hostname]:[port]/api.json
  2. https://[hostname]:[server]/api/assets.json

is there a way to change the path of the default "/api/...." to be something else?

 

Our implementation need to call (external) services that are mapped as https://<server>/api/services  (where <server> is an aem site). 

and when internally calling assets' api's (to access content fragments) in code, we're having issues since they the external and internal api path. 

 

Couple solutions we can.. but can avoid if we can change the path. 

1. Create a servlet to catch `/api/assets` calls and process

2. Add dispatcher rule 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Albin_Issac
MVP

Likes

106 likes

Total Posts

119 posts

Correct reply

33 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Validate 1
MVP
Albin_Issac
MVP

Likes

106 likes

Total Posts

119 posts

Correct reply

33 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Albin_Issac
MVP

21-08-2020

I don't think so there is any OOTB option to modify the path, but you should be able to map custom URL through Apache/Dispatcher.

Refer the solution explained in the following URL - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/binding-a-servlet-to-a-cus...

 

Regards

Albin I

www.albinsblog.com

Answers (1)

Answers (1)

Avatar

Avatar
Validate 25
MVP
Singaiah_Chintalapudi
MVP

Likes

131 likes

Total Posts

234 posts

Correct reply

39 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
MVP
Singaiah_Chintalapudi
MVP

Likes

131 likes

Total Posts

234 posts

Correct reply

39 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
Singaiah_Chintalapudi
MVP

21-08-2020

Have a different URI and handle them at Apache/Dispatcher to PT (to maintain the same URL) or redirect to /api/*. This would be the easy one for maintenance.

 

To use PT and retain the original URI/URL:

RewriteRule ^your/custom/uri/$ /api/your/path.json [PT]

 

The above would internally redirect the request and the user would not see the redirection on the broswr.

 

You can always redirect the user. Let me know if you want the example.