Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Need to update the AccountId attribute while creating the account in target

DG1811
New Contributor III
New Contributor III

Hi Team,

We are trying to integrate a REST application. With the create account json, while creation of user we want to fetch the response and then align it with the account id field. 

But in response we are getting the 201 code and the below field, in which the xxxxxxxx part we want to map as the accountid for the user.


Location : http://domain/names.nsf/api/doc/unid/xxxxxxxx

 

Create account json used is as below.

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"accountID": "call1.message.id~#~char"
},
"call": [
{
"connection": "acctAuth",
"name": "call",
"url": "http://xxxxxxxxx/names.nsf/api/xxx/documents?form=xxxxxx&computewithform=true",
"httpMethod": "POST",
"httpHeaders": {
"Authorization": "${access_token}",
"ContentType": "application/json"
},
"httpContentType": "application/json",
"httpParams": "{\"ShortName\": \"${user.username}\",\"FirstName\": \"${user.firstname}\",\"LastName\": \"${user.lastname}\",\"InternetAddress\": \"${user.email}\",\"MailAddress\": \"${user.email}\",\"password\": \"${password}\",\"form\": \"Person\",\"MailSystem\": \"1\"}",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
403,
404,
405,
500
]
}
}
]
}

 

Can you please guide on what we need to select as part of the create json accountpathid, so that we can only fetch the xxxxxxxx value from the site that is coming in the response.

Thanks

27 REPLIES 27

NM
Honored Contributor II
Honored Contributor II

Hi @DG1811 , can you share API response.

DG1811
New Contributor III
New Contributor III

Response received on user creation is as below and we need to pull the "xxxxxxxx" value.

Location : http://domain/names.nsf/api/doc/unid/xxxxxxxx

NM
Honored Contributor II
Honored Contributor II

"customproperty11": "#CONST#${call1.message.location.substring(call1.message.location.indexOf('uid/')+1,call1.message.location.length())}

DG1811
New Contributor III
New Contributor III

hi @NM ,

Can you please share me the createaccount json using the above format please.

tHANKS 

NM
Honored Contributor II
Honored Contributor II

{

"accountIdPath": "#CONST#${call1.message.location.substring(call1.message.location.indexOf('uid/')+1,call1.message.location.length())}",

"responseColsToPropsMap": {

"accountID":"#CONST#${call1.message.location.substring(call1.message.location.indexOf('uid/')+1,call1.message.location.length())}"

},

"call": [

{

"connection": "acctAuth",

"name": "call",

"url": "http://xxxxxxxxx/names.nsf/api/xxx/documents?form=xxxxxx&computewithform=true",

"httpMethod": "POST",

"httpHeaders": {

"Authorization": "${access_token}",

"ContentType": "application/json"

},

"httpContentType": "application/json",

"httpParams": "{\"ShortName\": \"${user.username}\",\"FirstName\": \"${user.firstname}\",\"LastName\": \"${user.lastname}\",\"InternetAddress\": \"${user.email}\",\"MailAddress\": \"${user.email}\",\"password\": \"${password}\",\"form\": \"Person\",\"MailSystem\": \"1\"}",

"successResponses": {

"statusCode": [

200,

201,

204

]

},

"unsuccessResponses": {

"statusCode": [

400,

401,

403,

404,

405,

500

]

}

}

]

}

DG1811
New Contributor III
New Contributor III

Hi @NM ,

This is storing the constant value in the accountid field. Please find the snapshot for reference.

DG1811_0-1723113840000.png

Please suggest a step where we can pull the account details.

Thanks

NM
Honored Contributor II
Honored Contributor II

Make L captial in location

Should be Location.

DG1811
New Contributor III
New Contributor III

It is still the same @NM .

NM
Honored Contributor II
Honored Contributor II

Try this

#CONST#${response.call1.message.Location.substring(response.call1.message.Location.indexOf('uid/')+1,response.call1.message.Location.length())}

 

NM
Honored Contributor II
Honored Contributor II

@DG1811 ,

try this

{

"accountIdPath": "#CONST#${call1.message.location.substring(call1.message.location.indexOf('uid/')+1,call1.message.location.length())}",

"responseColsToPropsMap": {

"accountID":"#CONST#${call1.message.location.substring(call1.message.location.indexOf('uid/')+1,call1.message.location.length())}~#~char"

},

"call": [

{

"connection": "acctAuth",

"name": "call",

"url": "http://xxxxxxxxx/names.nsf/api/xxx/documents?form=xxxxxx&computewithform=true",

"httpMethod": "POST",

"httpHeaders": {

"Authorization": "${access_token}",

"ContentType": "application/json"

},

"httpContentType": "application/json",

"httpParams": "{\"ShortName\": \"${user.username}\",\"FirstName\": \"${user.firstname}\",\"LastName\": \"${user.lastname}\",\"InternetAddress\": \"${user.email}\",\"MailAddress\": \"${user.email}\",\"password\": \"${password}\",\"form\": \"Person\",\"MailSystem\": \"1\"}",

"successResponses": {

"statusCode": [

200,

201,

204

]

},

"unsuccessResponses": {

"statusCode": [

400,

401,

403,

404,

405,

500

]

}

}

]

}

{
"responseColsToPropsMap": {
"accountID": "#CONST#${call1.message.location != null ? call1.message.location.substring(call1.message.location.indexOf('uid/') + 4) : ''}"
}
}


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

rushikeshvartak
All-Star
All-Star

Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]



⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

