Is there a way to sort content on when it was first published

We have a situation where we were sorting using updatedAt, but the client has instead to have our content sorted by when it was first published

Hi Sam,

Although sys.firstPublishedAt isn’t retrieved in the Delivery API, this property is available in the Management API, so you should be able to do so using this API instead with something on the lines of order=sys.firstPublishedAt:

1 Like

Would there be a way to similarly order results using GraphQL by sys.firstPublishedAt since the field isn’t part of the Delivery API? This would give better results in my case versus ordering by createdAt (which is returned from the API).

My temporary solution has been to create a replica field in the Data Model to define the date and time of first publish.

Hi @daniel.yuschick,

Could you explain how exactly you’re using GraphQL with our API? Are you using this tool?

The custom field is our permanent solution, in addition I did a routine using the cful mgmt api to set the firstpublishedat date to the pubDateTime (our custom field)

From what I could tell the mgmt api doesn’t allow sorting and paging the same way the content api does - so getting at the additional fields that only show via mgmt api queries doesn’t look possible via the content api - so we went with the custom field and use it in all cases related to publish date.

1 Like

Indeed, there wouldn’t be a way to work around this limitation, and it’s not possible at the moment to retrieve the same CMA-specific properties through the CDA.