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

Help with create Account Json Coupa

MTewari
New Contributor II
New Contributor II

Hi All,

I am working on Coupa connector for Employee Provisioning and I am unable to create accounts in Coupa.

The task is getting completed and I can see the account in Saviynt but account is not being created in Coupa : 

MohitTewari_0-1691166234132.png

Below is the create account Json:

{
 
"accountIdPath": "call1.message.id",
 
"responseColsToPropsMap": {
 
 
"customproperty2": "call1.message.firstname~#~char",
 
"customproperty3": "call1.message.lastName~#~char",
 
"customproperty5": "call1.message.mention-name~#~char",
 
"customproperty14": "call1.message.created-by.id~#~char",
 
"customproperty15": "call1.message.authentication-method~#~char",
 
"customproperty16": "call1.message.sso-identifier~#~char",
 
"customproperty17": "call1.message.default-currency:code~#~char"
 
},
 
"call": [
 
{
 
"name": "call1",
"connection": "acctAuth",
"httpMethod": "POST",
"httpParams": "{\"login\":\"${user.locationdesc}\",\"sso-identifier\":\"${user.locationdesc}\",\"active\":false,\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.displayname}\",\"band\":\"${user.band}\",\"sharp-user-id\":\"${user.username}\",\"phone-work\":\"${user.phonenumber}\",\"roles\":{\"role\":{\"name\":\"Read Only\"}},\"default-address\": {\"country\": {\"code\": \"${user.country}\"},\"city\": \"\",\"street1\": \"${user.street}\",\"postal-code\": \"${user.customproperty31}\",\"state\":\"${user.customproperty58}\"},\"default-currency:{\"code\":\"USD\"}, \"requisition-approval-limit\": {\"name\":\"${user.country}+'-'+${user.band}\"}, \"invoice-approval-limit\":{\"name\": \"${user.country}+'-'+${user.band}\"},\"authentication-method\":\"saml\"}",
"httpHeaders": {
"accessToken": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
}
]
}
 
I traced the logs and found this error :
MohitTewari_1-1691167064757.png

Can someone please help on this, we are going live next week.

16 REPLIES 16

pmahalle
All-Star
All-Star

Hi @MTewari ,

Can you try below createAccountJSON. One of the double quote was missing.

{

"accountIdPath": "call1.message.id",

"responseColsToPropsMap": {


"customproperty2": "call1.message.firstname~#~char",

"customproperty3": "call1.message.lastName~#~char",

"customproperty5": "call1.message.mention-name~#~char",

"customproperty14": "call1.message.created-by.id~#~char",

"customproperty15": "call1.message.authentication-method~#~char",

"customproperty16": "call1.message.sso-identifier~#~char",

"customproperty17": "call1.message.default-currency:code~#~char"

},

"call": [

{

"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxxxxx.com/api/users/",
"httpMethod": "POST",
"httpParams": "{\"login\":\"${user.locationdesc}\",\"sso-identifier\":\"${user.locationdesc}\",\"active\":false,\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.displayname}\",\"band\":\"${user.band}\",\"sharp-user-id\":\"${user.username}\",\"phone-work\":\"${user.phonenumber}\",\"roles\":{\"role\":{\"name\":\"Read Only\"}},\"default-address\": {\"country\": {\"code\": \"${user.country}\"},\"city\": \"\",\"street1\": \"${user.street}\",\"postal-code\": \"${user.customproperty31}\",\"state\":\"${user.customproperty58}\"},\"default-currency\":{\"code\":\"USD\"}, \"requisition-approval-limit\": {\"name\":\"${user.country}+'-'+${user.band}\"}, \"invoice-approval-limit\":{\"name\": \"${user.country}+'-'+${user.band}\"},\"authentication-method\":\"saml\"}",
"httpHeaders": {
"accessToken": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
}
]
}


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

MTewari
New Contributor II
New Contributor II

Hi  pmahalle,

Thanks the above solution helps . I've applied the fix and now able to create the accounts. However, some of the values are going as static via the Json :

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"displayName": "call1.message.fullname~#~char",
"customproperty1": "call1.message.email~#~char",
"customproperty2": "call1.message.firstname~#~char",
"customproperty3": "call1.message.lastName~#~char",
"name": "call1.message.login~#~char",
"customproperty5": "call1.message.mention-name~#~char",
"customproperty16": "call1.message.sso-identifier~#~char"
},
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "https:xxxxxx.com/api/users/",
"httpMethod": "POST",
"httpParams": "{\"login\":\"${user.locationdesc}\",\"sso-identifier\":\"${user.locationdesc}\",\"active\":false,\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.displayname}\",\"band\":\"${user.band}\",\"sharp-user-id\":\"${user.username}\",\"phone-work\":\"${user.phonenumber}\",\"roles\":{\"role\":{\"name\":\"Read Only\"}},\"default-address\": {\"country\": {\"code\": \"${user.country}\"},\"city\": \"${user.city}\",\"street1\": \"${user.street}\",\"postal-code\": \"${user.customproperty31}\",\"state\":\"${user.customproperty58}\"},\"default-currency\":{\"code\":\"USD\"}, \"requisition-approval-limit\": {\"name\":\"${user.country}+'-'+${user.band}\"}, \"invoice-approval-limit\":{\"name\": \"${user.country}+'-'+${user.band}\"},\"authentication-method\":\"saml\",\"invoice-approval-limit\":\"\"}",
"httpHeaders": {
"accessToken": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [201]
}
}]
}

