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

JSON REST error

iam01
Regular Contributor
Regular Contributor

Hi Team,

 

Below json body is working fine from postman. However i am getting following error

JSON:

{
    "login": "ddf@sf.org",
    "email": "ddf@sf.org",
    "firstname": "test",
    "lastname": "test 05",
    "fullname": "test test 05",
    "employee-number": "13649",
    "active": true,
    "authentication-method": "saml",
    "sso-identifier": "ddf@sf.org",
    "manager": {
        "login": "sdfsdf@xxxx.org"
    },
    "default-address": {
        "street1": "Main Street",  
        "city": "Charlestown",
        "state": "MA",
        "postal-code": "0349",
        "active": true,
        "country": {
            "code": "US"
        }
    },
    "default-account": {
        "code": "01-342",
        "segment-1": "01",
        "segment-2": "342",
        "account-type": {
            "name": "cc",
            "currency": {
                "code": "USD"
            }
        }
    },
    "default-account-type": {
        "name": "dd",
        "currency": {
            "code": "USD"
        }
    },
    "default-currency": {
        "code": "USD"
    },
    "requisition-approval-limit": {
        "amount": 868,
        "currency": {
            "code": "USD"
        }
    },
    "invoice-approval-limit": {
        "amount": 10000,
        "currency": {
            "code": "USD"
        }
    },
    "requisition-self-approval-limit": {
        "amount": 1000,
        "currency": {
            "code": "USD"
        }
    }
}
 
update json:
{\"login\":\"ddf@sf.org\",\"email\":\"ddf@sf.org\",\"firstname\":\"test\",\"lastname\":\"test 05\",\"fullname\":\"test test 05\",\"employee-number\":\"136469\",\"active\":\"true\",\"authentication-method\":\"saml\",\"sso-identifier\":\"ddf@sf.org\",\"manager\":{\"login\":\"ddf@sf.org\"},\"default-address\":{\"street1\":\"529 Main Street\",\"city\":\"Charlestown\",\"state\":\"MA\",\"postal-code\":\"02129\",\"active\":\"true\",\"country\":{\"code\":\"US\"}},\"default-account\":{\"code\":\"01-342\",\"segment-1\":\"01\",\"segment-2\":\"342\"}},\"default-account-type\":{\"name\":\"fddd\",\"currency\":{\"code\":\"USD\"}},\"default-currency\":{\"code\":\"USD\"},\"requisition-approval-limit\":{\"amount\":\"7868\",\"currency\":{\"code\":\"USD\"}},\"invoice-approval-limit\":{\"amount\":\"10000\",\"currency\":{\"code\":\"USD\"}},\"requisition-self-approval-limit\":{\"amount\":\"1000\",\"currency\":{\"code\":\"USD\"}}}
 
====================
ERROR:
 
groovy.lang.MissingPropertyException: No such property: login for class: java.lang.String
groovy.lang.MissingPropertyException: No such property: street1 for class: java.lang.String

"groovy.lang.MissingPropertyException: No such property: name for class: java.lang.String at 

"groovy.lang.MissingPropertyException: No such property: code for class: java.lang.String at

"groovy.lang.MissingPropertyException: No such property: amount for class: java.lang.String at

"groovy.lang.MissingPropertyException: No such property: amount for class: java.lang.String at

"groovy.lang.MissingPropertyException: No such property: amount for class: java.lang.String at
8 REPLIES 8

rushikeshvartak
All-Star
All-Star

Please share full json


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

iam01
Regular Contributor
Regular Contributor

Hey, that is full JSON 

In Saviynt in JSON block its used?


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

iam01
Regular Contributor
Regular Contributor

Create and update

JSON syntax is wrong

https://docs.saviyntcloud.com/bundle/Freshdesk-Guide/page/Content/Understanding-Integration-between-...

 

Sample

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"displayName": "call1.message.id~#~char"
},
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "<TENANT URL>/api/v2/agents",
"httpMethod": "POST",
"httpParams": "{\"name\":\"${arsTasks?.accountName}\",\"email\":\"${user.email}\",\"ticket_scope\":1,\"language\":\"en\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201,
200
]
}
}
]
}


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

iam01
Regular Contributor
Regular Contributor

@rushikeshvartak I have this well formatted according to saviynt Jsons.

 

 After all that am getting above error message.

 

Basically what I observed is if I want to pass even a simple json object of objects am getting this error. With a plain json it's working.

Giving above error for even below simple json

JSON:

 

{

    "login": "ddf@sf.org",

    "email": "ddf@sf.org",

    "firstname": "test",

    "lastname": "test 05",

    "fullname": "test test 05",

    "employee-number": "13649",

    "active": true,

    "authentication-method": "saml",

    "sso-identifier": "ddf@sf.org",

    "manager": {

        "login": "sdfsdf@xxxx.org"

    }}

 

And working fine for:.

 

JSON:

 

{

    "login": "ddf@sf.org",

    "email": "ddf@sf.org",

    "firstname": "test",

    "lastname": "test 05",

    "fullname": "test test 05",

    "employee-number": "13649",

    "active": true,

    "authentication-method": "saml",

    "sso-identifier": "ddf@sf.org"

}

Error may not be related to httparams hence need full saviynt format JSON


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

iam01
Regular Contributor
Regular Contributor

NOT WORKING:

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"displayName": "call1.message.fullname~#~char",
"name": "call1.message.login~#~char",
"customproperty1": "call1.message.email~#~char",
"customproperty2": "call1.message.firstname~#~char",
"customproperty3": "call1.message.lastName~#~char"},
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://xxxx.com/api/users/",
"httpMethod": "POST",
"httpParams": "{\"login\":\"${user.email}\",\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.firstname} ${user.lastname}\",\"employee-number\":\"${user.employeeid}\",\"active\":true,\"authentication-method\":\"saml\",\"sso-identifier\":\"${user.email}\",\"manager\":{\"login\":\"${userManager.email}\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json" },
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201,200
]
}
}
]
}


WORKING:


{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"displayName": "call1.message.fullname~#~char",
"name": "call1.message.login~#~char",
"customproperty1": "call1.message.email~#~char",
"customproperty2": "call1.message.firstname~#~char",
"customproperty3": "call1.message.lastName~#~char"},
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://xxxx/api/users/",
"httpMethod": "POST",
"httpParams": "{\"login\":\"${user.email}\",\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.firstname} ${user.lastname}\",\"employee-number\":\"${user.employeeid}\",\"active\":true,\"authentication-method\":\"saml\",\"sso-identifier\":\"${user.email}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json" },
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201,200
]
}
}
]
}