We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

Rest Account creation - Getting 500 status code

mkivade
New Contributor II
New Contributor II

Beow is our CreateAccountJson

 

{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "https://dashboard.keepnetlabs.com/api/TargetGroups/UserInsertOrUpdate",
"httpMethod": "POST",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json",
"Content-Type": "application/json"
},
"httpParams": "{\"CompanyId\":\"93ac7f3d-b646-4c56-9d5a-7256abb9db62\",\"GroupId\":\"d48c1697-e3f5-4604-9e1c-385bbd25e576\",\"Email\":\"martha7371@test.com\",\"FirstName\":\"Jasmin71\",\"LastName\":\"Walker71\",\"Department\":\"123\",\"Field2\":\"GR-Call Receiving\",\"Field3\":\"EMP\",\"Field4\":\"AutoClubGroup\",\"Field5\":\"P58305N\",\"UserId\":\"p737168\",\"City\":\"ABC\",\"DOMAINCONTROL\":\"0\",\"STATUS\":\"null\",\"PHONE\":\"9665784820\",\"SURNAME\":\"wer\"}",
"successResponses": {
"message": [
"Process completed successfully"
]
}

}]
}

[This post has been edited by a Moderator to remove sensitive information.]

17 REPLIES 17

sk
All-Star
All-Star

Were you able to run the same call in POSTMAN and get the expected result? If so can you please share the screenshot?

 


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

Sivagami
Valued Contributor
Valued Contributor

500 Status code means the target API is not able to handle the request & caused Internal Server Error. As @sk suggested, try the payload in postman & verify.

-Siva

mkivade
New Contributor II
New Contributor II

@sk @Sivagami 

I have attached postman payload ,please check and help us?

SB
Saviynt Employee
Saviynt Employee

Based on the screenshot and the JSON shared, I can see that there is a difference in the attributes and values that you are passing from Saviynt.

- Example STATUS is uppercase in your json where as its in lower case in your postman screenshot.

- The value for Status you are passing is NUll where as in postman it shows a value 1 to be passed.

SURNAME appears to be an addiotnal attribute in your JSON etc.

You need to ensure the attributes that you are sending from Saviynt should match with the ones you are using in postman to make a successful call. Also the values for all the attributes should be the accepted values in your target.


Regards,
Sahil

mkivade
New Contributor II
New Contributor II

Thanks all for your quick response.

@SB I have tried to add request as per the postman still getting 500 error.

Below are the provisioning comments,

{"call1":{"headers":{"Server":"cloudflare","CF-RAY":"79e65c8b3eae82b6-IAD","X-Content-Type-Options":"nosniff","Connection":"keep-alive","Pragma":"no-cache","Date":"Fri, 24 Feb 2023 07:06:57 GMT","Access-Control-Allow-Headers":"Origin, X-Requested-With, Content-Type, Accept","X-UA-Compatible":"IE=edge","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","CF-Cache-Status":"DYNAMIC","Cache-Control":"no-cache","NEL":"{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}","Report-To":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=7ByWyanjGi7ZLJYUzn%2FVbr2cqC1jFad6xujBn2NWyvHkiPwztUNduMEnMAHXELawPI6bbwjN%2FP4e2OBse%2FaontgvuE1f5pEMVzyDiNo41scuwyR%2B7Dy%2Blhc%2BWp4jwqZir1uk9vFg8i%2BTSCI%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}","X-AspNet-Version":"4.0.30319","Set-Cookie":"ASP.NET_SessionId=eugy14wkbu4faz1p5dww0h15; path=/; HttpOnly; SameSite=Lax","Expires":"-1","Content-Length":"36","X-XSS-Protection":"1;made=block","Content-Type":"application/json; charset=utf-8"},"message":{"Message":"An error has occurred."},"statusCode":500,"description":null,"status":"Failed"}}

Regards,

Minakshi

mkivade
New Contributor II
New Contributor II

Hi All,

To get the access token we are using below json,

 

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://dashboard.keepnetlabs.com/api/Authentication/GetAccessToken",
"httpMethod": "GET",
"httpHeaders": {
"Content-Type": "application/json",
"ApiKey": "10B3ABAA47A0FA193A9ED58DA61998B864913B3DAA0E70CEC8234",
"OAuthId": "48CD1FC0A73D3E361F25DED7374CB6B0F5FBEFEBEA9BBE6BD635",
"Email": "abc@acg.aaa.com",
"UserAccessToken": "CBCD4C8FB9850ADF5DBCE5490F8DF35D395F750D6438BF2E42234"
},
"httpContentType": "application/json",
"authError": [
"InvalidAuthenticationToken"
],
"errorPath": "error.code",
"maxRefreshTryCount": 2,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"authHeaderName": "Authorization",
"retryFailureStatusCode": [
401
]
}
}
}

