From e2372fad37c11da2d03f8c7cf4caf4cfd8d1dbfd Mon Sep 17 00:00:00 2001 From: adriano Date: Wed, 25 Sep 2024 10:46:21 -0300 Subject: [PATCH] chore: remove old CRM templates and create updated templates for CRM integration --- backend/Templates-test/salesforce_oauth2.json | 153 ++++++++++++++++++ .../salesforce_oauth2_App2_use_este.json | 153 ++++++++++++++++++ 2 files changed, 306 insertions(+) create mode 100644 backend/Templates-test/salesforce_oauth2.json create mode 100644 backend/Templates-test/salesforce_oauth2_App2_use_este.json diff --git a/backend/Templates-test/salesforce_oauth2.json b/backend/Templates-test/salesforce_oauth2.json new file mode 100644 index 0000000..d3a249d --- /dev/null +++ b/backend/Templates-test/salesforce_oauth2.json @@ -0,0 +1,153 @@ +{ + "authentication": { + "type": "oauth2", + "crmClientId": "3MVG9JJwBBbcN47Kv0Z7EuNd19FFiitElmedOGAGcSNXcpIwPZBtd1ySG28ezhGVq13n9QzuixoxLfWeKrzwc", + "crmClientSecret": "334EE185A4DB8A145E5A11F4F90980C5020170820BD5395EF93E16046505936C", + "crmScopes": "", + "crmPhoneTest": "5511988334455" + }, + "crmRest": [ + { + "authorizationEndpoint": { + "request": { + "requestContentType": "empty", + "requestEncoding": "empty", + "requestType": "Get", + "responseType": "empty", + "url": "https://login.salesforce.com/services/oauth2/authorize?client_id=crmClientId&response_type=code&code_challenge=bDXEJ0wxr0s369lGxHwewLULiOuyl6Y3W7QZABmn2S4&redirect_uri=crmRedirectURI" + }, + "body": {}, + "response": {} + } + }, + { + "tokenEndpoint": { + "request": { + "requestContentType": "none", + "requestEncoding": "Json", + "requestType": "Post", + "responseType": "Json", + "url": "https://login.salesforce.com/services/oauth2/token" + }, + "body": {}, + "response": {} + } + }, + { + "createContactRecord": { + "request": { + "requestContentType": "application/json", + "requestEncoding": "Json", + "requestType": "Post", + "responseType": "Json", + "url": "https://nocompany-a9-dev-ed.develop.my.salesforce.com/services/data/v61.0/sobjects/Contact" + }, + "body": { + "Phone": "crmPhone", + "LastName": "crmLastName", + "FirstName": "crmFirstName" + }, + "response": { + "id": "id" + } + } + }, + { + "lookupContactByPhone": { + "request": { + "requestContentType": "application/json", + "requestEncoding": "Json", + "requestType": "Get", + "responseType": "Json", + "url": "https://nocompany-a9-dev-ed.develop.my.salesforce.com/services/data/v61.0/query/?q=SELECT+Id,+Phone+FROM+Contact+WHERE+Phone='crmPhone'" + }, + "response": { + "phone": "records[0].Phone", + "id": "records[0].Id" + } + } + }, + { + "callJournaling": { + "request": { + "requestContentType": "application/json", + "requestEncoding": "Json", + "requestType": "Post", + "responseType": "Json", + "url": "https://nocompany-a9-dev-ed.develop.my.salesforce.com/services/data/v61.0/sobjects/Task" + }, + "calls": [ + { + "inboundAnsweredCall": { + "Subject": "Call Journal", + "WhoId": "crmContactId", + "Description": "Ligação recebida", + "Status": "Completed", + "Priority": "Normal", + "CallType": "Outbound", + "CallDurationInSeconds": { + "_prop": "crmCallDuration", + "_type": "number", + "_format": "seconds" + }, + "ActivityDate": "YYYY-MM-DD", + "TaskSubtype": "Call" + } + }, + { + "inboundMissedCall": { + "Subject": "Call Journal", + "WhoId": "crmContactId", + "Description": "Ligação recebida perdida", + "Status": "Completed", + "Priority": "Normal", + "CallType": "Outbound", + "CallDurationInSeconds": { + "_prop": "crmCallDuration", + "_type": "number", + "_format": "seconds" + }, + "ActivityDate": "YYYY-MM-DD", + "TaskSubtype": "Call" + } + }, + { + "outboundAnsweredCall": { + "Subject": "Call Journal", + "WhoId": "crmContactId", + "Description": "Ligação realizada", + "Status": "Completed", + "Priority": "Normal", + "CallType": "Outbound", + "CallDurationInSeconds": { + "_prop": "crmCallDuration", + "_type": "number", + "_format": "seconds" + }, + "ActivityDate": "YYYY-MM-DD", + "TaskSubtype": "Call" + } + }, + { + "outboundUnansweredCall": { + "Subject": "Call Journal", + "WhoId": "crmContactId", + "Description": "Ligação realizada nao atendida", + "Status": "Completed", + "Priority": "Normal", + "CallType": "Outbound", + "CallDurationInSeconds": { + "_prop": "crmCallDuration", + "_type": "number", + "_format": "seconds" + }, + "ActivityDate": "YYYY-MM-DD", + "TaskSubtype": "Call" + } + } + ], + "response": {} + } + } + ] +} diff --git a/backend/Templates-test/salesforce_oauth2_App2_use_este.json b/backend/Templates-test/salesforce_oauth2_App2_use_este.json new file mode 100644 index 0000000..81e8bba --- /dev/null +++ b/backend/Templates-test/salesforce_oauth2_App2_use_este.json @@ -0,0 +1,153 @@ +{ + "authentication": { + "type": "oauth2", + "crmClientId": "3MVG9JJwBBbcN47Kv0Z7EuNd19INI1Bhe7uX_Wz6M0VlMyWJD4xPKTtn_b39bGn6LmdSkKJ.aLNGdV1brj16C", + "crmClientSecret": "870E8D51A1CA06896D966A3D92ABD885346DAD4428926E965776C479055969E7", + "crmScopes": "full refresh_token", + "crmPhoneTest": "5511988334455" + }, + "crmRest": [ + { + "authorizationEndpoint": { + "request": { + "requestContentType": "empty", + "requestEncoding": "empty", + "requestType": "Get", + "responseType": "empty", + "url": "https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=crmClientId&code_challenge=bDXEJ0wxr0s369lGxHwewLULiOuyl6Y3W7QZABmn2S4&redirect_uri=crmRedirectURI&scope=crmScopes&code_challenge_method=S256" + }, + "body": {}, + "response": {} + } + }, + { + "tokenEndpoint": { + "request": { + "requestContentType": "none", + "requestEncoding": "Json", + "requestType": "Post", + "responseType": "Json", + "url": "https://login.salesforce.com/services/oauth2/token" + }, + "body": {}, + "response": {} + } + }, + { + "createContactRecord": { + "request": { + "requestContentType": "application/json", + "requestEncoding": "Json", + "requestType": "Post", + "responseType": "Json", + "url": "https://nocompany-a9-dev-ed.develop.my.salesforce.com/services/data/v61.0/sobjects/Contact" + }, + "body": { + "Phone": "crmPhone", + "LastName": "crmLastName", + "FirstName": "crmFirstName" + }, + "response": { + "id": "id" + } + } + }, + { + "lookupContactByPhone": { + "request": { + "requestContentType": "application/json", + "requestEncoding": "Json", + "requestType": "Get", + "responseType": "Json", + "url": "https://nocompany-a9-dev-ed.develop.my.salesforce.com/services/data/v61.0/query/?q=SELECT+Id,+Phone+FROM+Contact+WHERE+Phone='crmPhone'" + }, + "response": { + "phone": "records[0].Phone", + "id": "records[0].Id" + } + } + }, + { + "callJournaling": { + "request": { + "requestContentType": "application/json", + "requestEncoding": "Json", + "requestType": "Post", + "responseType": "Json", + "url": "https://nocompany-a9-dev-ed.develop.my.salesforce.com/services/data/v61.0/sobjects/Task" + }, + "calls": [ + { + "inboundAnsweredCall": { + "Subject": "Call Journal", + "WhoId": "crmContactId", + "Description": "Ligação recebida", + "Status": "Completed", + "Priority": "Normal", + "CallType": "Outbound", + "CallDurationInSeconds": { + "_prop": "crmCallDuration", + "_type": "number", + "_format": "seconds" + }, + "ActivityDate": "YYYY-MM-DD", + "TaskSubtype": "Call" + } + }, + { + "inboundMissedCall": { + "Subject": "Call Journal", + "WhoId": "crmContactId", + "Description": "Ligação recebida perdida", + "Status": "Completed", + "Priority": "Normal", + "CallType": "Outbound", + "CallDurationInSeconds": { + "_prop": "crmCallDuration", + "_type": "number", + "_format": "seconds" + }, + "ActivityDate": "YYYY-MM-DD", + "TaskSubtype": "Call" + } + }, + { + "outboundAnsweredCall": { + "Subject": "Call Journal", + "WhoId": "crmContactId", + "Description": "Ligação realizada", + "Status": "Completed", + "Priority": "Normal", + "CallType": "Outbound", + "CallDurationInSeconds": { + "_prop": "crmCallDuration", + "_type": "number", + "_format": "seconds" + }, + "ActivityDate": "YYYY-MM-DD", + "TaskSubtype": "Call" + } + }, + { + "outboundUnansweredCall": { + "Subject": "Call Journal", + "WhoId": "crmContactId", + "Description": "Ligação realizada nao atendida", + "Status": "Completed", + "Priority": "Normal", + "CallType": "Outbound", + "CallDurationInSeconds": { + "_prop": "crmCallDuration", + "_type": "number", + "_format": "seconds" + }, + "ActivityDate": "YYYY-MM-DD", + "TaskSubtype": "Call" + } + } + ], + "response": {} + } + } + ] +}