HMS APIs utilize HMAC-SHA1 security, which requires use of the security credentials provided by HMS at the time a contract is established. This page explains the nature and use of the security credentials. If you have not already contacted HMS and received these credentials, please check the home page for instructions.
Credentials provided by HMS consist of a Key and a Secret, both of which are required to create authenticated API calls to HMS. You should have been provided with these credentials after establishing a contract with HMS.
Key = Identifies the Credentials being used. Provided with every API call.
Secret = Used to generate the encoded Signature used to validate every API call.
Signature = Encoded string used to validate API calls.
Key = fCTYXpuGkVcnDf6JLSSbtA==
Secret = jFhVj/tC5L/FonLpKYXVxQ==
Signature = 8qrFmQbQgILzdDeQfbJTxHXeZvE=
The use of HMS Security Credentials with HMS API calls has the structure and uses the process documented below.
The security portion of an API call is structured as follows:
Timestamp value is a required value to be passed where Timestamp is the Unix epoch time in milliseconds at the time the request is submitted.Key is passed as a parameter in any API calls as key=Key.Secret is used to generate a Signature.The Signature is a base64 encoded string which is created using the HMAC-SHA1 signature algorithm, with the following inputs:
Secret - Provided in the HMS security credentialsString - Consisting of the portion of the URL following the Root to the end of the URL, including the Timestamp and Key as follows:String = /Version/Requesttimestamp=Timestamp&key=Key
For example, given:
Root = https://api.hmsonline.com
Version = v1
Request = search/masterfile?
Timestamp = 1369844777731
Key = fCTYXpuGkVcnDf6JLSSbtA==
Secret = jFhVj/tC5L/FonLpKYXVxQ==
Then
String = /v1/search/masterfile?timestamp=1369844777731&key=fCTYXpuGkVcnDf6JLSSbtA==
Generating the Signature with Secret and String as inputs yields:
Signature = 8qrFmQbQgILzdDeQfbJTxHXeZvE=
The Signature then gets appended to the original URL as follows:
Root/Version/RequestTimestamp&Key&signature=Signature
The full URL for the API call in our example should then appear as something like:
https://api.hmsonline.com/v1/search/masterfile?timestamp=1369844777731&key=fCTYXpuGkVcnDf6JLSSbtA==&signature=8qrFmQbQgILzdDeQfbJTxHXeZvE=
The Body is not required for this particular API call.