The HubSolv API makes it easy to retrieve Client Records so that you can import the data into your own system.
To retrieve a client record in HubSolv using the API you need to make an HTTPS GET request to the following URL:
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.
Make sure you are posting using secure HTTPS and not plain HTTP to ensure your authentication details and any sensitive data are encrypted before sending.
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 seperated 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=1718debe6fcde880aa194c1116bb26fbe45755d1
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>
A GET request to the client method requires the mandatory parameter api-access-code, this is unique for each client and will have been posted to a url on your system.
api-access-code=123412341234123412341234
For a guide on how to post an access code to your system see this article:
https://hubsolv.zendesk.com/hc/en-us/articles/115002159254
If an incorrect access code is submitted, the API will return a status of "failure_get"
JSON:
{"status":"failure_get"}
XML:
<xml><status>failure_get</status></xml>
You can optionally specify a campaign id, which will return the lead source/generator/type info specific to that campaign
campaignid=1
A Succesful request to the API will return a status of "success_get" along with the client record that you are trying to retrieve:
JSON:
{"status":"success_get","client":{clientjsonobject}}
XML:
<xml><status>success_get</status><client>clientxmlstructure</client></xml>
For an API Example in PHP see this article:
https://hubsolv.zendesk.com/hc/en-us/articles/115002158114
Once you have processed this you may also want to retrieve the files associated with the client record.
To do this you would make a further call to the API method files at the URL
https://yourhubsolv.hubsolv.com/api/files/format/json/
This method takes the client id as parameter
clientid=1234
The API will respond with a list of file ids and names etc.
JSON:
{"status":"success_get","files":{filesjsonobject}}
XML:
<xml><status>success_get</status><client>filesxmlstructure</client></xml>
For an API Example in PHP see this article:
https://hubsolv.zendesk.com/hc/en-us/articles/115002159554
You can the loop through the file ids and individually retrieve the raw filedata itself by calling the API at:
https://yourhubsolv.hubsolv.com/api/file/format/json/
This method takes the file id as parameter
id=45
The API will simply respond with the rawfiledata, no JSON or XML, this data can then be written to disk.
For an API Example in PHP see this article:
Comments
0 comments
Article is closed for comments.