Search code examples
xpageslotus-noteslotus-domino

How to use view parameter "Keys" for date fields at Domino Data Service REST API


Domino REST API doesn't return any view data if I use date at query parameter "Keys". In case of Extension Library REST Control we can use NotesDateTime() or @Date() to make it work.

But I don't know how to use the same at Domino REST API call. Anybody knows how to use date as key?

This is the the sample url,

https://demodomain.com/demo.nsf/api/data/collections/name/viewName?sortcolumn=DateField&keys=1999-03-24T22:16:17Z


Solution

  • I looked at the source code for the Domino data service. The view entries resource (/{db}/api/data/collections/name/{view}) always assumes the keys parameter is a string. So apparently it's unable to match any value in a date column.

    This behavior could be improved. Meanwhile, you could work around the limitation by creating a separate sort column with the TEXT representation of the same date. Use the new column name in the sortcolumn parameter and the view entries resource should be able find rows that match the keys parameter.