Authentication

All of our REST APIs require authentication for access.

There are two ways to get authenticated: OAuth2 and HTTP Basic Authentication. We recommend using OAuth2 but will discuss both supported ways here.

OAuth2

To get authenticated with OAuth2, you must first retrieve an access token. Once you have successfully retrieved your access token, you can pass that in with your API requests to be authenticated. Our access tokens are valid for one day, please regenerate access tokens as needed.

You can generate an access token by making a POST to https://healthharbor.co/api/v0/auth/token. This POST request requires you to pass in your username and password as multi-part form data. Your username and password should have been provided to you by the Health Harbor team. If you do not have one, please reach out to us on Slack or email.

It is important that your credentials are passed in as multi-part form data per OAuth2 specifications.

A successful response will provide an access token and token type:

You can now use that access token to authenticate all your API requests!

HTTP Basic Authentication

Another way to get authenticated is HTTP Basic Authentication. This requires you to send an Authorization header of your Project ID and API Key also known as your username and password respectively. This should be supported in almost all HTTP clients.

These should have been provided to you by the Health Harbor team. If you do not have one, please reach out to us on Slack or email.