We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

How to get custom property of entitlement for CreateAccountJSON

Jillustre
New Contributor III
New Contributor III

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!

 

17 REPLIES 17

rushikeshvartak
All-Star
All-Star

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

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

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

Refer : https://saviynt.freshdesk.com/support/solutions/articles/43000521736-rest-connector-guide#RESTConnec... 

{
"call": [
{
"name": "Group"
},
{
"name": "Role"
}
]
}

Role & Group is entitlement Type

${entitlementValue.customproperty1} is syntax to get value of entitlement.


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Jillustre
New Contributor III
New Contributor III

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...

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 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

so those call will get the entitlement type like store i variable, than can use them in params for my inhouse API post call?

Yes


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

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?

Role & Group is entitlement Type  is Entitlement Types yes for each entitlement type it will be separate call


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

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

ARS - Pending tasks - provisioning Comments

rushikeshvartak_0-1661866321067.png

 

Admin - Admin Function - Application logs 

rushikeshvartak_1-1661866381492.png

 

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Ok thanks,

Ok thanks... Also, on the AddAccessJson I receive error on Existing Comments

Account Key already exists for the account name. Setting Accountkey in for the Task.
not sure what is wrong here 

Share screenshot or try with new request. maybe accountkey in target is unique


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

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
]
}
}]
}

 

https://saviynt.freshdesk.com/support/solutions/articles/43000521736-rest-connector-guide%C2%A0#REST... 

 

  "accountIdPath": "accountName",

 

 Missing accountIdPath


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

tried to redo a request and add it in CreateAccountJson or AddAccessJson and same problem occur

Did you tried with fresh account ?

Always share logs


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.