Skip to main content
Solved

REST API returning empty set for some object types

  • Mar 4, 2025 8:39 PM UTC
  • 13 replies
  • 281 views
  • Translate All

Forum|alt.badge.img

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

13 replies

Forum|alt.badge.img+8
  • Captain II
  • Mar 4, 2025 8:45 PM UTC

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?

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Mar 4, 2025 8:52 PM UTC

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 []

Translate

Forum|alt.badge.img+8
  • Captain II
  • Mar 4, 2025 9:21 PM UTC

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?

Translate

Forum|alt.badge.img+8
  • Captain II
  • Mar 4, 2025 9:21 PM UTC

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

Translate

Dmitrii Naumov
Community Manager
Forum|alt.badge.img+7

​@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. 

 

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Mar 4, 2025 9:23 PM UTC

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.

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Mar 4, 2025 9:27 PM UTC

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

Translate

Dmitrii Naumov
Community Manager
Forum|alt.badge.img+7
  • Community Manager
  • Answer
  • Mar 4, 2025 9:32 PM UTC

Seems like a user permission issue then. 

 

 

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Mar 10, 2025 2:56 AM UTC

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. 

Translate

Forum|alt.badge.img+1
  • Freshman II
  • Jul 16, 2025 9:29 PM UTC

​@PSchirf61 what was the permission(s) that were missing?  I’m having an issue with API calls that used to work but no longer work after an upgrade.  Thanks.

Translate

Forum|alt.badge.img+1
  • Freshman II
  • Aug 20, 2025 4:57 PM UTC

​@PSchirf61 figured it out.  it was due to the user type not having the permissions for the branches and then setting those on the user account being used in the API.  Instead of throwing error, it just comes back empty because even though that user has access to the screen, it did’t yet have access to the contents of the screen.

Translate

Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • Aug 20, 2025 11:25 PM UTC

Thank you for sharing your solution with the community ​@ggnabasik47!

Translate

JSpikowski
Jr Varsity II
Forum|alt.badge.img
  • Jr Varsity II
  • Aug 21, 2025 4:31 AM UTC

Looking at response headers for a clue to empty responses is a good debugging tool.

Translate