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
Nikiforos SakkasNikiforos Sakkas 

Edit Lead by POST request

Hello, 

I have a Salesforce Web2lead account. I know that is possible to create new leads by a POST request from a Web2Lead URL (https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8?city=Test&last_name=Testy&first_name=Test&state=CT etc. )

Is there any solution for editing a lead through a POST request similar way? For Example, is there any way to change first_name from a lead with a POST request and not by hand?

Thanks in advance for your answer.
EmguEmgu
You could probly just use a PUT-request. A PUT-request can Update/Replace, while a POST-request only creates a new object. 

It should work in a similar way, but if you get into trouble just post again!
/E
Nikiforos SakkasNikiforos Sakkas
Emgu thanks for your answer ! I will try it... Do I have to include also to this PUT request a parameter to identify the lead (like unique id), or the salesforce will recognise the lead from the other fileds (email, name etc.) ?
EmguEmgu
Take a look at this cheat sheet: http://resources.docs.salesforce.com/rel1/doc/en-us/static/pdf/SF_Rest_API_cheatsheet_web.pdf

Seems like salesforce uses PATCH insted of PUT. But it works the same way. The exampel in the cheat sheet^ u send Id as a parameter, good luck!
Exampel

https://instance.
salesforce.com/services/
data/vNN.N/sobjects/
sObject/Id