Solved

HTTP PUT via REST API for Payroll Generic Inquiry fails " given key was not present "

  • 22 June 2022
  • 2 replies
  • 236 views

Hi, thanks for any help - rather new to integrating against the Acumatica API and to date have done so only against existing endpoint to create, retrieve and update invoice line details.  This is a first attempt to use a Generic Inquiry and expand the web service endpoint.

I have followed the same steps outlined in Accessing Data in Generic Inquiries using Contract Based API’s - Acumatica Cloud ERP to expand the Rest API endpoint with a generic inquiry that provides employee leave balance.

The inquiry has no required parameters so simply have {} in the body.

The API PUT call fails with  "exceptionMessage": " The given key was not present in the dictionary."

I am not very sure where to start to address the error.

Note the inquiry uses payroll related and other tables that are not exposed anywhere else in the rest api - if any fields listed in the inquiry mean extending further the web service endpoint to add the objects, please help explain how to know what to add.

Please see the screen captures below for details of the end point created and the inquiry itself.

Many thanks - any help really appreciated.

FAILED API CALL

DETAILS OF END POINT extended with new EntitlementsBalanceView object - fields only in the results level named "EntitlementsBalanceViewDetails"

 

 

 

THIS IS THE CORRESPONDING GENERIC INQUIRY

It has no required parameters - just one optional with a default value

 

 

icon

Best answer by bgrassi 29 March 2023, 19:55

View original

2 replies

Hey Moris, 

Did you ever find a resolution to this? I am having the exact same issue. Trying to do an API call for a generic Inquiry and cannot get it to pull properly. 

Figured this out. If you have fields populated at the top level view it does not matter if you include $expand=Result in the API call. It will always return the top record. 

 

Remove the populated fields from the top level view and then under the Results Entity populate the fields. 

 

Be sure to include /?$expand=Result at the end of your API call 

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