For the protection of our Clients, all FOCUS Data Endpoints are protected by means of an Integrator Assigned Bearer Token.
This Token is passed to the FOCUS Data API in the Authorization header element when making a callout to the FOCUS Data API.
When your Integration Account is setup with FOCUS, you'll be provided a API AppID and a SecurityKey. Keep these values safe as they uniquely identify YOU when interacting with the FOCUS Data API. All queries and their responses are logged against your account for security purposes.
To create your Bearer Token, use the logic below:
Compute HMAC256 Signature using secretKey and AppId:
var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secretKey)) var hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(AppId)); var signature = Convert.ToBase64String(hash); return signature;
The above results in your Signature which will be added to your AppId as below:
Bearer Token = "Bearer " <AppId>:<Signature>
So given the following:
AppId = 32cf1c2597e44c3b88b4a06967c68caf SecretKey = 6w9y$B&E)H@McQfTjWnZr4u7x!A%C*F- Signature = Compute HMAC256 using 'SecretKey' & 'AppId', Convert to Base64
You're resulting Bearer Token should look like this: