Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Mapping child entitlements in importAccountEntJSON

JoshuaLawrence
New Contributor III
New Contributor III

Hi, we are having trouble trying to map the accessRule entitlements with the cardReader entitlements. Our API response looks like the following where for each cardReader we have a list of accessRules: 

 

{
    "Rsp": {
        "Status""Ok",
        "Result": {
            "AccessPermissionLevel"7,
            "PreferredUnit""00000000-0000-0000-0000-000000000000",
            "PreferredInterface""00000000-0000-0000-0000-000000000000",
            "AccessRules": [ <-- Guid of accessRules
                "433f92b5-ebdd-4cad-9e1d-07ae2402bca0",
                "b73d8171-e901-428c-ab90-01b5a060959b",
                "c2b158f5-1aa7-45a0-b097-9e4d918719b9"
            ],
         "Guid": "e2e9196c627846c5ae6c1bd912bdf580",    <-- Guid of cardReader
         ...
      }
}
 
And our ImportAccountEntJSON has these sections:
 
"entitlementParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"entTypes": {
"accessRule": {
"entTypeOrder": 0,
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "<url>",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "text/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "Rsp.Result",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "Guid~#~char",
"entitlement_value": "Guid~#~char"
},
"disableDeletedEntitlements": true
},
"call2": {
"connection": "acctAuth",
"callOrder": 1,
"stageNumber": 3,
"http": {
"url": "<url>",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "text/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"inputParams": {
"entitlementname": "accessRule"
},
"listField": "",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "Rsp.Result.Guid~#~char",
"entitlement_value": "Rsp.Result.Guid~#~char",
"displayName": "Rsp.Result.Name~#~char"
},
"disableDeletedEntitlements": true
}
}
},
"cardReader": {
"entTypeOrder": 0,
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "<url>",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "text/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "Rsp.Result",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "Guid~#~char",
"entitlement_value": "Guid~#~char"
},
"disableDeletedEntitlements": true
},
"call2": {
"connection": "acctAuth",
"callOrder": 1,
"stageNumber": 3,
"http": {
"url": "<url>",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "text/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"inputParams": {
"entitlementname": "cardReader"
},
"listField": "",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "Rsp.Result.Guid~#~char",
"entitlement_value": "Rsp.Result.Guid~#~char",
"displayName" : "Rsp.Result.Name~#~char"
},
"disableDeletedEntitlements": true
}
}
}
}
},
 
"entMappingParams": {
"processingType": "SequentialAndIterative",
"entTypes": {
"cardReader": {
"ent1KeyField": "entitlementID",
"call": {
"call1": {
"connection": "acctAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"httpHeaders": {
"Authorization": "${access_token}",
"Accept" : "text/json"
},
"url": "<url>",
"httpMethod": "GET"
},
"listField": "Rsp.Result.AccessRules",
"ent1IdPath": "Rsp.Result.Guid",
"ent2IdPath": "",
"ent2KeyField": "entitlementID",
"targetEntType": "accessRule",
"addDependentTask": true,
"removeDependentEntTask": true,
"mappingTypes": [
"ENT2"
]
}
}
}
}
}
 
We are getting this error in the logs: 
Exception in RestUtil.getAt : groovy.lang.MissingPropertyException: No such property: Rsp for class: java.lang.String
 
We have tried different combinations of values for ent1 and ent2, but none of them seem to work. Just wondering if there is a way to map these entitlements with the API response in this format where child entitlements are inside an array?
 
6 REPLIES 6

timchengappa
Saviynt Employee
Saviynt Employee

Hello @JoshuaLawrence 

Do you have another API with a list of all available AccessRules entitlements? regardless of what cardReader it is mapped to? Similarly forcardReader? Ideally, on a very high-level, the API responses to achieve this should look like the below...

