cancel
Showing results for 
Search instead for 
Did you mean: 

Identity Management 8.0: Rest API v72alpha -> Role assignment with Context?

Former Member
0 Kudos

Dear community,

we are currently implementing a custom UI for the Identity Management based on the RestAPI v72alpha and are stuck with assigning roles (MX_ROLE) to an identity. While we are able to assign roles with a validity and reason, the API fails to assign the roles with a context.

The current code looks like this:

$.ajax({
type: "POST",  
url: "/idmrest/v72alpha/entries/9351/tasks/1323,  
data: {  "MXREF_MX_ROLE": "[{'REASON' : 'test reason', VALIDFROM : '2016-07-11', VALIDTO: '2016-12-28', 'VALUE':'44', CONTEXTID : '223'}] "},
contentType: "application/x-www-form-urlencoded",
dataType: "json",  
success: function(oResponse) { fnResolve();  },  
error: fnReject
});

Inputs:

  • 9351 is the MSKEY of the identity
  • 1323 is a task with MXREF_MX_ROLE
  • 44 is the MSKEY of the role. The role is enabled for the context-type of the context 223 (tested in the default UI)
  • 223 is the context ID

Does anyone have a suggestion/idea/example of this working? Maybe use a different task, as this task does not allow context based assignment within the standard UI. For this we use a guided task, which I'm not sure on how to address it with the Rest API.


Thanks for any help in advance,

Hendrik

Former Member
0 Kudos

Hi Hendrik,

Not sure you resolved this issue already but please check that you have enabled the Context option in Ext. properties of MXREF_MX_ROLE for Entry Type MX_ROLE.

Let me know how you go.

Thank you,

KV

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey Kautilya,

the context-based assignments are working and configured in a correct way.

As it turned out, the SAP documentation has a syntax error. With some extensive trial and error, we found this to be a working solution:

{
“REFERENCED_ID”:54321,
“CONTEXT”:{
“CONTEXT_ID”:12345
},

Answers (0)