and more in a single search tool across platforms. Read the announcement here. |
06/18/2023 09:24 PM
Need Sample Create Account JSON for Salesforce Rest Connector with Profile ID mandatory
Solved! Go to Solution.
06/18/2023 10:22 PM
Hello @rishabhgupta,
Please find the sample below for the createaccountjson:
06/18/2023 10:24 PM
@sudeshjaiswal I need sample create account json for Rest Connector (Salesforce)
06/18/2023 11:03 PM
Hi @rishabhgupta ,
Please see the below createAccountJSON for Salesforce
{
"accountIdPath": "call1.message.id",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {
"status": "#CONST#1~#~char"
},
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://<instance_url>/services/data/v44.0/sobjects/User",
"httpMethod": "POST",
"httpParams": "{\"Firstname\": \"${user.firstname!=null?user.firstname:''}\", \"LastName\": \"${user.lastname!=null?user.lastname:''}\",\"Username\":\"${user?.email}\",\"Alias\": \"${user?.customproperty60}\",\"Department\":\"${user.departmentname!=null?user.departmentname:''}\",\"Title\":\"${user.title!=null?user.title:''}\",\"Email\":\"${user.email}\",\"IsActive\":true,\"TimezoneSidKey\":\"Asia/Tokyo\",\"LocaleSidKey\": \"ja_JP\",\"EmailEncodingKey\": \"UTF-8\",\"LanguageLocaleKey\": \"ja\",\"ProfileId\":\"<default_profile_id>\",\"UserPermissionsSupportUser\":true,\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
404,
405,
500
]
}
}
]
}
. Replace <instance_url> and <default_profile_id> with the values from your instance.
06/19/2023 04:45 AM
Thanks @naveenss , can you also provide add access json for rest connector (salesforce)
06/19/2023 04:45 AM
Create Account Json is really helpful, Thanks
06/19/2023 04:52 AM
Hi @rishabhgupta ,
Please see the add access json below for Profile, PermissionSet and Groups. Hope this helps!
{
"call": [
{
"name": "PermissionSet",
"connection": "acctAuth",
"url": "https://<instance_url>/services/data/v44.0/sobjects/PermissionSetAssignment",
"httpMethod": "POST",
"httpParams": "{\"AssigneeId\":\"${account.accountID}\",\"PermissionSetId\":\"${entitlementValue.entitlementID}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
],
"status": [
"success"
]
}
},
{
"name": "Profile",
"connection": "acctAuth",
"url": "https://<instance_url>/services/data/v44.0/sobjects/User/${account?.accountID}",
"httpMethod": "PATCH",
"httpParams": "{\"ProfileId\":\"${entitlementValue.entitlementID}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
204
],
"status": [
"success"
]
}
},
{
"name": "Group",
"connection": "acctAuth",
"url": "https://<instance_url>/services/data/v44.0/sobjects/GroupMember",
"httpMethod": "POST",
"httpParams": "{\"userorGroupId\":\"${account.accountID}\",\"GroupId\":\"${entitlementValue.entitlementID}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
],
"status": [
"success"
]
}
}
]
}
06/19/2023 04:54 AM
Thanks @naveenss
07/05/2023 01:45 AM
Hi Naveen, can you please share remove access json for salesforce
07/05/2023 02:28 AM
Hi @rishabhgupta ,
Please find the remove access json below
{
"call": [
{
"name": "Group",
"connection": "acctAuth",
"url": "https://<instance_url>/services/data/v44.0/query/?q=SELECT+Id+from+GroupMember+WHERE+userorGroupId='${account?.accountID}'+and+GroupId='${entitlementValue.entitlementID}'",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
],
"status": [
"success"
]
}
},
{
"name": "Group",
"connection": "acctAuth",
"url": "https://<instance_url>/services/data/v44.0/sobjects/GroupMember/${response.Group1.message.records[0].Id}",
"httpMethod": "DELETE",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
204
],
"status": [
"success"
]
}
},
{
"name": "PermissionSet",
"connection": "acctAuth",
"url": "https://<instance_url>/services/data/v44.0/query/?q=SELECT+Id+FROM+PermissionSetAssignment+WHERE+AssigneeId='${account?.accountID}'+and+PermissionSetId='${entitlementValue.entitlementID}'",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,201,204
],
"status": [
"success"
]
}
},
{
"name": "PermissionSet",
"connection": "acctAuth",
"url": "https://<instance_url>/services/data/v44.0/sobjects/PermissionSetAssignment/${response.PermissionSet1.message.records[0].Id}",
"httpMethod": "DELETE",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
204
],
"status": [
"success"
]
}
}
]
}
07/05/2023 02:36 AM
This remove access json will not remove profile, need to remove profile as well
07/05/2023 02:41 AM
In Salesforce you cannot remove the profile. We can only update the profile to a standard default one.
06/18/2023 10:59 PM
@rishabhgupta Please use below REST CreateAccountJSON-
{
"accountIdPath": "call1.message.soap:Envelope.soap:Body.CreateResponse.Results.Object.ID",
"responseColsToPropsMap": {
"accountID": "call1.message.soap:Envelope.soap:Body.CreateResponse.Results.Object.ID~#~char",
"customproperty1": "call1.message.soap:Envelope.soap:Body.CreateResponse.Results.Object.AccountUserID~#~char",
"name": "call1.message.soap:Envelope.soap:Body.CreateResponse.Results.Object.UserID~#~char",
"customproperty3": "call1.message.soap:Envelope.soap:Body.CreateResponse.Results.Object.DefaultBusinessUnit~#~char"
},
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://<****>.soap.marketingcloudapis.com/Service.asmx",
"httpMethod": "POST",
"httpParams": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:u=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><s:Header><a:Action s:mustUnderstand=\"1\">Create</a:Action><a:To s:mustUnderstand=\"1\">https://<****>.soap.marketingcloudapis.com/Service.asmx</a:To><fueloauth>${access_token}</fueloauth></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><CreateRequest xmlns=\"http://exacttarget.com/wsdl/partnerAPI\"><Options><SaveOptions><SaveAction>UpdateAdd</SaveAction></SaveOptions></Options><Objects xsi:type=\"AccountUser\"><Client><ID>100021184</ID></Client><Name>${user?.firstname} ${user?.lastname}</Name><UserID>${user?.email}.eRM</UserID><CustomerKey>${user?.email}.eRM</CustomerKey><Email>${user?.email}</Email><NotificationEmailAddress>${user?.email}</NotificationEmailAddress><activeflag>true</activeflag><Password>Welcome12345678!</Password><MustChangePassword>true</MustChangePassword><DefaultBusinessUnit>515011375</DefaultBusinessUnit><SsoIdentities><SsoIdentity><IsActive>true</IsActive><FederatedID>${user?.customproperty62}</FederatedID></SsoIdentity></SsoIdentities></Objects></CreateRequest></s:Body></s:Envelope>",
"httpHeaders": {
"Content-Type": "text/xml"
},
"httpContentType": "text/xml",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}