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
RP SinghRP Singh 

Create a custom REST endpoint to accept a JSON with below information: FirstName LastName Phone Email Company 3.

1. Signup for a Developer edition org(Org1)
2. Create a custom REST endpoint to accept a JSON with below information:
FirstName
LastName
Phone
Email
Company
3. The above webservice should accept the request, parse the request and check if  
there is a lead already existing in the system with same details.
1. If exists, it should send response saying lead already exists with same details  
and send Salesforce Id of the existing lead in the response.
2. If no lead exists with matching details, it should create a new lead with details  
received in the request and response should contain Salesforce Id of the new  
lead created.
3. Response should clearly say whether it is sending Salesforce Id of the new  
lead or Salesforce Id of the existing lead.
4. Signup for another Developer edition org(Org2)
5. Create a visualforce page or lightning aura component or lightning web component in  
Org2.
1. It should contain a form with below input fields:
Last Name
First Name
Phone
Email
2. There should be a “Create Lead” button below the form and when user clicks on this  
button, REST webservice call should be made to the endpoint in Org1 and response  
received should be displayed back to the user.  
3. Display spinner or status message to the user while Webservice is in progress.