Skip to main content
Solved

REST access to custom Generic Inquiry

  • January 12, 2024
  • 6 replies
  • 534 views

rcreasy
Varsity I
Forum|alt.badge.img

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?​​​​​

Best answer by Vignesh Ponnusamy

@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,

6 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • January 14, 2024

Hi @rcreasy ,

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


rcreasy
Varsity I
Forum|alt.badge.img
  • Author
  • Varsity I
  • January 15, 2024

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?


 

 


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

@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,


rcreasy
Varsity I
Forum|alt.badge.img
  • Author
  • Varsity I
  • January 15, 2024

@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!


Forum|alt.badge.img+3
  • Acumatica Moderator
  • February 15, 2024

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.


rcreasy
Varsity I
Forum|alt.badge.img
  • Author
  • Varsity I
  • February 16, 2024

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!