The below attributes are populated as static.

MohitTewari_0-1691243425028.png

Can you please help me with this.

 

Hi @MTewari ,

Can you try below json once:

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"displayName": "call1.message.fullname~#~char",
"customproperty1": "call1.message.email~#~char",
"customproperty2": "call1.message.firstname~#~char",
"customproperty3": "call1.message.lastName~#~char",
"name": "call1.message.login~#~char",
"customproperty5": "call1.message.mention-name~#~char",
"customproperty16": "call1.message.sso-identifier~#~char"
},
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "https:xxxxxx.com/api/users/",
"httpMethod": "POST",
"httpParams": "{\"login\":\"${user.locationdesc}\",\"sso-identifier\":\"${user.locationdesc}\",\"active\":false,\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.displayname}\",\"band\":\"${user.band}\",\"sharp-user-id\":\"${user.username}\",\"phone-work\":\"${user.phonenumber}\",\"roles\":{\"role\":{\"name\":\"Read Only\"}},\"default-address\": {\"country\": {\"code\":\"${user.country}\"},\"city\":\"${user.city}\",\"street1\":\"${user.street}\",\"postal-code\": "${user.customproperty31}\",\"state\":\"${user.customproperty58}\"},\"default-currency\":{\"code\":\"USD\"}, \"requisition-approval-limit\": {\"name\":\"${user.country}+'-'+${user.band}\"}, \"invoice-approval-limit\":{\"name\":\"${user.country}+'-'+${user.band}\"},\"authentication-method\":\"saml\",\"invoice-approval-limit\":\"\"}",
"httpHeaders": {
"accessToken": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [201]
}
}]
}


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

This happens when one of the dyanamic variable is wrong is json always try with limiting variable to drill down problem. It seems band is some customproperty of user


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

armaanzahir
Valued Contributor
Valued Contributor

Hi @MTewari ,

I see you're using a binding variable ${user.band}. This seems to be incorrect. 

Not sure on what it is (employeeType or employeeclass) but since Coupa would be a rest connector, please refer to the developer's handbook for getting a list of supported user object binding variables for it's provisioning json's

armaanzahir_0-1691347512937.png

Developers Handbook (saviyntcloud.com)

 

Thanks,

Armaan

Regards,
Md Armaan Zahir

MTewari
New Contributor II
New Contributor II

Hi all,

Thanks that works. Also can you help me with the binding values to get manager's email from manager's Saviynt user perofile.

In user profile the manager's username is stored in owner attribute and in Developer's handbook I can see one call to get manager's details but unsure how to user it in my json : 

MohitTewari_0-1691405618517.png

"httpParams": "{  \"Fields\": [ { \"Name\": \"requestDefinitionId\", \"Value\": \"a573b000000PPelAAH\" }, { \"Name\": \"client\", \"Value\": \"${response.'Update Login'.message.records[0].Id}\" } ], \"Answers\": [ { \"QuestionId\": \"a533b000001k5w4AAA\",\"Values\": [ \"${com.saviynt.ecm.identitywarehouse.domain.Users.get(user.manager).firstname} ${com.saviynt.ecm.identitywarehouse.domain.Users.get(user.manager).lastname} (${user.owner.toUpperCase()})\" ] },{\"QuestionId\": \"a533b000001k5w9AAA\",\"Values\": [ \"${user.departmentname} (${user.departmentNumber})\"]}]}",

