Service Account APIs

CA Identity Portal exposes several API methods, which enable external processes to fetch or update the requests. These APIs are mostly helpful when there are external processes returning information to the user who requested the request and append it as part of the request.
cis141
CA Identity Portal exposes several API methods, which enable external processes to fetch or update the requests. These APIs are mostly helpful when there are external processes returning information to the user who requested the request and append it as part of the request.
Use cases:
  1. Access Request that created accounts would like to return the list of accounts created in a provisioned system.
  2. Information that opened ticket to a ticketing system. The ticketing system would like to update the information in the request.
To update the request use the following REST service information:
REST Call Name
updateRequestInfo
Description
Update an existing request with more information, the update can be performed to various elements in the request
URL
<Identity_Portal_url>/rest/request/updateRequestInfo
HTTP Method
POST
Request body content type
Application/json
Request body content Sample
{
[{
"backendRequestId": "144233-54657f4a3-abc4566-4552a",
"requestId": 41,
"requestTargetPermissionId": 33,
"requestPermissionId": 27,
"infoToAppend": "add this text to all of the above elements",
"protectedValue": false
},
{
"backendRequestId": "144233-54657add-f4a3-abc4566",
"requestId": 43,
"requestTargetPermissionId": 35,
"requestPermissionId": 27,
"infoToAppend": "add another text to all of the above elements",
"protectedValue": false
}]
}
Request body content
Sample explanation
(
Important: At least one of the first 4 parameter is necessary
)
 
 
 
 
 
backendRequestId
This is the backend task session id – if this parameter is send the information will be linked to the element linked to task session.
requestId
The request Id, when using this parameter the information will be linked to the top level of the request
requestTargetPermissionId
This is the target permission instance in the request, the id of it can be viewed in the basket. When using this parameter the information will be linked to all associated permissions.
requestPermissionId
This is the permission instance in the request, the id of it can be viewed in the basket. When using this parameter the information will be linked to permissions.
infoToAppend
The information to add to the request
protectedValue
Boolean for whether to encrypt that data in the DB.
Success return status
Http OK(200)
 
The API is only exposed to a service account which is configured in the General Configuration Tab. 
To perform login you will need to perform form authentication to CA Identity Portal. The following code is an example how to use java to perform login to CA Identity Portal using org.apache.commons.httpclient.HttpClient.
private void login
(
String username
,
 String password
)
 
throws
 HttpException
,
 IOException
,
 LoginException 
{
log
.
debug
(
"Logging into Sigma"
);
String loginUrl 
=
 
this
.
sigmaUrl 
+
 
this
.
loginSuffix
;
log
.
debug
(
"Login URL is: " 
+
 loginUrl
);
PostMethod postMethod 
=
 
new
 PostMethod
(
loginUrl
);
NameValuePair
[]
 postData 
=
 
new
 NameValuePair
[
2
];
postData
[
0
]
 
=
 
new
 NameValuePair
(
"j_username"
,
 username
);
postData
[
1
]
 
=
 
new
 NameValuePair
(
"j_password"
,
 password
);
postMethod
.
addParameters
(
postData
);
int loginResult 
=
 
this
.
httpclient
.
executeMethod
(
postMethod
);
log
.
debug
(
"Login post returned Http Status: [" 
+
 loginResult 
+
 "]"
);
if
 
(
loginResult 
!=
 302
)
 
{
log
.
error
(
"Error logging into Sigma with username: [" 
+
 username 
+
 "]"
);
throw
 
new
 LoginException
(
"Error Logging into Sigma: " 
+
 postMethod
.
getResponseBodyAsString
());
  }
Header locationHeader 
=
 postMethod
.
getResponseHeader
(
"Location"
);
if
 
(!
locationHeader
.
getValue
().
substring
(
locationHeader
.
getValue
().
lastIndexOf
(
"/"
)).
startsWith
(
"/app"
))
 
{
log
.
error
(
"Error logging into Sigma with username: [" 
+
 username 
+
 "]"
);
throw
 
new
 LoginException
(
"Error Logging into Sigma"
);
 }
postMethod
.
releaseConnection
();
log
.
debug
(
"Login successful"
);
}
After the HTTP client is logged in, you can use it to POST method to the APIs exposed.