How to get Inactive Users via api call from outside sugar.

Hi,
I am trying to find a user in sugar via user_name field and that user is inactive. While making api call via postman i am not getting that inactive user detail.


http://<localhost>/rest/v11/Users/?filter[0][user_name]=Test

Is there any param available for getting the inactive user via api call or do i need to make some customization in sugar to get that user.

Thanks

Parents Reply
  • I need to sync records to sugar from other system. and that system may have some records assigned to inactive user. That system provides user_name as assignment identity. So first i need to fetch that user from sugar via that username and then do assignment.
    As username can be of inactive user so i am not able to get the id of that user via default get api call.
    So thats why i was asking is there any default way to achieve that. Or i need to write custom api.

Children
  • Interesting, thanks for the explanation -

    You may have to write a custom API to search by Inactive users, since Sugar filters them out by default. Follow this link on how to create custom APIs - and you can write your custom logic to return the Inactive user IDs.

    But - there are a couple of other options you could explore:

    1. Make the user active, migrate the data, and then make the user inactive again. If you want to disable login, you can just set a random password in user_hash and force sugar_login as true.

    2. Get all the list of users upfront from the DB (or from the Admin UI), cache them and use the IDs directly in your migrate script.

  • If other system provides the name of a person not listed in active users by name it means this user is not allowed to use Sugar anymore.
    What is the purpose to get the Sugar internal id of such a person?
    Do assignments to other eligible Sugar users, using the name as identifier (if you search id by name, that means it is identifier too)

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient