Yokinsoft.Salesforce.MCE
0.9.3-preview
dotnet add package Yokinsoft.Salesforce.MCE --version 0.9.3-preview
NuGet\Install-Package Yokinsoft.Salesforce.MCE -Version 0.9.3-preview
<PackageReference Include="Yokinsoft.Salesforce.MCE" Version="0.9.3-preview" />
<PackageVersion Include="Yokinsoft.Salesforce.MCE" Version="0.9.3-preview" />
<PackageReference Include="Yokinsoft.Salesforce.MCE" />
paket add Yokinsoft.Salesforce.MCE --version 0.9.3-preview
#r "nuget: Yokinsoft.Salesforce.MCE, 0.9.3-preview"
#:package Yokinsoft.Salesforce.MCE@0.9.3-preview
#addin nuget:?package=Yokinsoft.Salesforce.MCE&version=0.9.3-preview&prerelease
#tool nuget:?package=Yokinsoft.Salesforce.MCE&version=0.9.3-preview&prerelease
.NET client library for Salesforce Marketing Cloud Engagement REST API
WARNING: This libary is not Not Fully Implemented .
- Easy access to Salesforce Marketing Cloud Engagement REST API from .NET applications.
- Compatible with .NET Standard 2.0 and .NET Framework 4.6.1+
- Additional easy handling of Data Extensions with .NET LINQ and DataTables.
- Not Fully Implemented This library is a work in progress and does not yet cover all endpoints of the Salesforce Marketing Cloud Engagement REST API.
Usage
1. Get AccessToken
Make sure Auth endpoint URI or {subdomain}, Member ID (account ID), ClientID and ClientSecret are given from Salesforce Marketing Cloud Engagement.
Auth endpoint URI looks like https://{subdomain}.auth.marketingcloudapis.com/v2/token.
{subdomain} can be used instead of full endpoint URI.
using Yokinsosft.Salesforce.MCE;
var auth = new Auth("YOUR_AUTH_ENDPOINT_OR_DOMAIN");
var accessToken = auth.GetAccessToken("YOUR_MEMBER_ID", "YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET" );
Obtained access token has limited life time. You may need to refresh it when it expires and store at a certain place like memory or file storage for persistency.
if( !accessToken.IsValid )
{
accessToken = auth.GetAccessToken();
}
2. Initialize API client
Along with the Salesforce MCE API document sections, multiple API clients are defined per purpose.
DataExtensions for Data Extentions section, DataExtentionRows for Data Extension Rows section, and so on.
implemented API clients are:
| API section | Class Name | Implementation |
|---|---|---|
| Address | Address | 〇 |
| Auth | Auth | 〇 |
| Automation Studio | AutomationStudio | 〇 |
| Campaigns | Campaigns | 〇 |
| Contacts | Contacts | △ |
| Event Notification | EventNotification | 〇 |
| Data Extensions | DataExtensions | 〇 |
| Data Extension Data | DataExtensionData | 〇 |
| Data Extension Rows | DataExtensionRows | 〇 |
| Data Extension Imports | DataExtensionImports | 〇 |
| Journeys and Events | JourneysAndEvents | △ |
var de = new DataExtensions(accessToken);
var listContainer = de.GetDataExtensions("SERACH_KEYWORD");
foreach( DataExtension de in listContainer.Items ){
;
}
PageableListContainer<DataExtension> listContainer contains the all response from API including page number
and page size information, which can be used for pagenation that reuiqres multiple API calls later.
3. Additional support for .NET LINQ and DataTable
DataExtensionItemListContainer supports extra .NET programability.
Using LINQ or IDataReader, you can easily consume Data Extension rows over the page size limit (2500)
, where multiple API calls are made internally to fetch all rows.
DataExtension ⇒ Local container (IEnumerable or DataTable)
var dd = new DataExtensionData(accessToken);
var container = dd.GetData("[Data extension ID]");
// consume as IEnumerable<DataExtension.Item>
foreach( var row in container.AsEnumerable()){
row.Keys; // as Dictionary<string,string>
row.Values; // as Dictionary<string,string>
}
// consume as IDataReader
var table = new DataTable();
table.Load( container.CreateDataReader() );
IDataReader provides data type for each column based on the Data Extension field definition. Additionary you can add options to limit the result:
- filter
- fields
- orderBy
- top
- offset
- pagesize
var container = dd.GetDataByKey("[Data extension Key]", top: 100 );
Local container (DataTable) ⇒ DataExtension
var table = new DataTable();
// fill table with data and set PrimaryKey column(s)
var dd = new DataExtensionData(accessToken);
dd.UpsertRowSetByKey("[Data extension ID]", table.CreateDataReader());
Author
Jake Y. Yoshimura Yokinsoft
License
This project is licensed under the MIT License - see the LICENSE file for details
Copyright
© 2025 Yokinsoft, Jake Y.Yoshimura
Revision History
- 2025-12-02 some fixes and additions
- 2025-11-30 Initial version
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 10.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.9.3-preview | 98 | 3/20/2026 |
| 0.9.2-preview | 138 | 12/6/2025 |
| 0.9.1-preview | 645 | 12/3/2025 |
Better handling of Caseinsensitive Items in DataExtension