+ Start a Discussion
Eduard SosaEduard Sosa 



A client of ours is using CAKE reporting system to generate leads and the plan is to post leads directly from CAKE to our Salesforce system. CAKE requires the following from Salesforce:

POST URL (where to post the leads)
post fields (to map CAKE fields to Salesforce fields)
list of Sales Force Responses (success and error responses sent from Salesforce so that CAKE knows the status of the POST) 

I've tried to use https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8 POST URL, but I believe I am missing something in this format. Can someone please help point me in the right direction?
Andy BoettcherAndy Boettcher
So if I understand - you're essentially trying to automate WebToLead?  If so, I would advise you to go into Salesforce and generate the HTML via the WebToLead interface so you can see all of the form inputs that are required to submit.

Here's a basic form:
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="YOUR ORGID GOES HERE">
<input type=hidden name="retURL" value="http://your-return-url.com">
<input id="first_name" maxlength="40" name="first_name" size="20" type="text" />
<input  id="last_name" maxlength="80" name="last_name" size="20" type="text" />
<input  id="email" maxlength="80" name="email" size="20" type="text" />
<input  id="company" maxlength="40" name="company" size="20" type="text" />
<input  id="city" maxlength="40" name="city" size="20" type="text" />
<input  id="state" maxlength="20" name="state" size="20" type="text" />
<input type="submit" name="submit">

Eduard SosaEduard Sosa
Hi Andy, thank you very much-
What about the responses?  What are the responses from Salesforce when we post a lead in the forms?
Andy BoettcherAndy Boettcher
Web-to-Lead does not post back a response other than HTTP200 OK.  The "retURL" value that you are setting is what the user gets normally redirected to.
Leo BrooksLeo Brooks
Hi Andy,

I am working with Eduard with this integration from the CAKE side of things. Basically, what we are looking for is a POST URL to post leads directly from our system into his Salesforce. Not sure if WebToLead is what we are looking for or not.

I've attached a screenshot of the Delivery Method screen from CAKE. The highlighted area within the screenshot is where I am looking to place the POST URL.

Also, looking at your basic form example above, would it be possible to use a URL such as: https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8&oid=ORGID_HERE&retURL=http://your-return-url.com&first_name=firstname&last_name=lastname

Leo BrooksLeo Brooks
CAKE Delivery Method Card
Andy BoettcherAndy Boettcher
That *SHOULD* work - I haven't done a query-only string to it, but give it a whirl.  :)
Leo BrooksLeo Brooks
I'll give it a shot and post the results here. Thanks for your help Andy.
Jose RamosJose Ramos
Did this work?  I have a vendor who keeps getting errors while attempting to post leads from Cake to SFDC.
Leo BrooksLeo Brooks
Hi Jose,

The URL format seems to work, but I cannot locate the response codes that CAKE is expecting. I tried using using the HTTP Response codes here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/errorcodes.htm , but get the unknown response error message. Have any idea what the response codes should be?