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
Michael McGarrityMichael McGarrity 

Using PostmanAPI to post Leads to SalesForce

Hi,

I'm looking to have a form on my website to push lead data to SalesForce.

I followed instructions online and using Postman I'm now able to generate a token & make the request.

However, anytime I do make the request, I get the following error:
[
    {
        "message": "We can't save this record because the “New Lead Created” process failed. Give your Salesforce admin these details. <b>An unhandled fault has occurred in this flow</b><br>An unhandled fault has occurred while processing the flow.  Please contact your system administrator for more information. Error ID: 635493190-62234 (-359849992)",
        "errorCode": "CANNOT_EXECUTE_FLOW_TRIGGER",
        "fields": []
    }
]
Is there anything I can do to resolve this?

FTR I'm just pushing this data in:
<Lead>
<LastName>Jonesy</LastName>
<OwnerID></OwnerID>
<Company>Pharma12341</Company>
<Lead_Title__c>Director</Lead_Title__c>
</Lead>
I think I'm on the right track as when I remove (say) <Company>Pharma12341</Company> it gives me an error about it being a required field so it does pass all that validation.

Thanks for any help here :-) 
 
jerry wingjerry wing
QuickPayportal is an online service or a webpage which have been launched by Athena Health so as to provide benefits to the patients. quickpayportal provides service to user secure access to their health information and pay bills online. https://quickpayportal.red
ANUTEJANUTEJ (Salesforce Developers) 
Hi Michael,

I think there is an option called web to lead where in aftere the enablement of the feature a html form is generated that you could place in your web page so as to enable web to leads for your web pages.

I hope this helps.

Regards,
Anutej
Michael McGarrityMichael McGarrity
@Anutej Thanks for this. I have seen this option however would prefer to use an API if possible. I believe this can be done.
ANUTEJANUTEJ (Salesforce Developers) 
So, did you get an authentication token for doing the operation, and also can you mention the link you have followed if possible.
Michael McGarrityMichael McGarrity
@Anutej Yep, I generated a token and used it when making the request. Unfortunately the message doesn't provide more informaiton on why the New Lead Created process failed. I've had invalid session errors in the past and have created new tokens to resolve that :) 
ANUTEJANUTEJ (Salesforce Developers) 
As it is stated can you try checking if any flows on the leads are causing this error.
Michael McGarrityMichael McGarrity
Sorry, I'm a beginner here. Where would I check this? 
ANUTEJANUTEJ (Salesforce Developers) 
Gooing by the error "An unhandled fault has occurred in this flow" I was thinking if any flows or triggers that run when a new lead is created are causing the error can you try checking this.
Michael McGarrityMichael McGarrity
Where would I check this in SalesForce? Is there settings? I've had a scoot around but can't see anything definitive where processes are created.
ANUTEJANUTEJ (Salesforce Developers) 
So to find the triggers on the object you can navigate to the object from setup and see under triggers section all the triggers that are present on the object, from these triggers you can check if there are any logics that might be preventing the lead from creating or causing the error we saw.
binn fallbinn fall
Nice to see this post here and thanks for sharing this to us. The per your health is medical billing portal. It provides patients with secure access to their account. PerYourHealthy is online bill pay portal which allows users to pay their hospital bills while sitting at home. https://peryourhealth.ninja