Hello,
I am making a web service connector for a source we are trying to onboard in IDN.
In the target system API we have an optional field called technical ID that are are tying to fill with the corresponding event ID that we get in IDN logs/provisioning plan/events we get in the search . Is there a way to simply retrieve this information and put it in my API call?
To give an example when we want to put a first name we do "firstname":"$plan.firstName$". is there a way to to put the id in a similar format? ("technicalID":"$plan.eventID$")
If it is not possible to retrieve IDs our other option would be to put a timestamps, is this option also possible?
I’m not sure if is possible retrieve event Id, but it is possible send param using a timestamp value through Web Services Before Operation Rule, using the following code:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule name="Example Rule" type="WebServiceBeforeOperationRule">
<Description>This rule is used by the Web Services connector before performing any operation like testconnection, aggregation etc.</Description>
<Source><![CDATA[
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import connector.common.JsonUtil;
import connector.common.Util;
import sailpoint.connector.webservices.EndPoint;
import sailpoint.connector.webservices.WebServicesClient;
import sailpoint.object.Application;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import java.lang.System;
import java.sql.Timestamp
Map body = requestEndPoint.getBody();
String jsonBody = (String) body.get("jsonBody");
try {
Map jsonMap = JsonUtil.toMap(jsonBody);
if (jsonMap != null) {
if (provisioningPlan != null) {
for (AccountRequest accReq : Util.iterate(provisioningPlan.getAccountRequests())) {
for (ProvisioningPlan.AttributeRequest attReq : Util.iterate(accReq.getAttributeRequests())) {
String attrName = attReq.getName();
if (attrName != null && "firstname".equalsIgnoreCase(attrName)) {
jsonMap.put("firstname", attReq.getValue());
}
}
}
}
jsonMap.put("technicalID", new Timestamp(System.currentTimeMillis());
String finalBody = JsonUtil.render(jsonMap);
body.put("jsonBody", finalBody);
requestEndPoint.setBody(body);
}
} catch (Exception ex) {
log.error("Rule - Modify Body: " + ex);
}
return requestEndPoint;
]]></Source>
</Rule>
You can see more information regarding Web service before operation rule in this link