05/11/2023 05:00 AM
I have the following api config for import account json using a rest api connection.
{
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"successResponses": {
"statusCode": [
200,
201,
202,
203,
204,
205
]
},
"url": "https://api-test.duosecurity.com/admin/v1/users",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"userResponsePath": "response",
"colsToPropsMap": {
"accountID": "user_id~#~char",
"name": "username~#~char",
"displayName": "realname~#~char",
"customproperty4": "email~#~char",
"customproperty5": "username~#~char",
"comments": "username~#~char",
"customproperty7": "notes~#~char",
"customproperty9": "realname~#~char",
"customproperty14": "status~#~char"
},
"entitlementParams": {
},
"acctEntParams": {
}
}
I am getting the following error:
Error Failed to import data | Cannot get property 'processingType' on null object |
05/12/2023 03:04 PM
Can you try with the below once and see if it works
{
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"successResponses": {
"statusCode": [
200,
201,
202,
203,
204,
205
]
},
"url": "https://api-test.duosecurity.com/admin/v1/users",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"userResponsePath": "response",
"colsToPropsMap": {
"accountID": "user_id~#~char",
"name": "username~#~char",
"displayName": "realname~#~char",
"customproperty4": "email~#~char",
"customproperty5": "username~#~char",
"comments": "username~#~char",
"customproperty7": "notes~#~char",
"customproperty9": "realname~#~char",
"customproperty14": "status~#~char"
},
"entitlementParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"entTypes": {
"Roles": {
"entTypeOrder": 0
}
}
}
}
06/12/2023 11:12 AM
Sahil,
I tried with the above JSON , but no luck in 5.5v. can you able to tell whats going wrong.
06/12/2023 11:18 AM
What is the error you see in logs.
You can also update ConfigJSON param in the REST connection with value {"showLogs":true} to display additional logs.
06/13/2023 05:53 AM
no logs are displayed though... its not working
06/09/2023 09:53 AM
is this working in 5.5v?
06/12/2023 11:00 AM
@jralexander137 Was this issue resolved with the JSON shared.
06/14/2023 10:44 AM
@Vajra You should see a thread with the keyword (DEBUG rest.RestProvisioningService) when you run the job. Can you check for this and then follow the thread to find the error.
06/14/2023 07:56 PM
RestProvisioningService - Got Webservice API Response: [headers:[Server: Duo/1.0, Date: Tue, 13 Jun 2023 17:02:02 GMT, Content-Type: application/json, Content-Length: 73, Connection: keep-alive], responseText:{"code": 40101, "message": "Missing request credentials", "stat": "FAIL"}, cookies:[], statusCode:401]
06/15/2023 09:04 AM
@Vajra This is a 401 error and it looks like an issue with your connection JSON. Can you check the same and fix it. Below is the link to the REST Guide you can refer to for examples of JSON Construction and Developers Handbook if needed.
https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm
06/20/2023 11:51 AM
Yes based on this the connection is setup. Just posting the Connection details
{
"authentications": {
"acctAuth": {
"authType": "BasicWithHmac",
"url": "https://api-0dcd3a05.duosecurity.com",
"httpMethod": "POST",
"properties": {
"IKEY": "<<ikey value>>",
"SKEY": "<<skey value>>"
},
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic REkyTU82MFpNOEpLVzJLQUdHM0I6bXVZdkllYjFmblk2Q2ZVMDF6TzI5ZXBzSmtEYWdzNmwyUExsRTBqWA=="
}
}
}
access token was picked up from header from the postman based on basic auth with ikey -username and skey as password.
06/21/2023 01:10 PM
Any update , in 5.5v REST connection is always successful...however import doesnt work and throws the above error
06/22/2023 10:58 AM
Connection JSON does not really validate the credentials to check if the calls is successful or not unless it is Oauth2 type. And even for Oauth, you need to define the additional parameters in Connection JSON. Refer below for the same
https://docs.saviyntcloud.com/bundle/REST-v55x/page/Content/Developers-Handbook.htm
From the error it does appear to be an issue with Connection JSON. To rule out the issue with the Import JSON, can you generate the Access token from Postman and add the same in your JSON. You can also refer to the above link to find examples of you the Connection JSON to match the format.