08/19/2022 10:00 AM
Hey,
We are trying to use REST connection CreateAccountJSON to send provisioning role to our inhouse application. We create 3 entitlement type and those are Dropdown single value. So I'll have 3 values to get.
So How do we get them in the CreateAccountJSON with ${}? We will also need to get the Start Date End Date While Request (that is showned on the request screen with "Ask For Start Date End Date While Request")
Thanks a lot!
Solved! Go to Solution.
08/19/2022 10:46 AM - edited 08/19/2022 10:48 AM
You can't get entitlement name & start date in CreateAccountJSON. You can get same AddAccessJSON REST Connection
if you want to access in createAccountJSON then it needs to be dynamic attribute on request form
08/19/2022 10:53 AM
So if I change from my json from CreateAccountJSON to GrantAccessJSON how can I get entitlement value per entitlement type? What is the Syntax? Is hard to find some documentation on which variable is available for JSON...
In my case I have 3 Entitlement type, so 3 selected value to get plus need custom properties on the entitlement to be sent has params to the api...
thanks
08/19/2022 11:03 AM
{
"call": [
{
"name": "Group"
},
{
"name": "Role"
}
]
}
Role & Group is entitlement Type
${entitlementValue.customproperty1} is syntax to get value of entitlement.
08/19/2022 11:23 AM
I have something like this into AddAccessJSON:
{
"call": [{
"name": "GiveAccess",
"connection": "X",
"url": "url",
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "POST",
"httpHeaders": {
"Authorization": "${token}"
},
"httpParams": "{}",
}]
}
So to get each of my entitlement I'll need to make another "call" to get it then use it in my parameter?
Sorry i'm new with Saviynt and didn't work pretty much with JSON instead with javascript...
08/19/2022 11:29 AM
Refer link given in previous reply
Sample
{ "call": [ { "name": "Group", "connection": "acctAuth", "url": "https://<domain name>/api/v2/group_memberships", "httpMethod": "POST", "httpParams": "{\"group_membership\": {\"user_id\": \"${account.accountID}\", \"group_id\": \"${entitlementValue.entitlementID}\"}}", "httpHeaders": { "Authorization": "${access_token}", "Accept": "application/json" }, "httpContentType": "application/json", "unsuccessResponses": { "error": "RecordInvalid" } }, { "name": "Role", "connection": "acctAuth", "url": "https://<domain name>/api/v2/users/${account.accountID}", "httpMethod": "PUT", "httpParams": "{\"user\": {\"custom_role_id\": ${entitlementValue.entitlementID}}}", "httpHeaders": { "Authorization": "${access_token}", "Accept": "application/json" }, "httpContentType": "application/json", "unsuccessResponses": { "error": "RecordInvalid" } } ] }
Role & Group is entitlement Type
08/19/2022 11:41 AM
so those call will get the entitlement type like store i variable, than can use them in params for my inhouse API post call?
08/19/2022 11:56 AM
Yes
08/29/2022 05:31 AM
Hey, Like I mentionned previously, I want to get 3 entitlement types. Does I need to do 3 call like the sample? How should I know which one is it when I receive the values?
08/29/2022 05:38 AM
Role & Group is entitlement Type is Entitlement Types yes for each entitlement type it will be separate call
08/30/2022 05:41 AM
Hey, question again. I've add the json in the AddAccessJson but when teying to provision the task, there have an error and after 10 receive an error status on the task. Where I can see the error log for those? thanks
08/30/2022 06:33 AM
ARS - Pending tasks - provisioning Comments
Admin - Admin Function - Application logs
08/30/2022 07:29 AM
Ok thanks,
Ok thanks... Also, on the AddAccessJson I receive error on Existing Comments
08/30/2022 07:41 AM
Share screenshot or try with new request. maybe accountkey in target is unique
08/30/2022 11:01 AM
Same thing with new request. Seems to be in the AddAccessJson the problem but nothing refer to Account Key
{
"call": [{
"name": "Role",
"connection": "userAuth",
"url": "outUrl",
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "POST",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpParams": " {\"test\":\"${allEntitlementsValues}\"}",
"successResponses": {
"statusCode": [
200,
201,
202,
203,
204
]
},
"unsuccessResponses": {
"statusCode": [
404,
401,
400
]
}
}]
}
08/30/2022 11:13 AM
"accountIdPath": "accountName",
Missing accountIdPath
08/30/2022 12:22 PM
tried to redo a request and add it in CreateAccountJson or AddAccessJson and same problem occur
08/30/2022 12:27 PM