About
This article will teach you how to insert a record into hubsolv using the API we provide.
Endpoint
https://yourhubsolv.hubsolv.com/api/client/format/json/
Replace yourhubsolv with the subdomain you use to log into HubSolv.
The last part of the URL specifies what format you would like the API to respond in. You can choose either json or xml.
Type
HTTPS POST
Description
The API requires you send a username and password using HTTP Basic Authentication when posting or making requests as an additional layer of security. You can find your username and password by navigating to Settings > API Settings in your HubSolv. This is transmitted in the header envelope of your request in the format Authorization: Basic yourusername:yourpassword where the username and password separated by a colon are base64 encoded.
Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l
An incorrect username and password will return a status of false along with an error message:
JSON:
{"status":false,"error":"Not authorized"}
XML:
<xml><status>0</status><error>Not authorized</error></xml>
The Hubsolv API accepts input as Key Value pairs.
You are required to post your HubSolv API key as a means of authentication.
This can be found by navigating to Settings > API Settings in your HubSolv.
HUBSOLV-API-KEY=1718debe6fcde8124494c1116bb26fbe45755d1
An incorrect API key will return a status of false along with an error message:
JSON:
{"status":false,"error":"Invalid API Key."}
XML:
<xml><status>0</status><error>Invalid API Key.</error></xml>
Fields
You can optionally specify a campaign and status, if these aren't sent in the request HubSolv will create the client in the default campaign with the default status.
campaignid=1 statusid=1
You can post any of the core values listed here to the API, most commonly it is likely you would be capturing just basic details in order to encourage your potential leads to complete your form.
An example of common parameters to post might look like:
firstname=Joe lastname=Smith email=joe.smith@someemailprovider.com phone_mobile=07777123456
Additionally you can also use the lead_source, lead_generator & lead_type fields for capturing where you leads have come from so that you can report on these fields, or trigger different actions based on where your lead came from.
lead_source=debt_form lead_generator=yourleadgenwebsite.com lead_type=website_lead
If there are any fields you want to post that are not a core value in HubSolv you can post it and it will be captured as a custom field and displayed on the right hand of the client record under the "LEAD INFORMATION" section.
anything_you_want=pass_any_custom_parameters and_another=pass_any_custom_parameters
Finally you can also create a note in the client record for internal use by passing the field
note=some%20internal%20information
A Succesful post to the API will return a status of "success_post" along with the id of the client record that has been created:
JSON:
{"status":"success_post","id":26}
XML:
<xml><status>success_post</status><id>26</id></xml>
Disclaimer:
We do not accept JSON in the body of the request, all requests must be normal form posts, key value pairs.
Comments
0 comments
Article is closed for comments.