Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.
Level 1
Level 2
Melden Sie sich an, um alle Badges zu sehen
Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.
Hi Team,
There is requirement to read the dam url in json format inside servlet or servlce. By using Httpclient GET getting 401 unauthorized error. Is there any way to access the same url in java ?
Thanks
Zugriffe
Antworten
Likes gesamt
you need to pass login token as header in Httpclient of get request so that your request is authenticated before content is served.
Zugriffe
Antworten
Likes gesamt
Thanks for your reply.
For login token we need to pass credentials and we can't do it for the all the environments separately. Is there any other way to generate the token ?
Zugriffe
Antworten
Likes gesamt
You may try with subservience session.
Inside your servlet or service get jcr or sling session using subservice and read dam file path.
Example:
Note : In Author Instance you must have to login/or access with authorised account(as mentioned in above replies) to access above.
Zugriffe
Antworten
Likes gesamt
could u please elaborate your use case in details that in which environment your servlet is running and from where you want to read dam files and whether dam files are secured files or not and if yes then what the authentication mechanism supported.
Zugriffe
Antworten
Likes gesamt
Do you mean you want to get URL of Assets in the DAM and encode to JSON?
Zugriffe
Antworten
Likes gesamt
Need to get the response of url e.g. localhost:4502/content/dam/a/b.json and read the json.
I know using httpclient.get we need to pass the login token, my question was if there is any other way to achieve this in java.
Thanks,
Zugriffe
Antworten
Likes gesamt
In Author, no you can't but on publish instance you can do it without access token but you have to do it with Java to return dam path either by using queries or Asset HTTP API.
Zugriffe
Antworten
Likes gesamt
Following is the solution for getting data from DAM and writing the Data.
Zugriffe
Antworten
Likes gesamt
Zugriffe
Likes
Antworten
Zugriffe
Likes
Antworten
Zugriffe
Likes
Antworten