As taken from their website, MyMedLeads.com is a "Lead Management Solution that tracks, manages and converts inquiries into paying patients". Working for a lead generation website, I had to connect to the MyMedLeads API to submit our leads to them. MyMedLeads provided the http submission code in PHP and I had to query our database information and use their code to submit it to them.
This sounded simple enough, since they were already providing us, what seemed like, the bulk of the code. At the end, the code on our side had to include:
- Calls from 3 different lead sources on our side
- Error detection, so we could monitor any issues
- Saving of tracking data, so we knew if and when we already submitted a lead
- And finally, the submission of the lead, in the format they want, through their API
Since the code from MyMedLeads was in the form of a PHP className, I created another class to perform the above tasks, them submit the lead data into their MyMedLeads client class.
This is how some of the code looked: