Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Getting 501 error while provisioning using REST connection

ShantanuKumar
New Contributor III
New Contributor III
Hello Team,
 
I am trying to provisioning using REST Connection but getting 501 error for call2 of the Task:
"call2":{"headers":null,"message":"","statusCode":501,"description":null,"status":"Failed"}} 
 
Adding the CreateAccountJSON
{
  "accountIdPath": "accountName",
  "responseColsToPropsMap": {
 
  },
  "call": [
    {
      "name": "call1",
      "connection": "acctAuth",
      "url": "##URL##",
      "httpMethod": "POST",
      "httpParams": "{\"id\":\"${user.username}\",\"firstName\":\"${user.firstname}\",\"lastName\":\"${user.lastname}\",\"email\":\"${user.email}\",\"country\":\"${user.country}\"}",
      "httpHeaders": {
        "Authorization": "${access_token}",
        "Content-type": "application/json"
      },
      "httpContentType": "application/json",
        "successResponses": {
            "statusCode": [
                200
            ]
        },
        "unsuccessResponses": {
            "statusCode": [
                400,
                500
            ]
        }
    },
    {
      "name": "call2",
      "connection": "dlAuth",
      "url": "##URL##",
      "httpMethod": "PATCH",
      "httpParams": "{\"op\":\"add\",\"path\":\"/members/-\",\"value\":\"${user.username}\"}",
      "httpHeaders": {
        "Authorization": "${access_token}",
        "Accept": "application/json"
      },
      "httpContentType": "application/json",
        "successResponses": {
            "statusCode": [
                200
            ]
        },
        "unsuccessResponses": {
            "statusCode": [
                400,
                500
            ]
        }
    }
  ]
}
 
Below is the Postman Screenshot which getting 200 response:
ShantanuKumar_0-1726561930121.png

 

Thanks,
Karan Chheda

[This message has been edited by moderator to disable URL hyperlink]
26 REPLIES 26

NM
Honored Contributor II
Honored Contributor II

Hi @ShantanuKumar if you try to run wsretry job again does it work?

ShantanuKumar
New Contributor III
New Contributor III

Already tried getting the same error

I see there is extra hypen in call 2

"httpParams": "{\"op\":\"add\",\"path\":\"/members/-\",\"value\":\"${user.username}\"}",

use 

"httpParams": "{\"op\":\"add\",\"path\":\"/members/\",\"value\":\"${user.username}\"}",


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

That hyphen is required you can see in POSTMAN Body too

NM
Honored Contributor II
Honored Contributor II

@ShantanuKumar what I believe as it is a patch request it will be updating a existing data.

Are there 2 different application endpoint been utilised .. because there could be changed of delay in replicationon target end where you are planning to make a patch request.

ShantanuKumar
New Contributor III
New Contributor III

If there was any delay in replication on target so it should also not work in Postman but it is working fine in Postman but only getting the issue with Saviynt.

NM
Honored Contributor II
Honored Contributor II

@ShantanuKumar are you performing the patch request instantly? Or after a delay of 30 sec or a min ? Through postaman?

ShantanuKumar
New Contributor III
New Contributor III

I am performing the Patch Request Instantly through postman.

Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]



⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hello Rushikesh,

Below is the curl command from POSTMAN:

curl --location --request PATCH '####URL####?access_token=############################' \
--header 'Content-Type: application/json' \
--header 'Cookie: PF=############################; JSESSIONID=############################' \
--data '[
{
"op": "add",
"path": "/members/-",
"value": "12345678"
}
]'

NM
Honored Contributor II
Honored Contributor II

@ShantanuKumar if you run the job again after a min or 2 still it fails ??

ShantanuKumar
New Contributor III
New Contributor III

Yes it does fails

  • Does any other operations are working ?

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Yes all other operations are working

  • Share disable account json

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

As the CreateAccountJSON itself is not working so not able to create any accounts so haven't tried disable account, also is there something known as PATCHWITHBODY and does Saviynt supports it if yes then let me know

Just now you confirmed all operation works now create not. Please confirm what all JSONs are working ?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Other all operations are working in Postman i was referring that and as CreateAccountJSON is not working correctly so I am not able to Test other operations like RemoveAccountJSON. Also I am adding ConnectionJSON below:

ConnectionJSON:
{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "https://URL",
"properties": {
"userName": "###########",
"password": "###########"
},
"httpMethod": "POST",
"httpHeaders": {"Content-Type": "application/json"},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Bearer abcd"
},

"dlAuth": {
"authType": "oauth2",
"url": "https://URL.oauth2",
"httpMethod": "POST",
"httpParams": {
"refresh_token": "${refresh_token}",
"grant_type": "client_credentials",
"client_id": "###########",
"client_secret": "###########",
"scope": "api"
},
"httpHeaders": {
"Accept": "application/json"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "invalid_request",
"authError": [
"invalid_request"
],
"refreshType": "RefreshToken",
"refreshTokenResponsePath": "refresh_token",
"refreshToken": "###########",
"timeOutError": "Read timed out",
"errorPath": "error",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"retryFailureStatusCode": [
401
],
"accessToken": "Bearer ###########"
}
}
}

  • You need to fix. Connection json first
  • share postman details for authentication 
  • Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]



    ⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hello Rushikesh,

Below are the POSTMAN Authentication screenshot:

ShantanuKumar_0-1726664428706.png ShantanuKumar_1-1726664565499.png

And below is the Postman CURL Command:
curl --location --request PATCH '####URL####?access_token=############################' \
--header 'Content-Type: application/json' \
--header 'Cookie: PF=############################; JSESSIONID=############################' \
--data '[
{
"op": "add",
"path": "/members/-",
"value": "12345678"
}
]'

How does authentication works with Azure/AD Auth ?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Currently we don't have Azure/AD Auth yet

Try authentication similar like below post https://forums.saviynt.com/t5/identity-governance/outreach-authorization-is-not-working-for-rest-con...


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hey Rushikesh,

I checked the suggested post but I see there are multiple JSON which are attached and those are not resolved and they are still facing the issue, could you please provide the Connection JSON what are you mentioning.

Thanks,
Karan Chheda

  • Question is does new token authentication  needs from Ad ?

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

@ShantanuKumar PATCHWITHBODY isn't a HTTP method in saviynt