but getting below error,

{"auditDetails":{"call1":[{"headers":null,"message":"","statusCode":null,"description":null,"status":"Failed"}]}

 

Thanks, 

Minakshi Kivade

 

SB
Saviynt Employee
Saviynt Employee

In your connection can you update Config json param value to {"showLogs":true} if not already done and then the provisioning job.

In the logs, search for below string and it should show you the data that is being passed from Saviynt. Based on that we need to check if the value for any attribute is different than expected.

Calling Webservice Url


Regards,
Sahil

mkivade
New Contributor II
New Contributor II

Hi @SB 

Thanks for the help.

I have tried above solutions but getting 401 error,

Our REST API token will expire in next 30 minutes, static access token is working fine but for dynamic access token getting 401 error.

Below is connectionJson,

{
"authentications": {
"acctAuth": {
"authType":"oauth2",
"url":"https://dashboard.keepnetlabs.com/api/Authentication/GetAccessToken",
"httpMethod":"GET",
"httpParams": {},
"httpHeaders": {
"Content-Type":"application/json",
"ApiKey":"10B3ABAA47A0FA193A9ED58DA61998B864913B3DAA0E70CEC8fdd",
"OAuthId":"48CD1FC0A73D3E361F25DED7374CB6B0F5FBEFEBEA9BBE6BD6dd",
"Email":"test@test.com",
"UserAccessToken":"CBCD4C8FB9850ADF5DBCE5490F8DF35D395F750D6438BF2E42976"
},
"httpContentType":"application/json",
"expiryError":"ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError":"Read timed out",
"errorPath":"error.code",
"maxRefreshTryCount":5,
"tokenResponsePath":"access_token",
"tokenType":"Bearer",
"accessToken":"Bearer E1C8E02A6277A5A84556A66DA48D1197245C852A1E70E52EEE"
}
}
}

Thanks,

SB
Saviynt Employee
Saviynt Employee

Do we have another call for refresh token or do you regenerate the token using the same call again?

 


Regards,
Sahil

mkivade
New Contributor II
New Contributor II

Hi @SB 

No, we have same only one call for refreshing it.

same is working in postman.

 

mkivade_0-1678718642496.png

 

SB
Saviynt Employee
Saviynt Employee

Since this requires to regenerate another token after expiry, you will need to add the refresh token section in the json. You can refer to the example given in the REST Connector guide (link below) and search for - Renew Access Token and Refresh Token using Single API

https://docs.saviyntcloud.com/bundle/REST-v2020x/page/Content/Developers-Handbook.htm


Regards,
Sahil

mkivade
New Contributor II
New Contributor II

Hi @SB Thanks for quick reply.

I have tried below payload for refresh token,

 

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://dashboard.keepnetlabs.com/api/Authentication/GetAccessToken",
"httpMethod": "GET",
"httpParams": {
},
"httpHeaders": {
"Content-Type":"application/json",
"ApiKey":"10B3ABAA47A0FA193A9ED58DA61998B864913B3DAA0E70CEC8123",
"OAuthId":"48CD1FC0A73D3E361F25DED7374CB6B0F5FBEFEBEA9BBE6BD64562",
"Email":"test@test.com",
"UserAccessToken":"CBCD4C8FB9850ADF5DBCE5490F8DF35D395F750D6438BF2E42123"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed"
],
"refreshType": "RefreshToken",
"refreshTokenResponsePath": "refresh_token",
"refreshToken": "<>",
"timeOutError": "Read timed out",
"errorPath": "errorCode",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"retryFailureStatusCode": [
401
],
"accessToken": "Bearer E1C8E02A6277A5A84556A66DA48D1197245C852A1E70E52EEE"
}
}
}

still same 401 error for create user,

 

