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

Anonymous
Not applicable

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

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

2 REPLIES 2
Anonymous
Not applicable

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

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
Marketo Employee

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

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