ToolHound API Call

Updated by Dean Perry

ToolHound provides a full RESTful API. The current API can be found by appending /api-docs to the URL you use to log into ToolHound. For example, https://www.myserver.com/api-docs for On Premise or for Cloud at https://www.mytoolhound.com/api-docs

Watch this video for a walkthrough of using the web API.
More information, including many samples, is available from our password-protected download link in the Documentation folder. The download link and password are included in each update notice or can be obtained by contacting Support.

Getting a Token

In order to make API calls you need to obtain a token.

To get a token:

POST /connect/token

Host: localhost:44370

Content-Type: application/x-www-form-urlencoded

grant_type=password&username=admin&password=12345678&company=th1&timezoneoffset=420&timezone=America/New_York&source=X

Where:

grant_type: needs to always be “password”

username: a valid user name in the application

password: the password for the given username

company: company alias which corresponds to the database name

timezoneoffset: an integer value indication how many minutes off GMT the local time zone is

timezone: an IANA time zone identifier- for example, America/New_York. This is new for versions 6.2022.10.27 and higher.

source:  a character value indicating what application is accessing the system. This is displayed on many records as the source. It is not currently displayed on all records.

Returns:

{

    "token_type": "Bearer",

    "access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IlhORzBWTVBYWURDTjEzTlBUMVRJSzBPRktDUEpZVlJOMEJSRklYVDciLCJ0eXAiOiJKV1QifQ.eyJzdWIiOiI3MGI0Yzk3MC0xYmZhLTQ4YWEtYmI1Ni01OWU3ODRlNjU4ZmYiLCJjb21wYW55IjoidGgxIiwidGltZXpvbmVvZmZzZXQiOiI0MjAiLCJ1c2VyaWQiOiIxMDAwMDAiLCJsb2NhbGVpZCI6IkVOLVVTIiwibG9jYXRpb25pZCI6IjAiLCJlbnRpdHlpZCI6IjAiLCJzb3VyY2UiOiJYIiwidG9rZW5fdXNhZ2UiOiJhY2Nlc3NfdG9rZW4iLCJqdGkiOiI5MTQzOGYwOS0zYzAyLTRlZDQtOTVhZi02N2QwMGNlZWFjYTkiLCJhdWQiOiJodHRwczovL2xvY2FsaG9zdDo0NDM3MC8iLCJuYmYiOjE1ODMyNTEwODksImV4cCI6MTU4MzQyMzg4OSwiaWF0IjoxNTgzMjUxMDg5LCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo0NDM3MC8ifQ.fFQ2tXiOvQNYRYurSLIVWxnF0yKw6MBk4znXlljBj_DmiwzHmaf_OrfTG_GqXe1_r2zL2HXBgmrNKq9x33YlBPjZV3wKLDJIWC4ks61MksoymGIDTJCUzBuK5CyKhoMJf-8CPb1fFzMpGhPU8uL2oSm8d_THJmb8FHmIkpCXlLMxL7op_zMJp_Ak2B-BKh6iKO9VqHj_f61OU3UsuR8neyLa4DNhgKrp6bnYK3kuW1OyboEwhnYNDi12jF_DVimsj_-e1kKnsVIDqzlCFL311cVYOy39YMbWoEutSqmW8fT2T1KrV4t4z1p9Z6PjRREeKoNw_wdZFFFRaz70qHvbAQ",

    "expires_in": 172800

}

The token value needs to be passed in subsequent calls.  The expiry value is in seconds, so currently set to 48 hours.

Employer Import Example

Here is a call to the EmployerImport API which will add a new Employer record, if it doesn't already exists, or updates an existing record:

POST /api/EmployerImport/ImportRow

Host: localhost:44370

Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IlhORzBWTVBYWURDTjEzTlBUMVRJSzBPRktDUEpZVlJOMEJSRklYVDciLCJ0eXAiOiJKV1QifQ.eyJzdWIiOiI3MGI0Yzk3MC0xYmZhLTQ4YWEtYmI1Ni01OWU3ODRlNjU4ZmYiLCJjb21wYW55IjoidGgxIiwidGltZXpvbmVvZmZzZXQiOiI0MjAiLCJ1c2VyaWQiOiIxMDAwMDAiLCJsb2NhbGVpZCI6IkVOLVVTIiwibG9jYXRpb25pZCI6IjAiLCJlbnRpdHlpZCI6IjAiLCJzb3VyY2UiOiJYIiwidG9rZW5fdXNhZ2UiOiJhY2Nlc3NfdG9rZW4iLCJqdGkiOiI5MTQzOGYwOS0zYzAyLTRlZDQtOTVhZi02N2QwMGNlZWFjYTkiLCJhdWQiOiJodHRwczovL2xvY2FsaG9zdDo0NDM3MC8iLCJuYmYiOjE1ODMyNTEwODksImV4cCI6MTU4MzQyMzg4OSwiaWF0IjoxNTgzMjUxMDg5LCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo0NDM3MC8ifQ.fFQ2tXiOvQNYRYurSLIVWxnF0yKw6MBk4znXlljBj_DmiwzHmaf_OrfTG_GqXe1_r2zL2HXBgmrNKq9x33YlBPjZV3wKLDJIWC4ks61MksoymGIDTJCUzBuK5CyKhoMJf-8CPb1fFzMpGhPU8uL2oSm8d_THJmb8FHmIkpCXlLMxL7op_zMJp_Ak2B-BKh6iKO9VqHj_f61OU3UsuR8neyLa4DNhgKrp6bnYK3kuW1OyboEwhnYNDi12jF_DVimsj_-e1kKnsVIDqzlCFL311cVYOy39YMbWoEutSqmW8fT2T1KrV4t4z1p9Z6PjRREeKoNw_wdZFFFRaz70qHvbAQ

Content-Type: application/json

{

"EmployerID": "2282",

"OrganizationName": "Edmonton LRT",

"Visibility": "95462",

"Address": "",

"City": "Edmonton",

"CountryCode": "",

"StateProv": "Alberta",

"PostCode": "",

"Contact": "Bob Jones",

"ContactTitle": "EQ Mgr",

"Telephone": "",

"MobilePhone": "",

"HomePhone": "",

"Fax": "",

"Email": "toolhound@toolhound.com",

"Active": "Y",

"UserField1": "Yes",

"UserField2": "Prj CA LRT",

"UserField3": "Tool Hound"

}

​Copyright © 2020-2024 ToolHound Inc. All Rights Reserved.


How did we do?