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

REST Application URL failing (ImportAcctEntitlementJSON) but works perfectly via Postman

tarung702
New Contributor III
New Contributor III

I think I've got one that I definitely can't figure out myself. 

Error Screenshot from Import Job (URL is out, but below I removed string values that were sensitive and added "blah" and left anything else the same, but I can guarantee its not formatted incorrectly, and it works perfectly from Postman).

At this point, just trying to import accounts, not entitlements. That will come next once this is successful. 

tarung702_0-1684882015810.png

This is the ImportAccountEntJSON:

{
"accountParams": {
"connection": "acctauth",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"http": {
"url": "https://api-ti.blah.com/v1/ti/blah/blah/blah?blah=blah",
"httpHeaders": {
"Authorization": "${jetonAcces}",
"Accept": "application/json",
"Ocp-Apim-Subscription-Key": "b0405766eea24466b27ee1aa664672b5",
"Connection": "keep-alive"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "nomUtilisateur~#~char",
"name": "nomUtilisateur~#~char",
"customproperty10": "prenom~#~char",
"customproperty11": "nom~#~char",
"customproperty12": "actif~#~char"
}
}
}
}
}

Thought it could potentially be a timeout issue (this call takes about 20-22 seconds on average in Postman to execute as its a large dataset) albeit the logs and the job messaging don't indicate any such issue.

Included this in my ConfigJSON, which I think more than covers the potential timeout issue in retrieving a result:

{
"statusAndThresholdConfig": {
"accounts": {
"accountThresholdValue": 1000,
"inactivateAccountsNotInFile": false,
"statusColumn": "customproperty30",
"activeStatus": ["True"]
}
},
"connectionTimeoutConfig": {
"connectionTimeout": 200,
"readTimeout": 200,
"writeTimeout": 200,
"retryWait": 100,
"retryCount": 3
}
}

Any ideas folks? Help is much appreciated. 

8 REPLIES 8

SB
Saviynt Employee
Saviynt Employee

Can you update ConfigJSON param in the REST connection with value {"showLogs":true} and look for the below 2 keywords in the logs. This will help indicate what the issue could be.

Calling Webservice Url

Got Webservice API Response


Regards,
Sahil

tarung702
New Contributor III
New Contributor III

Ok so I did that. Attached are the logs. I replaced the entire ConfigJSON I had with {"showLogs":true} and pulled as requested. 

So unless I'm reading it wrong, it looks like it says its making an Authentication call against the webservice, and its getting a 401 unauthorized (line 37 and 36 in the (1).csv, and in line 20 and 19 in the .csv ). Here's why that gives me a lot of pause:

Now keep in mind, the connection test is successful included and excluded, and I'm confident the handshake works and returns the token because utilizing that same connection I am running create account and it works without issue, passes the accesstoken as expected with the same variable binding. That JSON for that is below:

CreateAccountJSON (this works using the same connection that is according to the logs failing to retrieve an access token when trying to execute before running the importaccount)

{
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {
"customproperty5": "call1.message.id~#~char"
},
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "",
"httpMethod": "POST",
"httpHeaders": {
"Accept": "application/json",
"Ocp-Apim-Subscription-Key": "",
"Authorization": "Bearer ${jetonAcces}"
},
"httpParams": "{\"NomUtilisateur\" : \"${user.email}\",\"Email\" : \"${user.email}\",\"Prenom\" : \"${user.firstname}\", \"Nom\" : \"${user.lastname}\",\"Actif\" : true,\"ApplicationCible\" : \"ClientC2\",\"Proprietes\": {\"EntrepriseID\":\"\",\"GroupeID\":\"non utilise\",\"CatalogueID\":\"non utilise\",\"BureauPhysique\":\"non utilise\",\"IDExterne\":\"non utilise\",\"Ressource\":false,\"AccesPortail\":true,\"Role\":\"non utilise\",\"Titre\":\"Analyste fonctionnel\",\"Gestionnaire\":\"165dde48-54e5-497c-8a7f-0dc3e928bebe\",\"Departement\":\"VPTN - Epargnant\"}}",
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
}]
}

I checked with the app owner. He sees failures where the provided access token was ${jetonAcces} instead of the actual token value. 

This leverages the EXACT same connection that is in the case of import account for some reason throwing a 401.

Am I reading the logs wrong? the 401 seems to be after the userAuth runs against the authentication url to grab the token. 

 

Very confused as to why it works to grab an Access Token and Create the account, but when importing it doesn't even grab an Access Token, and thereby consequent processes fail. 

Also, here's the connectionJSON too if it helps:

{
    "authentications": {
        "userAuth": {
            "authType": "oauth2",
            "httpMethod": "POST",
            "httpParams": "{\"nomUtilisateur\": \"notsharing\",\"motDePasse\": \"notsharing\",\"identifiantApplication\": \"notsharing\",\"ressource\": \"https://dev.saviyntcloud.com\"}",
            "httpContentType": "application/json",
            "httpHeaders": {
                "Content-Type": "application/json",
                "Ocp-Apim-Subscription-Key": "b0405766eea24466b27ee1aa664672b5"
            },
            "authError": [
                "USER_AUTHENTICATION_FAILED",
                "PARTNER_AUTHENTICATION_FAILED",
                "AuthenticationFailed"
            ],
            "errorPath": "errorCode",
            "maxRefreshTryCount": 5,
            "tokenResponsePath": "jetonAcces",
            "tokenType": "Bearer",
            "authHeaderName": "Authorization",
            "accessToken": "${jetonAcces}",
            "retryFailureStatusCode": [
                401
            ]
        }
    }
}
 
[This post has been edited by a Moderator to remove sensitive information.]

"Authorization": "${access_token}"

change in create account json


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Can you re-evaluate the above based on the original issue with Import and lmk if you have any thoughts?

tarung702
New Contributor III
New Contributor III

Maybe you misread, but the createaccountJSON works as is, it does not require modification. 

My issue is with import. 

SB
Saviynt Employee
Saviynt Employee

Can you confirm if this is still an issue or were you able to resolve it.


Regards,
Sahil

davindersingh
Saviynt Employee
Saviynt Employee

It seems to have resolved after adding timeouts in configjson
{
    "connectionTimeoutConfig": {
        "connectionTimeout": 10,
        "readTimeout": 60,
        "writeTimeout": 60,
        "retryWait": 2,
        "retryCount": 3
    },
    "showLogs": true
}

iam01
Regular Contributor
Regular Contributor

@davindersingh  Could you please share rest documentation where i can find more about "configJSON". 
I tried searching for it but couldnot find it