DEBUG rest.RestUtilService - Calling https://dashboard.keepnetlabs.com/api/Authentication/GetAccessToken\n","stream":"stdout","time":"2023-03-14T05:35:04.612236136Z"}"
"ecm-worker","2023-03-14T05:35:05.213+00:00","{"log":"2023-03-14 05:35:04,612 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - isFipsEnabled = false\n","stream":"stdout","time":"2023-03-14T05:35:04.612263605Z"}"
"ecm-worker","2023-03-14T05:35:05.213+00:00","{"log":"2023-03-14 05:35:04,612 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - sslParams : null\n","stream":"stdout","time":"2023-03-14T05:35:04.612282665Z"}"
"ecm-worker","2023-03-14T05:35:05.213+00:00","{"log":"2023-03-14 05:35:04,612 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - proxyParams : null\n","stream":"stdout","time":"2023-03-14T05:35:04.612293906Z"}"
"ecm-worker","2023-03-14T05:35:05.213+00:00","{"log":"2023-03-14 05:35:04,612 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - sslSocketFactory : null\n","stream":"stdout","time":"2023-03-14T05:35:04.612297049Z"}"
"ecm-worker","2023-03-14T05:35:05.213+00:00","{"log":"2023-03-14 05:35:04,612 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - setting connection timeout to 10 seconds and request timeout to 60 seconds\n","stream":"stdout","time":"2023-03-14T05:35:04.612450625Z"}"
"ecm-worker","2023-03-14T05:35:05.213+00:00","{"log":"2023-03-14 05:35:04,612 [quartzScheduler_Worker-3] DEBUG services.HttpClientUtilityService - getHttpClient - HttpClientBuilder.create().build() called.\n","stream":"stdout","time":"2023-03-14T05:35:04.612865103Z"}"
"ecm-worker","2023-03-14T05:35:05.213+00:00","{"log":"2023-03-14 05:35:04,763 [quartzScheduler_Worker-3] DEBUG rest.RestUtilService - fetching result from response.responseText\n","stream":"stdout","time":"2023-03-14T05:35:04.763393738Z"}"
"ecm-worker","2023-03-14T05:35:05.213+00:00","{"log":"2023-03-14 05:35:04,763 [quartzScheduler_Worker-3] DEBUG rest.RestUtilService - responseToken is null or empty\n","stream":"stdout","time":"2023-03-14T05:35:04.76343388Z"}"
"ecm-worker","2023-03-14T05:35:05.213+00:00","{"log":"2023-03-14 05:35:04,763 [quartzScheduler_Worker-3] DEBUG rest.RestUtilService - connectionid:: null\n","stream":"stdout","time":"2023-03-14T05:35:04.763622345Z"}"
"ecm-worker","2023-03-14T05:35:05.213+00:00","{"log":"2023-03-14 05:35:04,767 [quartzScheduler_Worker-3] DEBUG rest.RestProvisioningService - access token populated for oauth authentication..\n","stream":"stdout","time":"2023-03-14T05:35:04.767327271Z"}"

Can you please help me.

Regards,

Minakshi

 

SB
Saviynt Employee
Saviynt Employee

Based on the postman screenshot you shared, I can see that the access token path should be accessToken where as you have defined it as access_token. Can you please update the same and try.

Also, it does look like this app does not use a Refresh token. So try with the below.

Do update the field values for these before using the JSON based on your application response 

url
errorPath
authError
expiryError

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://<domain name>/api/v18.2/auth",
"httpMethod": "GET",
"httpParams": {
},
"httpHeaders": {
"Content-Type":"application/json",
"ApiKey":"10B3ABAA47A0FA193A9ED58DA61998B864913B3DAA0E70CEC8123",
"OAuthId":"48CD1FC0A73D3E361F25DED7374CB6B0F5FBEFEBEA9BBE6BD64562",
"Email":"test@test.com",
"UserAccessToken":"CBCD4C8FB9850ADF5DBCE5490F8DF35D395F750D6438BF2E42123"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"FAILURE",
"INVALID_SESSION_ID"
],
"timeOutError": "Read timed out",
"errorPath": "",
"maxRefreshTryCount": 5,
"tokenResponsePath": "accessToken",
"tokenType": "",
"accessToken": "abcd"
}
}
}


Regards,
Sahil

npise
New Contributor III
New Contributor III

Has this been resolved? i am having similar challenge for removeAccess; Note: createaccount;updateaccount; enableaccount; disable account; add access is working fine except for removeAccess

mkivade
New Contributor II
New Contributor II

@npise 

We have tried for createAccount only and its working for static access token but not for dynamic one.

Can you please share connection Json if its working for dynamic access token?

Thanks

npise
New Contributor III
New Contributor III

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "XXXXXXX",
"httpMethod": "POST",
"httpParams": {
"client_id": "xxxxxxx",
"grant_type": "client_credentials",
"client_secret": "XXXXXXX",
"scope": "XXXX"
},
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"FAILURE",
"INVALID_SESSION_ID"
],
"retryFailureStatusCode": [
401,
403
],
"timeOutError": "Read timed out",
"errorPath": "",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer abcd"
}
}
}

SB
Saviynt Employee
Saviynt Employee

@mkivade Can you confirm if this is still an issue or if the issue was resolved with the Connection JSON shared in prev comment.


Regards,
Sahil