am0046730

REST API Users Endpoint Updating Primary Institution Role

Discussion created by am0046730 on Aug 22, 2017
Latest reply on Aug 25, 2017 by am0046730

Has anyone else found that issuing a PATCH call to endpoint /learn/api/public/v1/users/userName:xxxx causes the institution_roles_pk1 column value in the users table to switch with a secondary role found in the user_roles table?

 

Here are the results of my test:

 

The Users table for the updated user account before the call:

The User Roles table for the updated user account before the call:

 

REST CALL:

PATCH /learn/api/public/v1/users/userName:amariga HTTP/1.1

Host: [hostname]

Content-Type: application/json

Authorization: Bearer [token value]

Cache-Control: no-cache

Postman-Token: 8db45fae-3eba-73ef-866d-9d63921f1099

 

{

    "name": {

    "given" : "Atlas",

    "family" : "Mariga"

    }

}

 

Users table after the PATCH call to users:

User Roles table after the PATCH call to users:

 

Note that the REST API request only sends a name change in the body.  I don't see any way to adjust institution roles using the API, so I'm confused why the call seems to have taken the user's primary institution role (220) and switched it with the first secondary institution role (found in the user roles table).

 

Does anyone have any ideas or suggestions for how to avoid this unwanted update to institution roles?  Thanks. 

Outcomes