function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Harris Robin KalashHarris Robin Kalash 

POST request to webto.salesforce.com works on my demo salesforce install but not on my client's

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.
 
Best Answer chosen by Harris Robin Kalash
VaasuVaasu
Hi Harris,

 Please check if there are any 
 
  1. Validation Rules on Lead
  2. Triggers on Lead
  3. Default Lead owner has been assigned and has necessary permissions to create a Leads.

All Answers

VaasuVaasu
Hi Harris,

 Please check if there are any 
 
  1. Validation Rules on Lead
  2. Triggers on Lead
  3. Default Lead owner has been assigned and has necessary permissions to create a Leads.
This was selected as the best answer
Harris Robin KalashHarris Robin Kalash
@Vaasu spot on! there was a validation rule to prevent bots.