How To Bulk Replace Roles

Hello,

How does post_authorization_subject_bulkreplace work?

One of the arguments to be passed is a list of role/division pairs (RoleDivisionGrant). I thought that it would be similar to a PatchUser(), but the following code does not work:

user = 'weporiuqwoierupqwoierup'
body = [ ]
bodyPart = PureCloudPlatformClientV2.RoleDivisionGrants()
bodyPart.role_id = 'ghjshdflkajsdhf'
bodyPart.division_id = '093847509382457'
body.append(bodyPart)
auth_instance.post_authorization_subject_bulkreplace(user, body)

nvm, I figured it out. here's a sample:

pairs = []
rdv = PureCloudPlatformClientV2.RoleDivisionGrants()
body = PureCloudPlatformClientV2.RoleDivisionPair()
body.role_id = 'laksjdf;lkasdjf;lkj'
body.division_id = 'a;sldkjf;alskdjf;lkj'
pairs.append(body)
rdv.grants = pairs

auth_instance.post_authorization_subject_bulkreplace(user, rdv)

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.