Interactions with SharpSpring
SharpSpring refers to their services as “Full-funnel Marketing & Sales Automation + CRM”, which essentially means a CRM that contains a marketing component. In more ways than one, SharpSpring is similar to the HubSpot platform — and offers standard CRM functions such as leads and forms, but they also have components like shopping cart abandonment and email marketing automation based on triggers.
Integrating SharpSpring into a website is actually fairly simple with the SharpSpring API, which offers many methods/endpoints with a standard REST API. Since VIA is primarily a PHP and JS-based agency, there is a handy third-party PHP client library available that we use. However, for the purposes of this blog article, we are going to look at the API itself and the following example:
A web application that needs to send user data to SharpSpring as a lead and then place the lead into a custom list.
To create leads, SharpSpring offers the "createLeads" method, which can take up to 500 objects (though only 250 are recommended at once). A lead is only required to have an "emailAddress" (see fields).
When creating leads, if a lead already exists, the API will return object-level errors, which won't prevent the entire creation from failing.
So for our example, our application would send our user data to SharpSpring using the "createLeads" method and passing objects that contain "emailAddress", "firstName", and "lastName".
Once the request is returned, we will add them to our list.
Similar to the lead methods, list has the "addListMembers" and "addListMembersEmailAddress" methods.
Our team prefers using the "addListMemberEmailAddress" method since users only have to pass the email address versus the lead ID, which is a little easier to manage without keeping track of it.
Adding a lead to a list is that easy, only requiring the lead email address and the list ID."
To note, this call is limited to 500 leads (there is no note on staying near 250 like the createLeads method).
Putting this all together in an example class, I have two methods, "createLeads" and "addLeadsToList". Both methods take an array of lead items, while "addLeadsToList" also takes the list ID.
As seen here, even without a library, the SharpSpring API is simple and straightforward to use.
As an added bonus, at the end of the script, we can output all the members from our list by using the "getListMembers" method. With this method, one just needs to pass the list ID.
Now you can create leads, add them to a list, and then output all the leads that belong to said list.
If you are looking for CRM integrations like SharpSpring or HubSpot into existing web platforms, our development team is ready to help. Contact VIA today and we'll get back to you soon.
Dive into the Sanity Structure Builder
By: Mark Biek on 6/13/2021
Sanity is the super fast, super customizable CMS that we're using as the backend for the new via.studio website. One of the more powerful concepts that Sanity is the Structure Builder which gives you the ability to customize how content is presented in the Sanity admin.Read More »
Wordpress to Sanity Data Script
By: Nick Stewart on 3/11/2021
One of the biggest challenges of moving from one CMS to another is getting your existing data to the new platform. In our case, we were moving our existing WordPress platform, which had been around for years, over to the Sanity.io platform.Read More »