However I am unsure how to send it from my json : 

Coupa Json : 

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"displayname": "call1.message.fullname~#~char",
"customproperty1": "call1.message.email~#~char",
"customproperty2": "call1.message.firstname~#~char",
"customproperty3": "call1.message.lastName~#~char",
"name": "call1.message.login~#~char",
"customproperty5": "call1.message.mention-name~#~char",
"customproperty16": "call1.message.sso-identifier~#~char"
},
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "xxxxxxxxxxxxx/api/users/${account.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"login\":\"${user.locationdesc}\",\"sso-identifier\":\"${user.locationdesc}\",\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.displayname}\",\"band\":\"${user.employeeclass}\",\"sharp-user-id\":\"${user.username}\",\"phone-work\":\"${user.phonenumber}\",\"default-address\":{\"country\":{\"code\":\"${user.country}\"},\"city\":\"${user.city}\",\"street1\":\"${user.street}\",\"postal-code\":\"${user.customproperty31}\"},\"state\":\"${user.customproperty58}\"}},\"requisition-approval-limit\":{\"name\":\"${user.country}+'-'+${user.employeeclass}\"}, \"invoice-approval-limit\":{\"name\":\"${user.country}+'-'+${user.employeeclass}\"}}",
"httpHeaders": {
"accessToken": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201]
}
}]
}

I want to add \"manager\": \"{manager's email}\" in my http params 

How can I do it using this method can you help ?

"httpParams": "{  \"Fields\": [ { \"Name\": \"requestDefinitionId\", \"Value\": \"a573b000000PPelAAH\" }, { \"Name\": \"client\", \"Value\": \"${response.'Update Login'.message.records[0].Id}\" } ], \"Answers\": [ { \"QuestionId\": \"a533b000001k5w4AAA\",\"Values\": [ \"${com.saviynt.ecm.identitywarehouse.domain.Users.get(user.manager).firstname} ${com.saviynt.ecm.identitywarehouse.domain.Users.get(user.manager).lastname} (${user.owner.toUpperCase()})\" ] },{\"QuestionId\": \"a533b000001k5w9AAA\",\"Values\": [ \"${user.departmentname} (${user.departmentNumber})\"]}]}",

 

Hi @MTewari ,

Use ${userManager.email} as below to get manager's email

\"manager\": \"${userManager.email}\"


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

armaanzahir
Valued Contributor
Valued Contributor

Hi @MTewari ,

Is the below suggestion not working?

 \"manager\": \"${com.saviynt.ecm.identitywarehouse.domain.Users.get(user?.manager)?.email}\"

 

You can also try using :

\"manager\": \"${userManager.email}\"

Both these should ideally work in REST Provisioning JSON's.

Regards,
Md Armaan Zahir

MTewari
New Contributor II
New Contributor II

Hi pmahalle/armaanzahir

I am getting NoMethodError in logs when I am sending the values. 

2023-08-07/12:53:42.415 [{}] [quartzScheduler_Worker-3] DEBUG rest.RestProvisioningService - Got Webservice API Response: [headers:[Date: Mon, 07 Aug 2023 12:53:42 GMT, Content-Type: application/json; charset=utf-8, Transfer-Encoding: chunked, Connection: keep-alive, Set-Cookie: AWSALB=Syh8IJ13qW2mCst9gh9Ie+7qiRknFhCHkxVuFofjrSK5klL/TMHq7Cc7tA6Op4L5NHRaqLPRl12OI+1+G5QWHH9ziSIVK1q8IC0dW+/3skDNPl1WVP+tQlF+qki0; Expires=Mon, 14 Aug 2023 12:53:42 GMT; Path=/, Set-Cookie: AWSALBCORS=Syh8IJ13qW2mCst9gh9Ie+7qiRknFhCHkxVuFofjrSK5klL/TMHq7Cc7tA6Op4L5NHRaqLPRl12OI+1+G5QWHH9ziSIVK1q8IC0dW+/3skDNPl1WVP+tQlF+qki0; Expires=Mon, 14 Aug 2023 12:53:42 GMT; Path=/; SameSite=None; Secure, status: 400 Bad Request, cache-control: no-cache, vary: Accept, referrer-policy: strict-origin-when-cross-origin, x-robots-tag: none, x-permitted-cross-domain-policies: none, x-xss-protection: 1; mode=block, x-request-id: 38ff3f5e-e495-4659-86c9-8ca88001b487, x-coupa-request-id: 38ff3f5e-e495-4659-86c9-8ca88001b487, x-download-options: noopen, x-runtime: 0.171216, x-frame-options: SAMEORIGIN, x-content-type-options: nosniff, set-cookie: _mkra_ctxt=984557b149e1e28fc86ce827b8aa5232--400; path=/; max-age=5; secure; HttpOnly, server: envoy, strict-transport-security: max-age=31536000; includeSubDomains;], responseText:{"errors":{"user":["An unexpected error occured while creating/updating this record: NoMethodError -- undefined method `only' for \"xxxxxxxx.xxxxxxxxxxx@xx.xxxx.com\":String\n\n find_by_attributes = assoc_attributes.only(*unique_keys)\n ^^^^^"],"warnings":null}}, cookies:[AWSALB=Syh8IJ13qW2mCst9gh9Ie+7qiRknFhCHkxVuFofjrSK5klL/TMHq7Cc7tA6Op4L5NHRaqLPRl12OI+1+G5QWHH9ziSIVK1q8IC0dW+/3skDNPl1WVP+tQlF+qki0; Expires=Mon, 14 Aug 2023 12:53:42 GMT; Path=/, AWSALBCORS=Syh8IJ13qW2mCst9gh9Ie+7qiRknFhCHkxVuFofjrSK5klL/TMHq7Cc7tA6Op4L5NHRaqLPRl12OI+1+G5QWHH9ziSIVK1q8IC0dW+/3skDNPl1WVP+tQlF+qki0; Expires=Mon, 14 Aug 2023 12:53:42 GMT; Path=/; SameSite=None; Secure, _mkra_ctxt=984557b149e1e28fc86ce827b8aa5232--400; path=/; max-age=5; secure; HttpOnly], statusCode:400]

Here is the http params that I am using :

"httpParams": "{\"login\":\"${user.locationdesc}\",\"sso-identifier\":\"${user.locationdesc}\",\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.displayname}\",\"band\":\"${user.employeeclass}\",\"sharp-user-id\":\"${user.username}\",\"phone-work\":\"${user.phonenumber}\",\"default-address\":{\"country\":{\"code\":\"${user.country}\"},\"city\":\"${user.city}\",\"street1\":\"${user.street}\",\"postal-code\":\"${user.customproperty31}\",\"state\":\"${user.customproperty58}\"},\"requisition-approval-limit\":{\"name\":\"${user.country}+'-'+${user.employeeclass}\"}, \"invoice-approval-limit\":{\"name\":\"${user.country}+'-'+${user.employeeclass}\"},\"manager\": \"${usermanager.email}\"}",

 

What am I doing wrong? I have confirmed the maanger is present in Coupa with the same email 

[This message has been edited by moderator to mask email ID]

 

Hi @MTewari ,

you are using usermanager not userManager, make sure it’s in camel case.

\"manager\": \"${userManager.email}\"


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

MTewari
New Contributor II
New Contributor II

Hi pmahalle,

It is solved thanks . I was sending it the wrong way.

It had to go like this : \"manager\":{\"email\":\"${userManager.email}\"}

Thank you all for the help.

 

MTewari
New Contributor II
New Contributor II

 

Hi All,

I am trying to send \"default-address\": value in the below json only for internal employee and I have tried  multiple approaches but dosent seem to work.

Approach 1 : If condition for single attribute 

"httpParams": "{\"login\":\"${user.locationdesc}\",\"sso-identifier\":\"${user.locationdesc}\",\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.displayname}\",\"band\":\"${user.employeeclass}\",\"sharp-user-id\":\"${user.username}\",\"phone-work\":\"${user.phonenumber}\",\"roles\":{\"role\":{\"name\":\"ABI Read Only\"}},\"default-address\": {\"country\": {\"code\":\"${if(user.employeeType.equals('Internal Employee)){''}else{user.country}}\"},\"city\":\"${if(user.employeeType!='Internal Employee'){''}else{user.city}}\",\"street1\":\"${if(user.employeeType.equa'Interna Employee'){''}else{user.street}}\",\"postal-code\": \"${if(user.employeeType!='Internal Employee'){''}else{user.customproperty31}}\",\"state\":\"${user.customproperty58.substring(user.customproperty58.lastIndexOf('||')+2)}\"},\"requisition-approval-limit\": {\"name\":\"${user.country}-${user.employeeclass}\"}, \"invoice-approval-limit\":{\"name\":\"${user.country}-${user.employeeclass}\"},\"manager\":{\"login\":\"${userManager.locationdesc}\"}}",

 

Approach 1 : If condition for single attribute :

\"default-address\": {\"country\": {\"code\":\"${if(user.employeeType.equals('Internal Employee)){''}else{user.country}}\"},\"city\":\"${if(user.employeeType!='Internal Employee'){''}else{user.city}}\",\"street1\":\"${if(user.employeeType.equa'Interna Employee'){''}else{user.street}}\",\"postal-code\": \"${if(user.employeeType!='Internal Employee'){''}else{user.customproperty31}}\",\"state\":\"${user.customproperty58.substring(user.customproperty58.lastIndexOf('||')+2)}\"},\"requisition-approval-limit\": {\"name\":\"${user.country}-${user.employeeclass}\"}, \"invoice-approval-limit\":{\"name\":\"${user.country}-${user.employeeclass}\"},\"manager\":{\"login\":\"${userManager.locationdesc}\"}}",

Approach 2 :

\"default-address\":\"${if(user.employeeType!=null){if(user.employeeType.equals('Internal Employee')){\"country\": {\"code\":\"${user.country}\"},\"city\":\"${user.city}\",\"street1\":\"${user.street}\",\"postal-code\": \"${user.customproperty31}\",\"state\":\"${user.customproperty58.substring(user.customproperty58.lastIndexOf('||')+2)}\"}else{''}}else{''}}\",

Both of these are not working as of now. Am i missing something or is the approach incorrect ?

 

 

Hi @MTewari ,

Can you try below

"default-address": {
"country": {
"code": "${if(user.employeeType.equals('Internal Employee')){''}else{user.country}}"
},
"city": "${if(user.employeeType!='Internal Employee'){''}else{user.city}}",
"street1": "${if(user.employeeType.equa'Internal Employee'){''}else{user.street}}",
"postal-code": "${if(user.employeeType!='Internal Employee'){''}else{user.customproperty31}}",
"state": "${user.customproperty58.substring(user.customproperty58.lastIndexOf('||')+2)}"
}


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

MTewari
New Contributor II
New Contributor II

Hi @pmahalle ,

I see it is not working as it needs a mandatory value. Since employees other than Internal will not have any value, we don't have to send default-address altogether for them.

Is there a way we can send :

${if(user.employeeType.equals('Internal Employee')){\"default-address\": {\"country\": {\"code\":\"${user.country}\"},\"city\":\"${user.city}\",\"street1\":\"${user.street}\",\"postal-code\": \"${user.customproperty31}\",\"state\":\"${user.customproperty58.substring(user.customproperty58.lastIndexOf('||')+2)}\"}else{''}

what will be the correct syntax for that ?

MTewari
New Contributor II
New Contributor II

@pmahalle 

I used your provided json and it is not updating any attribute. The pending task is completing but always going on else condition and not updating any attribute.

I am trying below approach but same is happening. (PS : Just check default-address)

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"displayname": "call1.message.fullname~#~char",
"customproperty1": "call1.message.email~#~char",
"customproperty2": "call1.message.firstname~#~char",
"customproperty3": "call1.message.lastName~#~char",
"name": "call1.message.login~#~char",
"customproperty5": "call1.message.mention-name~#~char",
"customproperty16": "call1.message.sso-identifier~#~char"
},
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxx.com/api/users/${account.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"login\":\"${user.locationdesc}\",\"sso-identifier\":\"${user.locationdesc}\",\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.displayname}\",\"band\":\"${user.employeeclass}\",\"sharp-user-id\":\"${user.username}\",\"phone-work\":\"${if(user.phonenumber!=null){user.phonenumber}else{''}}\",\"roles\":{\"role\":{\"name\":\"ABI Read Only\"}},\"requisition-approval-limit\": {\"name\":\"${user.country}-${user.employeeclass}\"}, \"invoice-approval-limit\":{\"name\":\"${user.country}-${user.employeeclass}\"},\"default-address\":\"${if(user.employeeType.equals('Internal Employee')){\"country\": {\"code\":\"${user.country}\"},\"city\":\"${user.city}\",\"street1\":\"${user.street}\",\"postal-code\": \"${user.customproperty31}\",\"state\":\"${user.customproperty58.substring(user.customproperty58.lastIndexOf('||')+2)}\"}else{''}}\"}",
"httpHeaders": {
"accessToken": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}

MTewari
New Contributor II
New Contributor II

Hi @pmahalle 

I am trying this Json.  And getting the below error.

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"displayname": "call1.message.fullname~#~char",
"customproperty1": "call1.message.email~#~char",
"customproperty2": "call1.message.firstname~#~char",
"customproperty3": "call1.message.lastName~#~char",
"name": "call1.message.login~#~char",
"customproperty5": "call1.message.mention-name~#~char",
"customproperty16": "call1.message.sso-identifier~#~char"
},
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xxxxxxxxxxx/api/users/${account.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"login\":\"${user.locationdesc}\",\"sso-identifier\":\"${user.locationdesc}\",\"email\":\"${user.email}\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.displayname}\",\"band\":\"${user.employeeclass}\",\"sharp-user-id\":\"${user.username}\",\"phone-work\":\"${if(user.phonenumber!=null){user.phonenumber}else{''}}\",\"roles\":{\"role\":{\"name\":\"ABI Read Only\"}},\"requisition-approval-limit\":{\"name\":\"${user.country}-${user.employeeclass}\"}, \"invoice-approval-limit\":{\"name\":\"${user.country}-${user.employeeclass}\"},\"default-address\":{\"country\":{\"code\":\"${if(user.employeeType.equals('Internal Employee')){user.country}else{''}}\"},\"city\":\"${if(user.employeeType!='Internal Employee'){''}else{user.city}}\",\"street1\":\"${if(user.employeeType.equals('Internal Employee'){user.street}else{''}}\",\"postal-code\":\"${if(user.employeeType!='Internal Employee'){''}else{user.customproperty31}}\",\"state\":\"${user.customproperty58.substring(user.customproperty58.lastIndexOf('||')+2)}\"}}",
"httpHeaders": {
"accessToken": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}

ERROR:

"auditDetails":{"call1":[{"headers":{"Transfer-Encoding":"chunked","x-request-id":"807e4cbf-eeef-44ec-89df-c26a572bc20a","server":"envoy","vary":"Accept","x-frame-options":"SAMEORIGIN","Connection":"keep-alive","x-permitted-cross-domain-policies":"none","x-download-options":"noopen","Date":"Fri, 18 Aug 2023 06:10:24 GMT","strict-transport-security":"max-age=31536000; includeSubDomains;","set-cookie":"_mkra_ctxt=6a535aec70063c3aeecc970c0fd0d0fa--400; path=/; max-age=5; secure; HttpOnly","x-coupa-request-id":"807e4cbf-eeef-44ec-89df-c26a572bc20a","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","x-robots-tag":"none","referrer-policy":"strict-origin-when-cross-origin","x-runtime":"0.140374","cache-control":"no-cache","Content-Type":"application/json; charset=utf-8","status":"400 Bad Request"},"message":{"errors":{"user":["Default Address {nil=>[\"Unable to find valid Country record for country with keys {\\\"code\\\"=>\\\"${if(user.employeeType.equals('Internal Employee')){user.country}else{''}}\\\"}. Possible keys are [\\\"id\\\", \\\"code\\\", \\\"name\\\", \\\"updated_name\\\"]. Please verify your xml.\"]}"],"user.default_address":["Unable to find valid Country record for country with keys {\"code\"=>\"${if(user.employeeType.equals('Internal Employee')){user.country}else{''}}\"}. Possible keys are [\"id\", \"code\", \"name\", \"updated_name\"]. Please verify your xml."],"warnings":null}},"statusCode":400,"description":null,"status":"Failed"}]},"