Click HERE to see how Saviynt Intelligence is transforming the industry. |
12/05/2023 06:38 AM
Hi Team ,
I am facing Exception in converting responseText to Map while importing accounts from application. below is the account import json and able to call api successfully as per debug logs. Could you please check this.
Account Import JSON:
{
"accountParams": {
"connection": "userAuth",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://<hostname>/<appname>api/v1/admin/users",
"httpParams": "{}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"cleanUpTextContent": true,
"listField": "users",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "user_name~#~char",
"name": "user_name.key~#~char"
},
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
500,
401,
403
]
}
}
}
},
"entitlementParams": {},
"acctEntParams": {}
}
I have enable debug logs for this, I can see api call is successful and able to get the user data but unable to import it in the saviynt.
I am facing below error:
2023-12-05/14:13:18.550 [{}] [quartzScheduler_Worker-16] DEBUG rest.RestUtilService - pullObjectsByRest - responseStatusCode ::200
2023-12-05/14:13:18.551 [{}] [quartzScheduler_Worker-16] DEBUG rest.RestProvisioningService - Exception in converting responseText to Map
2023-12-05/14:13:18.551 [{}] [quartzScheduler_Worker-16] DEBUG rest.RestProvisioningService - Entered getResponseHeaders method
2023-12-05/14:13:18.552 [{}] [quartzScheduler_Worker-16] DEBUG rest.RestProvisioningService - responseError : null
2023-12-05/14:13:18.552 [{}] [quartzScheduler_Worker-16] DEBUG rest.RestProvisioningService - isAuthError: false
Solved! Go to Solution.
12/06/2023 12:35 AM - edited 12/06/2023 12:36 AM
Hello @IAM-Vaibhav,
Could you please share the postman snapshot and also the complete debug logs.
Thanks.
12/06/2023 01:04 AM
12/06/2023 10:51 PM
Hello @IAM-Vaibhav,
Seems above response is not in the valid json format,
This has to be rectified by the application teams to make the response of the application to make the valid json. if it not a valid json, the import wonts works, hence where you are getting the response mapping error.
Thanks.
12/11/2023 10:59 PM
Hi @sudeshjaiswal ,
I checked with application team and below is their response.
Archibus tech support came back with this response:
There would be no way to change this behavior, and I believe that changing it would be against the HTTP specification. The verbatim response of 'HTTP/1.1 200 OK' is the correct formatting for the HTTP header as specified by the IETF, and that any given request over HTTP will respond in the same way when looking at the raw response data.
Is there any way in Saviynt though which we can resolve this on Saviynt side.
12/11/2023 11:39 PM
Hello @IAM-Vaibhav,
Currently there is no way, if the response is not in correct json format, you wont be able to import the account from the application.
Thanks.
12/17/2023 10:35 PM
Hi @sudeshjaiswal ,
application team has change the response from "Code": 200 OK to "Code": 200. Previous error Exception in converting responseText to Map has gone now. Now I am getting : groovy.lang.MissingPropertyException: No such property: key for class: java.lang.String. I checked all the property and there names mapped in ColsToProp mapping.
Current JSON :
{
"accountParams": {
"connection": "userAuth",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://<URL>/api/v1/admin/users",
"httpParams": "{}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"cleanUpTextContent": true,
"listField": "users",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "user_name~#~char",
"name": "user_name.key~#~char"
},
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
500,
401,
403
]
}
}
}
},
"entitlementParams": {},
"acctEntParams": {}
}
12/17/2023 11:10 PM
@IAM-Vaibhav Is the postman reposne is in valid json format now?
Thanks.
12/17/2023 11:14 PM
Hi @sudeshjaiswal ,
Yes.
12/17/2023 11:22 PM
Hello @IAM-Vaibhav,
Can you please try with the below json,
{
"accountParams": {
"connection": "userAuth",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://<URL>/api/v1/admin/users",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"cleanUpTextContent": true,
"listField": "users",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "user_name~#~char",
"name": "user_name~dot#key~#~char"
}
}
}
},
"entitlementParams": {},
"acctEntParams": {}
}
Thanks.