How to Validate JSON

navneetv
Regular Contributor
Regular Contributor

Hi Saviynt Team,

is there any way to test the connection JSON? Can we test via the Postman or any other way? If so, could you please suggest how to test the connection JSON?

like below connection JSON

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "<endpointUrl>/api/v1/scim/Users",
"httpMethod": "GET",
"httpParams": {},
"httpHeaders": {
"contentType": "application/json"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer abcde"
}
}
}
2 REPLIES 2

sahil
Saviynt Employee
Saviynt Employee

The connector supports validating Connection for authType as oauth2. To do this, populate the http parameters in the testConnectionParams attribute. It validates the connection parameters and prompts Successful or Failed status based on the provided credentials while saving the connection.

You can refer to the below guide for a sample format of same. SECTION -  sample Connection JSON with the testConnectionParams block:

https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Examples-for-JSON-Construction.htm

 


Regards,
Sahil

rushikeshvartak
All-Star
All-Star

In order to validate json / connectivity during save connection use test connection param field in connection json

 

{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "https://<domain name>",
"httpMethod": "POST",
"httpParams": {},
"httpHeaders": {},
"httpContentType": "text/html",
"properties": {
"userName": "username",
"password": "password"
},
"expiryError": "Couldn't authenticate you",
"authError": [
"Couldn't authenticate you"
],
"timeOutError": "Read timed out",
"errorPath": "error",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "Basic asdfghjkl",
"testConnectionParams": {
"http": {
"url": "https://<domain name>/api/v2/users.json",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"successResponse": [],
"successResponsePath": "",
"errors": [
"Couldn't authenticate you"
],
"errorPath": "error"
}
}
}
}

 

in order to check import you need to run import.

in order to validate syantax of json you need to validate using any json validator website online