Solved

REST access to custom Generic Inquiry

  • 12 January 2024
  • 6 replies
  • 130 views

Userlevel 3
Badge

I am following this Blog Post to create a REST endpoint for a custom GI.

I am doing a PUT, and I did set up the “Results” sub-entity
I have set up the endpoint as described. Regardless of what I add as the $expand query value, I get: 

{
    "id": "9a25f895-des9-4fe6-bcf4-551f8f5d7a58",
    "rowNumber": 1,
    "note": null,
    "custom": {}
}


Any suggestions of what I should try?​​​​​

icon

Best answer by Vignesh Ponnusamy 15 January 2024, 18:21

View original

6 replies

Userlevel 7
Badge +11

Hi @rcreasy ,

Could you please share the endpoint entity that you created for the custom endpoint?

Userlevel 3
Badge

Hi @jinin. Thanks for your response.

Here is my request URL
https://mySite.acumatica.com/entity/CGC_Test/22.200.001/RogerTest?expand=Result

Is this what you need?


 

 

Userlevel 7
Badge +4

@rcreasy,

From the response JSON, you can notice the Result node missing. Further, I see you are missing $ before the expand parameter in the Request URL. 

Try using https://mySite.acumatica.com/entity/CGC_Test/22.200.001/RogerTest?$expand=Result

Hope that helps.! Good Luck,

Userlevel 3
Badge

@Vignesh Ponnusamy Thank you! The $ was the problem.

I use insomnia for API testing. For some reason it was not adding the $ in this case.
Thanks for the help!

Userlevel 5
Badge +2

Hi @rcreasy 
Is there any specific reason you are not using OData in this case. 
A few benefits of using OData over REST API when reading data from Acumatica are-
1. You can use filtering options like top and skip.
2. OData is easier to maintain and has better performance.

Userlevel 3
Badge

Hi @rcreasy 
Is there any specific reason you are not using OData in this case. 
A few benefits of using OData over REST API when reading data from Acumatica are-
1. You can use filtering options like top and skip.
2. OData is easier to maintain and has better performance.

@ruchikasharma23 primarily because I already know REST, and honestly didn’t have time to learn about OData when I wrote the script. After learning more about it at Summit, I will likely move to OData in the future.
Thanks for reaching out!

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