Skip to main content
Solved

Get all results from GI rest API using "PUT"

  • October 27, 2023
  • 8 replies
  • 278 views

Driss
Jr Varsity III
Forum|alt.badge.img

Hey everyone

 

hope everything is good 

 

I’m trying to get all results from GI using “PUT” Method but i get only 1 result instated of all results that i have 

 

 

 

But here is my GI that i have in Acumatica

 

 

Best answer by Dmitrii Naumov

@Driss  make sure your GI is mapped to the endpoint properly. 

That is the header is mapped to the TopLevel entity and the results are mapped separately to the detail level entity under the TopLevel entity.

8 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • October 27, 2023

Hi @Driss 

Can you please share the endpoint URL and Request JSON?


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • October 27, 2023

@Driss  make sure your GI is mapped to the endpoint properly. 

That is the header is mapped to the TopLevel entity and the results are mapped separately to the detail level entity under the TopLevel entity.


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • October 27, 2023

@Dmitrii Naumov Hey Thanks for you answer i have created the endpoint like this 

 

 


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • October 27, 2023

@Driss looks good. 

You should then call the Put with $expand=Results


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • October 27, 2023

@Dmitrii Naumov  Hey Yeah i’ve added $expand=Results it throws 

"The given key was not present in the dictionary.",

 

I tried $expand=Result but still returning only one record 

 

 


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • October 27, 2023

@Driss it in fact will return one top level record, but inside there will be an array of Result records.


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • October 27, 2023

@Dmitrii Naumov Thanks, yeah it showing the array of result but it only one result on that array 


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • October 27, 2023

@Dmitrii Naumov  The issue is fixed i was populating results for Top-level and detail that was the issue i only populate that in the details that fixed the issue