Call Update User API return OK but value not updated.

27215

hi everyone,

I call an API which is used to update an existing user in the system Update User API :  https://<highqinstance_name>/api/13/users/194 

Here's the request payload:

{  "lastlogindate": "30 Nov 2022 04:01",  "invalidlogins": "0",  "org": "3",  "sites": {    "sitecount": 1,    "site": [      {        "id": 48,        "sitename": "NashTech Dev Site 3"      }    

 

After that, I check the data using the Get User API : https://<highqinstance_name>/api/13/users/194?type=id 

But the field 'lastlogindate' doesn't match the value that I updated before:

 

I need to know the details of usage of this API. In case this is a bug is there another API that I can use?

Thanks you.

]]>
Parents
  • Ha Nguyen Danh, I'm not seeing that in my tests.

    I have two browsers running:

    • Chrome (logged in as Me = Sys Admin)
    • Firefox (logging in as Normal User)

    Then, given the following test workflow:

    • [FF
    • [Chrome] I search for the user in Collaborate System Admin, User Administration module
      • Shows user Last Logged In:
        • 30 Nov 2022 19:21:53 (in ADST, GMT+11)
      • Use Get User API call to verify above, it too reports:
        •  "lastlogindate": "30 Nov 2022 08:21" (in UTC)
    • [FF] ...Wait > 1min, then click on one of the sites user has access to
    • [Chrome] Re-run searches..
      • No changes to reported login date/times
    • [FF] ...Wait > 1min, then click on another one of the sites user has access to

    • [Chrome] Re-run searches..
      • No changes to reported login date/times

     

    However, if I call the Get All Site Users API call, passing in the site(s) just visited by the user, then for that user, I get:

    • Called for 1st site: "lastlogin": "30 Nov 2022 08:26"
    • Called for 2nd site: "lastlogin": "30 Nov 2022 08:28"

    This is expected behaviour.

    Get All Site Users returns a collection of Site User objects, which is a superset of User objects in that there are additional attributes that are only applicable to a Site User, e.g. invited, lastlogin, and role. The other attributes are inherited from the subset User object, e.g. name, email, jobtitle.

    So whether you search for a user by using Get User, or by using Get All Site Users, you will get different values for "last logged in", as one is for the (instance) User, the other for the Site User.

    Andrew

    ]]>
Reply
  • Ha Nguyen Danh, I'm not seeing that in my tests.

    I have two browsers running:

    • Chrome (logged in as Me = Sys Admin)
    • Firefox (logging in as Normal User)

    Then, given the following test workflow:

    • [FF
    • [Chrome] I search for the user in Collaborate System Admin, User Administration module
      • Shows user Last Logged In:
        • 30 Nov 2022 19:21:53 (in ADST, GMT+11)
      • Use Get User API call to verify above, it too reports:
        •  "lastlogindate": "30 Nov 2022 08:21" (in UTC)
    • [FF] ...Wait > 1min, then click on one of the sites user has access to
    • [Chrome] Re-run searches..
      • No changes to reported login date/times
    • [FF] ...Wait > 1min, then click on another one of the sites user has access to

    • [Chrome] Re-run searches..
      • No changes to reported login date/times

     

    However, if I call the Get All Site Users API call, passing in the site(s) just visited by the user, then for that user, I get:

    • Called for 1st site: "lastlogin": "30 Nov 2022 08:26"
    • Called for 2nd site: "lastlogin": "30 Nov 2022 08:28"

    This is expected behaviour.

    Get All Site Users returns a collection of Site User objects, which is a superset of User objects in that there are additional attributes that are only applicable to a Site User, e.g. invited, lastlogin, and role. The other attributes are inherited from the subset User object, e.g. name, email, jobtitle.

    So whether you search for a user by using Get User, or by using Get All Site Users, you will get different values for "last logged in", as one is for the (instance) User, the other for the Site User.

    Andrew

    ]]>
Children
No Data