DG1811
New Contributor III
New Contributor III

Hi @rushikeshvartak and @NM ,

We had a recent update on the request and now we are getting the UNID (marked in yellow) in the response in headers but as part of a URL. Please find the attached details below. 

DG1811_0-1723801295440.png

Please let us know if there are any way we can pull this out and mark it to the accountId field.

Thanks

[This message has been edited by moderator to mask sensitive info]

call1.message.values.Location


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi @rushikeshvartak ,
But it is coming in as body, rather the details are coming in headers and also the header value is just the URL, from which we need to take the UNID marked in yellow in the last image attached. 

thanks

First try to see if you can read location in cp then we can do replace (one step at a time)


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

Hi @DG1811 is it not coming in response now?

call1.message.values.Location.substring(indexof('unid/'),call1.message.values.Location.length())

Try this 

 

DG1811
New Contributor III
New Contributor III

Hi @NM ,

Yes it is coming in response but as a header, not as a body.

Thanks

Did you tried above suggestion ?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi @rushikeshvartak , 

Yes, we tried. Below is what populated in the task view field. Task is only getting completed, whereas the user is created in the target as per the provisioning comments. Please find the snapshot below. 

DG1811_0-1724060553627.png

the Provisioning comment have below content. 

{"call1":{"headers":"vgaSQhEEjr6zLpJD4bKRdntD5jelxiYW5X1U9YZaulMLPDk0XnZCiVKUyqj3ZO6/Mgo+18khbaGjCENb3jxrrCjzSFG0cS9PiFvc/BM5aeVW/chrN3erm6CeGrH4bQ4i8WWVP5hf2I3PZC5YGHZORXlry+NUSurhcfjri4khr1b0aGRit/MZzcWsfb96zZOmNxPqA/XuXWpuUocc2J+NMR4onHvRjPwcimMqGr7An24sE75xLjgduulbItXKnrtr8P6+AMOtxa1W4vKJ7sUAh/VETVmA5HgwdFYWbLV8S+j2l6kL0QVezQ8Sq7GKbiyznPFnyiin2P4fpTiVlC3RNm6Jew4XVy0K7jq8nd/gj3d4+0X5dZpLYu9xmhbBbhX2","message":"","statusCode":201,"description":null,"status":"Success"}}

Number of tries for provisioning

2

Thanks

[This message has been edited by moderator to mask sensitive information]

Now whats concern?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi @rushikeshvartak ,
The issue is still not resolved. As we are still not able to map the UNID value in the accountID field. Using this approach even the NEW ACCOUNT task is not getting completed. So we want to read the value in the header and post it in the accountid.

Thanks

  • Your create account response does not contains UNID
  • Make call2 -- Maybe Get call to get id and map to accountIDPath

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi @rushikeshvartak ,

Can you please suggest us with the create account json format checking on the create account json attached in the snippet. 

Missing attachment (attachment as text)


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi @rushikeshvartak ,

Attached the createaccountjson.

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"accountID": "call1.message.id~#~char"
},
"call": [
{
"connection": "acctAuth",
"name": "call",
"url": "http://xxxxxxxxx/names.nsf/api/xxx/documents?form=xxxxxx&computewithform=true",
"httpMethod": "POST",
"httpHeaders": {
"Authorization": "${access_token}",
"ContentType": "application/json"
},
"httpContentType": "application/json",
"httpParams": "{\"ShortName\": \"${user.username}\",\"FirstName\": \"${user.firstname}\",\"LastName\": \"${user.lastname}\",\"InternetAddress\": \"${user.email}\",\"MailAddress\": \"${user.email}\",\"password\": \"${password}\",\"form\": \"Person\",\"MailSystem\": \"1\"}",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
403,
404,
405,
500
]
}
}
]
}

Change JSON as per your API URL and response

{
  "accountIdPath": "call2.message.accountID",
  "responseColsToPropsMap": {
    "accountID": "call2.message.accountID~#~char"
  },
  "call": [
    {
      "connection": "acctAuth",
      "name": "call1",
      "url": "http://xxxxxxxxx/names.nsf/api/xxx/documents?form=xxxxxx&computewithform=true",
      "httpMethod": "POST",
      "httpHeaders": {
        "Authorization": "${access_token}",
        "Content-Type": "application/json"
      },
      "httpContentType": "application/json",
      "httpParams": "{\"ShortName\": \"${user.username}\",\"FirstName\": \"${user.firstname}\",\"LastName\": \"${user.lastname}\",\"InternetAddress\": \"${user.email}\",\"MailAddress\": \"${user.email}\",\"password\": \"${password}\",\"form\": \"Person\",\"MailSystem\": \"1\"}",
      "successResponses": {
        "statusCode": [
          200,
          201,
          204
        ]
      },
      "unsuccessResponses": {
        "statusCode": [
          400,
          401,
          403,
          404,
          405,
          500
        ]
      }
    },
    {
      "connection": "acctAuth",
      "name": "call2",
      "url": "http://xxxxxxxxx/names.nsf/api/xxx/documents/${call1.response.id}",
      "httpMethod": "GET",
      "httpHeaders": {
        "Authorization": "${access_token}",
        "Content-Type": "application/json"
      },
      "httpContentType": "application/json",
      "successResponses": {
        "statusCode": [
          200
        ]
      },
      "unsuccessResponses": {
        "statusCode": [
          400,
          401,
          403,
          404,
          405,
          500
        ]
      }
    }
  ]
}

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.