I am currently running SuiteCRM 8.8.1 and I am trying to integrate a landing page form that automatically creates Leads in SuiteCRM whenever a user submits the form.
Here’s what I have done so far:
I tried using the WebToLeadCapture entryPoint, but the submission sometimes reports success without actually creating a Lead.
I verified that assigned_user_id and other required fields are correctly set, but the leads are still not consistently created.
I attempted to add a redirect_url to redirect users to a thank-you page, but it always redirects back to index.php?entryPoint=WebToLeadCapture with a blank page.
I also checked server logs, but there is no clear error related to lead creation.
What I would like to achieve:
A robust solution to reliably create Leads from a landing page form in SuiteCRM 8.8.1.
Optional: guidance on using the SuiteCRM REST API with OAuth2 to create Leads from an external form.
Best practices for logging and debugging lead creation issues in SuiteCRM 8.x.
I would greatly appreciate any guidance, example code, or configuration tips that can help me implement this correctly.
the whole topic can - unfortunately - be more complex.
What CMS are you using?
Which forms plugin?
Did you keep the generated HTML as you’ve received it from the CRM?
Is it being rendered correctly on your CMS?
If you kept the HTML, check the browser console and the network tab for what’s going on there.
If you’ve changed the HTML, it could be anything and you’d need to check your code.
The REST API is more technical to setup. However, you can create additional logic (like check for the submitted email. If a contact with this email exist, add a note. If a lead with this email exist, add a note. Otherwise, create the lead.) https://www.youtube.com/playlist?list=PLsFGHEmMr2qf-H1COXZ2P2r_Bdg2BxYKY
See above - first check whether your form code is unchanged from the original / CRM generated on. If not, look into the differences there.
Then, check the browser console and network tab to get insights into what’s happening. Afterwards, the log files.
I’m strongly thinking the V8 API is broken in the latest version. I’ve been fighting it all day! However, I did also just do a VPS server move so I’m not 100% sure the issue. It does work on an older SuiteCRM 8 version no problem, but latest v7 and latest v8 I’m having issues.
Does anyone have V8 API working on the most current version for both POST and GET?
I can come to no other conclusion that the V8 API is now broken both on the latest version of 7 and 8. I can get my token, I can lookup records but as soon as I try and POST a record (any record) I get 404 in Ver8 and 403 in version 7.
I would really appreciate if anyone can confirm working V8 API on latest 8.9.0 I wouldn’t normally be guessing but I did just move my server to a new VPS from Centos 7 to Alma Linux 8 and I can’t rule out a problem there (but I’d like to if someone can confirm one way or another).
It works fine with the exact same posts from postman on Version 8.8.0
And the answer is ModSecurity rule #920420, it must be disabled to allow for JSON POST requests. Not sure this is the best answer security wise still working on it.
Version 4 API doesn’t trigger this becasue it submits form URL encoded.
That sounds odd, the upgrade shouldn’t affect mod security (Im assuming its more likely the server move). Just to check, when you send your post data are you sending the Content-Type header (application/json) because that mod security rule should allow for application/json by default. Look for a line (in your log files) like:
[msg "Request content type is not allowed by policy"] [data "application/json"]
or the content-type header you sent and update your config for 920420 to include application/json if its not there.
@markbond thanks so much for chiming in. This is my first run in with Modsecurity.
I realized for the working install, I had disabled ModSecurity, so I obviously ran into this before. Here is how I’m sending my headers. I think its correct, is there a better way to do it?
@pstevens
Thinking about it that is the recommended way to send over Content-Type in the docs, I havent tried swapping that to application/json (from application/vnd.api+json), you can try changing those (in your call to the api where is says application/vnd.api+json change it to application/json this may also break but worth a shot) OR if you looked at the link I sent over add application/vnd.api+json to the mod security action rule config…
Please in conclusion, is there and example script that I can use to create leads via API in SuiteCRM 8.9.0 ?
WHATSAPP : +237680082153
I would appreciate if anyone Can help please
Its not as simple as just a script really, you need to configure Suite8 first (there are a few pre-requisites to set up the v8 API), then it will depend on the fields on your form, then you set up a client/secret in Suite.
In your script you authenticate, if successful you get a token, that then can be used to POST your data to the Leads module:
you would use Curl in PHP to send over the relevant authentication/data. I haven’t watched the video @BastianHammer sent over, but I’m sure its all in there.