Skip to main content
Solved

ODataV4 $expand returns 404

  • February 23, 2024
  • 2 replies
  • 133 views

I’m attempting to use the $expand parameter in an OData v4 query. However, anything that I put in the $expand just causes the server to return 404. For example, I can get a PO with POOrder(OrderType='RO',OrderNbr='12345'). And it returns the POLineCollection property, already expanded. But if I explicitly request ?$expand=POLineCollection, I just get a 404. What’s strange to me is that if I set ?$expand= it does not expand the POLineCollection property. So it is definitely reading the $expand parameter.

I’ve tried expanding multiple navigation properties, using their names defined in the OData metadata XML. None of them work. I’ve even tried copy-pasting the examples from Exact Session Title (acumatica.com) as well as the URL provided in the answer to this topic, with the same result: 404. 

I have no idea what I’m doing wrong here.

For reference, here’s my full URL: https://myinstance.com/ODatav4/My Tenant Id/POOrder(OrderType='RO',OrderNbr='12345')?$expand=POLineCollection

Best answer by shawnbeachy

Well, 5 hours later I feel properly dumb. I’m using Insomnia to send my requests, and didn’t realize that $expand was already being set in the Query tab. I was attempting to set it in my URL, which of course resulted in 2 “$expand” parameters.

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

Well, 5 hours later I feel properly dumb. I’m using Insomnia to send my requests, and didn’t realize that $expand was already being set in the Query tab. I was attempting to set it in my URL, which of course resulted in 2 “$expand” parameters.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • February 23, 2024

Thank you for sharing your solution with the community @shawnbeachy!


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