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
Yes, here is the sample code from developers.marketo.com http://developers.marketo.com/documentation/rest/createupdate-leads/
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Net;
- using System.IO;
- using System.Collections;
- using Newtonsoft.Json;
- namespace Samples
- {
- class UpsertLeads
- {
- private String host = "CHANGE ME"; //host of your marketo instance, https://AAA-BBB-CCC.mktorest.com
- private String clientId = "CHANGE ME"; //clientId from admin > Launchpoint
- private String clientSecret = "CHANGE ME"; //clientSecret from admin > Launchpoint
- public String lookupField;//field to deduplicate on
- public String action;//action to take, createOnly, updateOnly, createOrUpdate, createDuplicate
- public List<Dictionary<string, string>> input;//list of dictionaries which represent field/value pairs of leads
- public String partitionName;
- /*
- public static void Main(String[] args)
- {
- UpsertLeads upsert = new UpsertLeads();
This method is significantly simpler and easier to implement than Jamie's suggestion: Make a Marketo Form Submission in the background