SAP Knowledge Base Article - Public

3459576 - How to remove a User from a Usertype group by using SCIM API

Symptom

When using PATCH <URL>/api/scim/v2/Groups/{UserTypeID} -USERTYPE to remove a member from the UserType group, CPQ is returning Status 200 OK but no changes are occurring on the usertype members list. 

Environment

SAP SALES CLOUD CPQ

Reproducing the Issue

  1. Use GET SCIM/V2/Groups to retrieve information for a USERTYPE group
  2. Use Patch <URL>/api/scim/v2/Groups/{UserTypeID} -USERTYPE to remove one of the members/update members  of the group
    • Payload: 
      {
          "Operations":[
              {"op":"replace",
              "path":"members",
              "value":[{"value":"member_value"}]}]
      }
  3. API Response is status 200, but it can be seen, performing a GET again, that no changes were done in the group. 

Cause

Expected Behavior.

Resolution

  • In SCIM API there is not concept called User Type, like we have in CPQ, so in order to support it in CPQ system SCIM API is implemented that User Types are Groups with suffix -USERTYPE in Group ID
  • User Type is mandatory field for every user in CPQ and every user needs to have assigned User Type. And one user can only be assigned to one user type
  • On the other hand, CPQ has Permission Groups concept, where one user can be assigned to multiple Permission Groups by different 'types':
    • By User Type
    • By Company
    • By Brand
    • By Market
    • Directly (By User)
  • In CPQ SCIM API groups without -USERTYPE suffix are representing CPQ Permission Groups and its members are different users assigned to Group
  • For the scenario to change UserType of a user, the following can be done:
    • There is User1(id: 1) and User2(id:2), and they have assigned UserType1(id: user_type_1_cpq) and UserType2(id: user_type_2_cpq) respectively
    • When you call GET endpoint api/scim/v2/Groups/user_type_1_cpq-USERTYPE it will be seen that only User1 is member of this group. Calling GET endpoint api/scim/v2/Groups/user_type_2_cpq-USERTYPE will show that only User2 belongs to this group
    • Calling PATCH request api/scim/v2/Groups/user_type_1_cpq-USERTYPE, with body 
      {    "Operations":[{"op":"replace","path":"members","value":[{"value":"2"}]}]}, will replace member in UserType1 group,  in other words, for User2, User Type will be change to UserType1
    • Executing GET endpoint api/scim/v2/Groups/user_type_1_cpq-USERTYPE it will be seen that this group now have 2 members.  Meaning that it was changed User Type of User2 to UserType1, and that automatically means that User2 is not anymore member of UserType2 group
  •  When reassigning Groups with -USERTYPE suffix in id, it will change User Type of specific user in CPQ system.

See Also

SCIMV2Groups API

Keywords

SCIM,UserType,API,REST,CPQ , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , How To

Product

SAP CPQ 2023