Attachment API - param to filter data based on time range.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 07:20 AM - edited 10-06-2023 07:21 AM
Attachment API - what is the api param to filter data based on time range for attachments. I tried sysparm_query : sys_created_on>=2022-01-01&sys_created_on<=2022-12-31.
but not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2023 11:59 PM
Hi @Adithya Khurana ,
yes its "sysparm_query" but you need pass the encoded query
Ex: created between 10/6 to 10/7 i.e "sys_created_onBETWEENjavascript:gs.dateGenerate('2023-10-06','00:00:00')@javascript:gs.endOfToday()"
go to sys_attachment table and apply filter and copy the encoded query. i did test this in Rest API explorer and its working fine.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025