07/19/2023 05:55 AM - edited 07/25/2023 06:01 AM
We are trying to get all of our users' usernames from the {{ECM}}/ECM/path/user endpoint and then use those usernames in the GetEntDetailsForUsers endpoint to get all of the entitlement values from a specific endpoint for that user and store them in his/her customproperty.
This requires us to do 2 calls: 1 for the user endpoint where we get the username & 1 for the GetEntDetailsForUsers endpoint to get the entitlement values.
NOTE: We don't have the colsToPropsMap setup correctly yet to get all of the entitlement values for that user, but we want to get the calls working first.
Currently, we are using this JSON but we get an error saying: Cannot invoke method containsKey() on null object
{
"type": "multiCall",
"call":[
{
"name": "call1",
"connection": "userAuth",
"url": "https://URL/ECM/api/v5/user?q=accountExpired:0&q=accountExpired:1",
"httpContentType": "application/JSON",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/JSON"
},
"userResponsePath": "results",
"colsToPropsMap": {
}
},
{
"name": "call2",
"connection": "userAuth",
"url": "https://URL/ECM/api/v5/getEntDetailsforUsers?endpointname=UH_OpenLDAP_EP&entitlementType=member&username=${userIdentifier}",
"httpParams": "{\"entQuery\":\"ent.entitlement_value like '%ou=OUSTUD%'\"}",
"httpContentType": "application/JSON",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/JSON"
},
"userResponsePath": "accessDetails",
"colsToPropsMap": {
"username": "username~#~char",
"customproperty30": "entitlement_value~#~char"
}
}
]
}
We have also tried using ${response.call1.message.username} to get the username from the first call. We have also tried using 2 fully seperate calls. We get the same error every time.
Any help would be greatly appreciated.
07/24/2023 08:49 AM - edited 07/24/2023 08:50 AM
@Caesrob Below sample should help:
{
"accountParams": {
"connection": "userAuth",
"processingType": "SequentialAndIterative",
"successResponses": {
"statusCode": [
200,
201,
202,
203,
204,
205
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
405,
500
]
},
"doNotChangeIfFailed": true,
"includeExistingInActiveAccounts": true,
"statusAndThresholdConfig": {
"deleteLinks": true,
"accountThresholdValue": 100,
"correlateInactiveAccounts": true,
"inactivateAccountsNotInFile": true,
"deleteAccEntForActiveAccounts": true
},
"call": {
"call1": {
"callOrder": 1,
"listField": "Accountdetails",
"keyField": "accountID",
"makeProcessingStatus": false,
"disableDeletedAccounts": true,
"http": {
"url": "http://@@DomainUrl@@@/ECM/api/v5/getAccounts",
"httpMethod": "POST",
"httpParams": "[{\"endpoint\":\"SolveSpace\"}]",
"httpContentType": "application/json",
"httpHeaders": {
"Authorization": "${access_token}"
}
},
"colsToPropsMap": {
"status": "status~#~char",
"accountID": "accountID~#~char",
"customproperty1": "customproperty1~#~char",
"customproperty2": "lastname~#~char",
"name": "name~#~char",
"customproperty3": "#CONST#EndUser~#~char",
"customproperty4": "creator~#~char"
}
}
}
},
"entitlementParams": {
"connection": "userAuth",
"processingType": "SequentialAndIterative",
"entTypes": {
"Role": {
"entTypeOrder": 0,
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "http://@@DomainUrl@@@/ECM/api/v5/getEntitlements",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "POST",
"httpParams": "[{\"endpoint\":\"SolveSpace\"}]"
},
"listField": "Entitlementdetails",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "entitlementID~#~char",
"entitlement_value": "entitlement_value~#~char",
"displayname": "displayname~#~char",
"customproperty1": "entitlement_valuekey~#~char",
"customproperty2": "endpointKey~#~char",
"customproperty3": "requestForm~#~char"
},
"disableDeletedEntitlements": true
}
}
}
}
},
"acctEntParams": {
"entTypes": {
"Role": {
"call": {
"call1": {
"processingType": "httpAcctToEnt",
"connection": "userAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "http://@@DomainUrl@@@/ECM/api/v5/getEntitlements",
"httpContentType": "application/json",
"httpMethod": "POST",
"httpParams": "[{\"endpoint\":\"SolveSpace\",\"accountname\":\"${id}\"}]"
},
"listField": "Entitlementdetails",
"entKeyField": "entitlementID",
"entIdPath": "entitlementID",
"acctKeyField": "accountID"
}
}
}
}
}
}
1. accountParams uses /ECM/api/v5/getAccounts to get accounts of a particular endpoint(application) in EIC.
2. entitlementParams uses /ECM/api/v5/getEntitlements to get all entitlements of a particular endpoint(application) in EIC.
3. acctEntParams uses ECM/api/v5/getEntitlements to get assigned entitlements to a account for a particular endpoint. It gets invoked for each account through the "processingType": "httpAcctToEnt" config and used {id} to iterate each account.
You can replace url and colsToPropsMap in the calls as per your need.
Please note that account params gets invoked during account import and rest 2 gets invoked during access import.
07/24/2023 09:00 AM
Hi @Caesrob,
By looking at your endpoint it seems you're using the getEntDetailsforUsers which I cannot find in the below API documentation. Can you try using getAccessDetailsForUser ?
Reference API Documentation : https://documenter.getpostman.com/view/1797923/2s83mbojGM#036952bf-1bf7-4121-aad5-0fe533f13c1d
07/24/2023 09:37 AM
@adriencosson , its present in 23.6 as mentioned in below :
https://documenter.getpostman.com/view/20697337/2s93sgXWAt#fd233a00-60a0-45c2-b74b-331d80c7916d