03/08/2023 01:28 PM - edited 03/08/2023 01:29 PM
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:
03/09/2023 03:20 PM
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.
03/10/2023 02:34 PM - edited 03/10/2023 02:45 PM
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?
03/13/2023 01:15 PM
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
03/14/2023 04:28 PM - edited 03/15/2023 02:01 PM
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"
]
}
}
}
}
}
03/15/2023 05:07 PM
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
03/17/2023 08:58 AM
Hi,
Unfortunately we cannot make changes to the API response...