• Harris Robin Kalash
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hello,

 

I am sending a POST request to "https://webto.salesforce.com/servlet/servlet.WebToLead".

This works fine with a demo account i've setup. What I am sending looks like this: 


 

var options = {
    method: "POST",
    url: "https://webto.salesforce.com/servlet/servlet.WebToLead",
    qs: { encoding: "UTF-8" },
    headers: {
      "Cache-Control": "no-cache",
      "Content-Type": "application/x-www-form-urlencoded"
    },
    form: {
      oid: 'HIDDEN',
      lead_source: 'Website',
     '00N6A000001jcP1': 'HIDDEN',
     retURL: 'https://HIDDEN.com/thank-you/',
     first_name: 'teageaook',
     last_name: 'eao',
     email: 'test+500@me.com',
     phone: '515315315',
     '00N6A000001kwvX': '2-9',
     '00N6A000001kfX1': 'get_demo',
     '00N6A000001lGKW': 'en'
    }
  }

This works just fine on my demo salesforce account, but when i changed hte OID to my client's salesforce instance, it does not work. Any ideas?

Laslty, would just like to mention that I am now doing this via an API call from a server as opposed to a regular <form> but the fact that it worked on my install makes me wonder if it's just a configuration issue.
 

Hello,

 

I am sending a POST request to "https://webto.salesforce.com/servlet/servlet.WebToLead".

This works fine with a demo account i've setup. What I am sending looks like this: 


 

var options = {
    method: "POST",
    url: "https://webto.salesforce.com/servlet/servlet.WebToLead",
    qs: { encoding: "UTF-8" },
    headers: {
      "Cache-Control": "no-cache",
      "Content-Type": "application/x-www-form-urlencoded"
    },
    form: {
      oid: 'HIDDEN',
      lead_source: 'Website',
     '00N6A000001jcP1': 'HIDDEN',
     retURL: 'https://HIDDEN.com/thank-you/',
     first_name: 'teageaook',
     last_name: 'eao',
     email: 'test+500@me.com',
     phone: '515315315',
     '00N6A000001kwvX': '2-9',
     '00N6A000001kfX1': 'get_demo',
     '00N6A000001lGKW': 'en'
    }
  }

This works just fine on my demo salesforce account, but when i changed hte OID to my client's salesforce instance, it does not work. Any ideas?

Laslty, would just like to mention that I am now doing this via an API call from a server as opposed to a regular <form> but the fact that it worked on my install makes me wonder if it's just a configuration issue.