API 1: To fetch all AccessRules entitlements
{
"Rsp": {
"Status": "Ok",
"Result": {
"AccessRule1": [
"GUID":"aaaaaaaaaaaaaaaaaaaa",
"AccessRuleName":"ABC",
"AccessRuleDescription":"Test Description"
],
"AccessRule2": [
"GUID":"bbbbbbbbbbbbbbbbbbbb",
"AccessRuleName":"XYZ",
"AccessRuleDescription":"Test Description"
]
.........
}
}

API 2: To fetch all cardReader entitlements
{
"Rsp": {
"Status": "Ok",
"Result": {
"cardReader1": [
"GUID":"cccccccccccccccccc",
"cardReaderName":"lmn",
"AccessRuleDescription":"Test Description"
],
"cardReader2": [
"GUID":"ddddddddddddddddddd",
"cardReaderName":"opq",
"AccessRuleDescription":"Test Description"
]
.........
}
}

API 3: That provides AccessRules to cardReader relationships
{
"Rsp": {
"Status": "Ok",
"Result": {
"<Guid of cardReader1>": [<Guid of AccessRules1>, <Guid of AccessRules2>, ......
],
"<Guid of cardReader2>": [<Guid of AccessRules3>, <Guid of AccessRules4>, ......
]
.........
}
}


Below are the high-level steps that you need to be performing...

a) Create an entitlement type cardReader
b) Create an entitlement type AccessRules
c) Import only the entitlements of type cardReader
Doc Ref: 
d) Import only the entitlements of type AccessRules
e) Club both the JOSNs used to import both the entitlement types and construct another section to specify the AccessRules to cardReader either in Ent2 table or in ENTMAP table.

Doc: https://docs.saviyntcloud.com/bundle/REST-v2022x/page/Content/Developers-Handbook.htm
Please look for the below section in the documentation for JSON samples.

entMappingParams - Specify this value for mapping between current entitlement value with other entitlement values normally of other entitlement types where the possible values are ENT2 and ENTMAP.

JoshuaLawrence
New Contributor III
New Contributor III

Hi, 

We have API's to fetch all accessRules and all cardReaders however we do not have a separate API to fetch the relationship between accessRules and cardReaders. The relationship is contained within the cardReader details in an array. This is a similar situation to our account-entitlement mapping where we store STORE#ACC#ENT#MAPPINGINFO~#~char in account customproperty31 and used the acctToEntMapping processing type like the bellow: 

"acctEntParams": {
"entTypes" : {
"accessRule" : {
"call" : {
"call1" : {
"callOrder" : 0,
"stageNumber" : 0,
"processingType" : "acctToEntMapping"
}
}
}
}
}

Is there a similar way to do this for entitlement-entitlement mapping possibly?

timchengappa
Saviynt Employee
Saviynt Employee

Hello @JoshuaLawrence , 

The Account-Ent mapping mechanism is slightly different from that of the Ent-Ent mapping and would not work like the "STORE#ACC#ENT#MAPPINGINFO~#~char" approach.

It looks like the sample you provided at the very beginning is your API-3 that I referred to in my previous post. That is an API that provided you with 'AccessRules' to 'cardReader' relationships. As long as you have one snip for each of the 'cardReader' type entitlement and within that snip if there
is a mention of  'AccessRules' that belong to the cardReader in that snip, we should be good...

Please refer to the "entMappingParams - Specify this value for mapping between current entitlement value with other entitlement values normally of other entitlement types where the possible values are ENT2 and ENTMAP" section of documentation below...

https://docs.saviyntcloud.com/bundle/REST-v2020x/page/Content/Developers-Handbook.htm

Hi,

After trying this solution again I was able to map one of the accessRules to the cardReader by specifying "ent1IdPath" as "Rsp.Result.AccessRules[0]", but I think the main issue is mapping multiple accessRules.  Since the array of accessRules Guid's in the response has no key value pair, only values, we have nothing to fill in for "ent1IdPath" in the entMappingParams section. If we leave it blank, we get the following error in the logs: groovy.lang.MissingPropertyException: No such property: for class: java.lang.String

 

"entMappingParams": {
"processingType": "SequentialAndIterative",
"entTypes": {
"accessRule": {
"ent1KeyField": "entitlement_value",
"call": {
"call1": {
"connection": "acctAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"httpHeaders": {
"Authorization": "${access_token}",
"Accept" : "text/json"
},
"url": "<url>",
"httpMethod": "GET"
},
"listField": "Rsp.Result.AccessRules",
"ent1IdPath": "",
"ent2IdPath": "Rsp.Result.Guid",
"ent2KeyField": "entitlement_value",
"targetEntType": "cardReader",
"mappingTypes": [
"ENTMAP"
]
}
}
}
}
}

 

timchengappa
Saviynt Employee
Saviynt Employee

Hi @JoshuaLawrence 

I think you are right...
Is there any room to make changes to the API response? To fit it in the format I specified earlier(API 3: That provides AccessRules to cardReader relationships)?

Do let me know... I can then work on supplying you with the exact API response format required to achieve this use-case

Hi,

Unfortunately we cannot make changes to the API response...