Does modx come with Curl or Rest functions in order for me to send data directly to a 3rd party application (i.e CRM)
What im trying to do is: Prevent Spamming using honeypot and a bespoke way of (re inventing the wheel) blocking spammers.
What I would like to happen is:
using formitdb/honey pot, create a record in a database from a number of forms we use on the site.
sanitize the data from the php array into the correct format ready for the 3rd party ($_POST variable) by create a new PHP array.
convert the PHP array to XML.
Send the XML data to 3rd party using Curl.
In the api does modx come with any Curl commands for sending data to 3rd party?
what do you think would be the best way to go about it. I am familiar with PHP using Curl from other MVC frameworks
-
☆ A M B ☆
- 24,524 Posts
There's certainly nothing preventing a snippet from using cURL, but I'm not aware of any specific API function for doing such a thing. However, there is a new modRestService class and controller, but I think that's more for providing services on request. I don't know that much about it, so I may well be (actually I probably am) wrong...
http://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/developing-rest-servers
hi
thanks for your quick response. it looks like that the url is for server side (allowing 3rd party to get access to my api), and not client side (sending data to 3rd party crm)
i may just have to create a snippet and call the snippet from the formitdb block of code.