Solved

Hw to retrieve users Roles using rest APIs

  • 9 August 2023
  • 2 replies
  • 135 views

Userlevel 4
Badge

hello everyone,
I have extended a default endpoint to include users. I am able to fetch details from the summary area using a get request on postman. 
However, I have tried to pull roles of specific users but I’m just getting errors.
Kindly assist on how I can fetch and manipulate roles of a specific user using rest api on post man.


 

all responses will be highly appreciated.
 

Thank you 

icon

Best answer by jinin 10 August 2023, 14:52

View original

2 replies

Userlevel 7
Badge +12

I dont know if that would work another way to do it would be to create a GI with all the tables fields you need then add this GI (screen) to your endpoint and use it. Ensure you use a ‘Put’ request to get the results.

Here is a good reference https://www.acumatica.com/blog/contract-based-apis-in-generic-inquiries/

Userlevel 7
Badge +11

Hi @Michael Ndungi ,

There is a limitation or issue with the query optimization when pulling roles of specific users through the Acumatica REST API GET call.

As @dcomerford  mentioned, you can create a custom endpoint with user role and use the put method and get the information.

I’ve attached the sample GI and endpoint

Method: PUT
URL: /entity/TEST/20.200.001/UserRole?$expand=UserRoleDetails
Input JSON

{

"UserName": { "value": "Admin" }

}

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved