This is a CLI console application built with .Net core that publishes events to Salesforce.
Before using this application, please complete the following software and Salesforce configuration prerequisites.
Please download the following software before using this application.
Before using this application, you must create a connected app in your Salesforce development org:
- From
Setup
, search for"app manager"
in theQuick Find
search box. - Click on
Apps > App Manager
. - Click on
New Connected App
. - Give your app a
Connected App Name
,API Name
, andContact Email
. - Make sure
Enable OAuth Settings
is checked. - Make sure
Enable for Device Flow
is checked. - Make sure the
Callback URL
ishttps://login.salesforce.com/services/oauth2/success
. - Select the
"Access and manage your data (api)"
OAuth Scope is selected. - Make sure
Require Secret for Web Server Flow
is checked. - Take note of your
Consumer Key
andConsumer Secret
. Copy and paste these intoApp.config
.
Follow the below instructions to use this application on your computer.
- Download this repo's .ZIP folder or clone the repo.
- From the root directory, build the binary files using the subsequent command. After running the command, you should see two new folders,
bin
andobj
.dotnet build
- From the root directory, create an
App.config
file to house your API credentials. Paste the subsequent contents into the file, modifying it to suit your credentials. The API version forApiEndpoint
may need to be modified. Note: This file is ignored by Git version control to avoid exposing your credentials.<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <appSettings> <add key="LoginEndpoint" value="https://login.salesforce.com/services/oauth2/token" /> <add key="ApiEndpoint" value="/services/data/v43.0/" /> <add key="ClientId" value="<YOUR_CLIENT_ID>" /> <add key="ClientSecret" value="<YOUR_CLIENT_SECRET>" /> <add key="Username" value="<YOUR_USERNAME>" /> <add key="Password" value="<YOUR_PASSWORD_AND_SECURITY_TOKEN>" /> </appSettings> </configuration>
- Run the application using the subsequent command:
dotnet run
To run the tests, change your directory to SFDCInjector.Tests
and use this command:
dotnet test
To generate code coverage report files in a SFDCInjector.Tests/coverage
directory, run:
dotnet test -p:CollectCoverage=true -p:CoverletOutputFormat=\"json,lcov\" -p:CoverletOutput='./coverage/'
- Consuming Force.com SOAP and REST Web Services from .NET Applications
- Platform Events Developer Guide
- REST API Developer Guide
- SOAP API Developer Guide
- Integrate Salesforce APIs with .Net Core
- Integrating .Net and Salesforce
- Username-Password OAuth Flow