Skip to main content
Solved

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


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

 

 

Best answer by bgrassi

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 

View original
Did this topic help you find an answer to your question?

  • Freshman II
  • March 29, 2023

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. 


  • Freshman II
  • March 29, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings