This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
event_messaging = { | |
consume_topics = ["interaction-ready-for-transcription-v1"], | |
publish_topics = ["interaction-transcribed-v1"] | |
} | |
extra_policies_names = ["CRA-S3-ACCESS", "TRANSCRIPTIONS-S3-ACCESS"] | |
sqs_visibility_timeout = "30" | |
sqs_max_received_count = "60" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> | |
</startup> | |
<appSettings> | |
<add key="username" value="<Salesforce username>" /> | |
<add key="password" value="<Salesforce password>" /> | |
<add key="token" value="<Salesforce user security token>" /> | |
<add key="clientId" value="<Connected app consumer ID>" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Configuration; | |
namespace SfQuery | |
{ | |
public class Program | |
{ | |
private static SalesforceClient CreateClient() | |
{ | |
return new SalesforceClient |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string Query (string soqlQuery) | |
{ | |
using (var client = new HttpClient()) | |
{ | |
string restRequest = InstanceUrl + API_ENDPOINT + "query/?q=" + soqlQuery; | |
var request = new HttpRequestMessage(HttpMethod.Get, restRequest); | |
request.Headers.Add("Authorization", "Bearer " + AuthToken); | |
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); | |
request.Headers.Add("X-PrettyPrint", "1"); | |
var response = client.SendAsync(request).Result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Login() | |
{ | |
String jsonResponse; | |
using (var client = new HttpClient()) | |
{ | |
var request = new FormUrlEncodedContent(new Dictionary<string, string> | |
{ | |
{"grant_type", "password"}, | |
{"client_id", ClientId}, | |
{"client_secret", ClientSecret}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static SalesforceClient() | |
{ | |
// SF requires TLS 1.1 or 1.2 | |
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SalesforceClient | |
{ | |
private const string LOGIN_ENDPOINT = "https://login.salesforce.com/services/oauth2/token"; | |
private const string API_ENDPOINT = "/services/data/v36.0/"; | |
public string Username { get; set; } | |
public string Password { get; set; } | |
public string Token { get; set; } | |
public string ClientId { get; set; } | |
public string ClientSecret { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using Newtonsoft.Json; | |
namespace SfQuery | |
{ | |
public class SalesforceClient |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isTest | |
public class TestCreateFollowupTaskTrigger | |
{ | |
@isTest | |
public static void TestInitialCallTaskIsCreated () | |
{ | |
Lead l = new Lead (LastName = 'Test', Company = 'Acme'); | |
insert l; | |
List<Task> createdTasks = [SELECT Subject, WhoId, ActivityDate FROM Task]; |
NewerOlder