Solved

Exposing Generic Inquiry to REST API

  • 29 March 2024
  • 1 reply
  • 38 views

Badge

I am trying to expose a Generic Inquiry as a REST endpoint. This Generic Inquiry has a filter parameter of date. When I try to call the endpoint from POSTMAN, it keeps on erroring out.
I followed the instructions in acumatica help that tell you to encode the datetime 
 

	
You should encode date and time values in URL format before passing them as the value of the parameter. For example, you can encode the current date and time by using the System.Net.WebUtility.URLEncode() method as follows: WebUtility.UrlEncode(new DateTimeOffset(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffK")).

I have tried to call this using different syntax, but it looks like it is erroring out.
The parameter is ReportDate and is of type datetime.  

I have tried 
 

1) $filter=(ReportDate eq datetime '2024-03-01T00:00:00.000')
2) $filter=(ReportDate gt datetimeoffset '2024-03-01T00:00:00.000')
3) $filter=(ReportDate eq datetimeoffset '2024-03-01T00:00:00.000')
4) $filter=(ReportDate eq datetime '2024-03-01')

Each of these calls is resulting in a syntax error. I have tried with brackets and without brackets around the call. I have also tried to encode the values, but since I am using POSTMAN for the call, encoding is not necessary as POSTMAN will do that for you.

icon

Best answer by Dmitrii Naumov 30 March 2024, 16:36

View original

1 reply

Userlevel 7
Badge +5

For GIs you need to send filter value in the request body.

See https://help.acumatica.com/(W(15))/Help?ScreenId=ShowWiki&pageid=6340cff3-4732-4231-9e42-5d1e5e65b5dd

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved