atonalwilson Posted March 31 Share Posted March 31 I need to use C# to do an HTTP POST request to acquire an access token, but I have no idea how to do it. Salesforce Marketing Cloud is a customer relationship management (CRM) platform for marketers that allows them to create and manage marketing relationships and campaigns with customers. I need to run this sample code in C#: POST https://auth.exacttargetapis.com/v1/requestToken Content-Type: application/json { "clientId": "gyjzvytv7ukqtfn3x2qdyfsn", "clientSecret": "************" } I am using SSIS 2008r2, I want to write c# code to make an API call to the exact Target API to connect to the SQL server database. Because I want to pull data from the SQL server to the marketing cloud. I didn't find any article about using SSIS to connect Marketing cloud.....the salesforce marketing cloud rest API or FuelSDK looks like it only supports .net 4 or higher. Quote Link to comment Share on other sites More sharing options...
michaelalyermo Posted April 18 Share Posted April 18 (edited) Hi! The best way to accomplish this would be to use the C# HttpClient library to make an HTTP POST request. This is a sample code snippet that you can use: using System; using System.Net.Http; using System.Text; using Newtonsoft.Json; namespace SampleCode { class Program { static void Main(string[] args) { // Create an HttpClient object HttpClient httpClient = new HttpClient(); // Prepare the request body data string requestBody = "{\n" + "\"clientId\": \"gyjzvytv7uk Recommend read this blog https://mlsdev.com/blog/app-development-cost Edited April 25 by michaelalyermo Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.