Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Need Sample to Include colsToPropsMap in Remove Account Json

Souvik
New Contributor III
New Contributor III

We have a requirement to fetch the ID of the orchestrator account and pass it to the second API, the Delete/Remove Account API.

However, we are not getting a sample of how we can include the ID in the call1 and pass it to the call2 URL to delete the account.

Note: We cannot store the value in the Accounts or User tables.

Connection JSON we are using:

1. The first authentication method is used to add or remove access from an Azure group.

2. The second authentication method is used to remove an account.

{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://login.microsoftonline.com/tenant id/oauth2/token",
"httpMethod": "POST",
"httpParams": {
"grant_type": "client_credentials",
"client_secret": "ABC",
"client_id": "XYZ",
"resource": "https://graph.microsoft.com/"
},
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"properties": {},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"retryFailureStatusCode": [403, 401, 500],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer eyJ0eXAiOiJKV1QiLCJub25jZSZO7I5Bfqi9-0LGoeFRVPlpB3r4T7hI82KoPiaznhYm65vdKIJW8x8rnmkt9YSEFN01UCTwlDJCtig",
"apiRateLimitConfig": {
"retryAfterCalls": 100,
"retryWaitSeconds": 60
}
},
"userAuth1": {
"authType": "oauth2",
"url": "https://ABC/identity_/connect/token",
"httpMethod": "POST",
"httpParams": {
"grant_type": "client_credentials",
"client_secret": "ABCD",
"client_id": "EFGH",
"scope": "OR.Users OR.Users. Read OR.Users.Write"
},
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"properties": {},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"retryFailureStatusCode": [403, 401, 500],
"timeOutError": "Read timed out",
"errorPath": "odata~dot#error.code",
"maxRefreshTryCount": 3,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer RTAxNjEDK8GggKeIBOBLjyvPhqM846WZ8U9Rodmn2O5YCRQb8A0kq__BOR2AXe48sm1TSJOapPXAcWH6-tiP0Qg",
"retryAfterCalls": 100,
"retryWaitSeconds": 60
}
}
}

Remove Account Json:

{
"call": [{
"name": "call1",
"connection": "userAuth1",
"url": "https://ABC/Development/Users?%24filter=UserName%20eq%20%27${user.secondaryEmail}%27",
"httpMethod": "GET",
"listField": "value",
"keyField": "name",
"colsToPropsMap": {
"name": "UserName~#~char",
"customproperty7": "Id~#~char"
},
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201, 204]
}
}, {
"name": "call2",
"connection": "userAuth1",
"url": "https://XYZ/orchestrator_/Users(${account.customproperty7})",
"httpMethod": "DELETE",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201, 204]
}
}]
}

 

 

However, we are getting the below error when we are removing the account:

"message":"Invalid OData query options.","errorCode":999,"traceId":"00-3d92e3c1573edb4f9dd3218feaca9ec9-71a0d0c81eca0a58-00","statusCode":400,"description":null,"status":"Failed"

Please let us know how we can achieve this.

6 REPLIES 6

khalidakhter
Saviynt Employee
Saviynt Employee

Hi @Souvik 

You can use the below format for referring any infomation from the previous API call while provisioning.
${response.call1.message.Id}

In the above sample, response is a binding variable to store the API call responses, call1 is the name of API call, message contains the response body of that API call, and Id is the attribute name from the response body map.

Please try the above and see if it works.

Souvik
New Contributor III
New Contributor III

Hi @khalidakhter,

I tried to use the below Remove Account json:

{
"call": [{
"name": "call1",
"connection": "userAuth1",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
 
}
},
{
"name": "call2",
"connection": "userAuth1",
"httpMethod": "DELETE",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
 
}
}
]
}
 
However, In the Provisioning Comment we are getting the below error:
"message":{"message":"Invalid OData query options.","errorCode":999,"traceId":"00-06db574fbd0e7246826696bbef61d3ef-2641ac0a18b6adca-00"},"statusCode":400,"description":null,"status":"Failed"}]}
 
Can you please let me know If I am doing something wrong?

khalidakhter
Saviynt Employee
Saviynt Employee

Hi @Souvik 

Please share the response of the call1 API to get the correct path to ID.

Souvik
New Contributor III
New Contributor III

Hi @khalidakhter 

In postman we are getting the below response. 

 

In the below Sample we are trying to get the ID details and need to pass call2.

 

{
"@odata.context": "https://ABC/orchestrator_/odata/$metadata#Users",
"@odata.count": 1,
"value": [
{
"Name": "Kumar",
"Surname": "Vadlamudi",
"UserName": "ABC@xyz.com",
"Domain": null,
"DirectoryIdentifier": null,
"FullName": "Kumar Vadlamudi",
"EmailAddress": "Apple@xyz.com",
"IsEmailConfirmed": false,
"LastLoginTime": "2023-06-07T14:23:36.293Z",
"IsActive": true,
"CreationTime": "2023-06-07T14:23:35.57Z",
"AuthenticationSource": "aad",
"Password": null,
"IsExternalLicensed": false,
"RolesList": [
"ZBR RPA Developer Role - Tenant"
],
"LoginProviders": [],
"TenantId": 28562,
"TenancyName": null,
"TenantDisplayName": null,
"TenantKey": null,
"Type": "DirectoryUser",
"ProvisionType": "Manual",
"LicenseType": null,
"Key": "XXXXX",
"MayHaveUserSession": true,
"MayHaveRobotSession": false,
"MayHaveUnattendedSession": false,
"BypassBasicAuthRestriction": false,
"MayHavePersonalWorkspace": false,
"RestrictToPersonalWorkspace": false,
"AccountId": null,
"LastModificationTime": "2023-06-07T14:23:36.403Z",
"LastModifierUserId": 287478,
"CreatorUserId": 287478,
"Id": 287898,
"RobotProvision": null,
"UnattendedRobot": null,
"NotificationSubscription": {
"Queues": true,
"Robots": true,
"Jobs": true,
"Schedules": true,
"Tasks": true,
"QueueItems": true,
"Insights": false,
"CloudRobots": true,
"Serverless": false,
"Export": true
},
"UpdatePolicy": null
}
]
}

khalidakhter
Saviynt Employee
Saviynt Employee

Hi @Souvik 

Thanks for providing the API response. Please use the below binding format to get the id from the previous API call response.
${response.call1.message.value[0].id}

Souvik
New Contributor III
New Contributor III

Hi @khalidakhter 

Thanks for your help it is working now