cancel
Showing results for 
Search instead for 
Did you mean: 

IDM REST V2 Assign Role

andrew_harvie3
Explorer
0 Kudos

We have recently upgraded to REST V2 and I am trying to convert my V1 API's.

I have no issue calling the self service tasks, but when I try to use the task below to assign a role to another employee, I get a 500 Internal Server Error.   I am pretty sure it is my lack of understanding of how MX_ASSIGNMENT is populated for an update

URI ...idmrestapi/v2/service/ET_MX_PERSON(ID=9946,TASK_GUID=guid'D092EA23-9E5D-4FC7-9467-1E1D0BBE3629')

Header

X-CSRF-Token : 9ovUtPO_dEgiJVEALrCCESTfiAY48xAdzkM

Content-Type : application/json

X-HTTP-Method : MERGE

Body

{"ER_MXREF_MX_ROLE":[{"REFERENCED_ID":"37174", “REASON”:“Role Assignment”,"VALID_FROM":"\/Date(1471305600000)\/","VALID_TO":"\/Date(1471478400000)\/"}]}

Any thoughts would be appreciated.

Thanks Andrew

Accepted Solutions (1)

Accepted Solutions (1)

jrondorf
Participant
0 Kudos

Did you try to use the REFERENCED_ID only (w/o reason and date fields)?

andrew_harvie3
Explorer
0 Kudos

Yes thanks that was my first attempt. 

I believe it is an error in either the documentation or the API implementation.  That task described does not have an attribute for MXREF_MX_ROLE only MX_ASSIGNMENT so unless the API does some internal mapping I should not have expect it to work.

So based on the attribute not assigned to the API, is there a different task that I should be looking at? Should I be extending the existing API's?  The RDS package does contain the required attributes but I would not expect those API's are fully supported by SAP.

Thanks,

Andrew

andrew_harvie3
Explorer
0 Kudos

Confirmed that I can assign a role using the RDS API, so it now boils down to why does the documented API not contain the required attributes. 

jrondorf
Participant
0 Kudos

What do you mean with "documented API" ?

The UI task needs to have MXREF_MX_ROLE defined if you want to change role assignments. You are not able to change role assignments over attribute MX_ASSIGNMENT over REST API.

andrew_harvie3
Explorer
0 Kudos

Thank you for the insight, resolved my issue by adding MXREF_MX_ROLE to the form. 

Answers (0)