Skip to main content
Solved

REST API returning empty set for some object types


I’m trying to get some data using the Acumatica REST API, and while it works for some entities (StockItem, TaxCategory, Contact, Account) just fine, others (SalesOrder, SalesInvoice, or Customer) return 200 status with a json empty set returned ala []. 

Note: I CAN see data for SalesOrder, Customers, etc, using my normal login in the standard UI.

Does this sound like a permission issue on the APIUSER user account that is calling the REST API?

Thanks for your time, Paul

Best answer by Dmitrii Naumov

Seems like a user permission issue then. 

 

 

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

9 replies

Forum|alt.badge.img+6
  • Captain II
  • 554 replies
  • March 4, 2025

If you’re logging in with your login then you should be governed by your login’s security.

What is the URL are you’re using for the SalesOrder call?


  • Author
  • Freshman II
  • 8 replies
  • March 4, 2025

I’ve tried:

{our site}/entity/Default/18.200.001/SalesOrder/006277

which generates: "exceptionMessage": "Operation is not valid due to the current state of the object.",

and

{our site}/entity/Default/18.200.001/SalesOrder?$filter=OrderNbr eq '006277'

which returns []

In fact, 
/entity/Default/18.200.001/SalesOrder?$top=7

returns []


Forum|alt.badge.img+6
  • Captain II
  • 554 replies
  • March 4, 2025

SalesOrder has a two part key so if you want to use a direct URL you need to split out the Order Type:

{our site}/entity/Default/18.200.001/SalesOrder/SO/006277  (under the assumption your order type is SO)

What if you leave out the filter? Just end your GET call URL with (make sure you’re using GET)

/entity/Default/18.200.001/SalesOrder

Do you get anything returned?


Forum|alt.badge.img+6
  • Captain II
  • 554 replies
  • March 4, 2025

Oh - and do you have more than one Tenant in this database?


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 630 replies
  • March 4, 2025

@PSchirf61 do you use the same user for UI and API? 

Also, I’d recommend you to use a newer API version, e.g. 22.200.001 instead of 18.200.011. 

 


  • Author
  • Freshman II
  • 8 replies
  • March 4, 2025

No, I do not use the same user.  My “normal” user can see the data.  The API user has the issue described above.  I mentioned the normal user to indicate that the data exists.


  • Author
  • Freshman II
  • 8 replies
  • March 4, 2025

https://xeroshoes.acumatica.com/entity/Default/18.200.001/SalesOrder 

returns 200 OK with no data: []

https://xeroshoes.acumatica.com/entity/Default/18.200.001/SalesOrder/SO/006277

returns  "exceptionMessage": "No entity satisfies the condition.",


With my normal user, this sales order exists:
/(W(1))/Main?CompanyID={our company ID}&ScreenId=SO301000&OrderType=SO&OrderNbr=006277


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 630 replies
  • Answer
  • March 4, 2025

Seems like a user permission issue then. 

 

 


  • Author
  • Freshman II
  • 8 replies
  • March 10, 2025

Yes, this was a permissions issue, which is a little strange.  I would have expected a permissions issue to return a message that I lacked permission to a specific data type/object, but instead got an empty set. 


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