I have a asp.net web form i want to post data of my form in to marketo | Community
Skip to main content
August 3, 2016
Question

I have a asp.net web form i want to post data of my form in to marketo

  • August 3, 2016
  • 2 replies
  • 1357 views

Hi i have a asp.net web form and submit button i want to post data from my form to marketo on submit button click is there any way to do this using c#.

Reply appreciated

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

August 3, 2016

Yes, here is the sample code from developers.marketo.com  http://developers.marketo.com/documentation/rest/createupdate-leads/

Sample Code - C#

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Net;
  7. using System.IO;
  8. using System.Collections;
  9. using Newtonsoft.Json;
  10. namespace Samples
  11. {
  12.     class UpsertLeads
  13.     {
  14.         private String host = "CHANGE ME"; //host of your marketo instance, https://AAA-BBB-CCC.mktorest.com
  15.         private String clientId = "CHANGE ME"; //clientId from admin > Launchpoint
  16.         private String clientSecret = "CHANGE ME"; //clientSecret from admin > Launchpoint
  17.         public String lookupField;//field to deduplicate on
  18.         public String action;//action to take, createOnly, updateOnly, createOrUpdate, createDuplicate
  19.         public List<Dictionary<string, string>> input;//list of dictionaries which represent field/value pairs of leads
  20.         public String partitionName;
  21.         /*
  22.         public static void Main(String[] args)
  23.         {
  24.             UpsertLeads upsert = new UpsertLeads();
Kenny_Elkington
Adobe Employee
Adobe Employee
August 3, 2016

This method is significantly simpler and easier to implement than Jamie's suggestion: Make a Marketo Form Submission in the background