Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Update Date type fields using Assets HTTP API

Avatar

Community Advisor

For a client we are leveraging Assets HTTP API for metadata updates on AEM as CS, there are certain metadata attributes which are of type Date or Long. What is the expected input format for Date and Long type fields in request body?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @shubhanshu_singh 

 

The body is a JSON payload, which means that all your values will be represented as strings. With that said, you simply need to use the string representation of the respective value type. If you intend to update a Date or Long metadata property, ensure that you provide a valid string representation for the date or long value in the corresponding field. Failing to do so may not trigger any warnings or errors, but it could lead to malfunctions in any logic that relies on such metadata

 

For example, this is how I will update a Date:

EstebanBustamante_0-1696943874050.png


Hope this helps.

 



Esteban Bustamante

View solution in original post

2 Replies

Avatar

Administrator

@EstebanBustamante @Shashi_Mulugu  Can you please review this Question and share your thoughts? 



Kautuk Sahni

Avatar

Correct answer by
Community Advisor

Hi @shubhanshu_singh 

 

The body is a JSON payload, which means that all your values will be represented as strings. With that said, you simply need to use the string representation of the respective value type. If you intend to update a Date or Long metadata property, ensure that you provide a valid string representation for the date or long value in the corresponding field. Failing to do so may not trigger any warnings or errors, but it could lead to malfunctions in any logic that relies on such metadata

 

For example, this is how I will update a Date:

EstebanBustamante_0-1696943874050.png


Hope this helps.

 



Esteban Bustamante