Requesting an Access Token

How to authenticate with the Healthily API

You must authenticate your account using your Healthily API token and API key to obtain an Access Token.

POST https://portal.your.md/v3/login

Headers

Name

Description

Content-Type

application/json

Authorization

Your Healthily API token preceded by token,
e.g.: token a2bqy1p4cECwAKNK.Aer1q462RNjMQEmF

x-api-key

Your Healthily API key

Body

Request body schema: application/json

Name

Description

id (required)

A unique identifier for the user. If using data from a third-party system, this value should be a unique value used to identify the user in that system.

name (optional)

Name of the user. If no name is specified, the default name of Guest will be used and the user will be asked to provide a name as part of the Onboarding process.

email (optional)

Email address of user.

email_verified (optional)

Boolean value identifying if the supplied email address has been verified (by a third party). Default value is false.

delete_at

Epoch mili representation in Long format. Represent when users should be marked deleted.

Example request:

curl -X POST https://portal.your.md/v3/login \
     -H "Authorization: token a2bqy1p4cECwAKNK.Aer1q462RNjMQEmF" \
     -H "x-api-key: GrNh3vPVdckgA9mCHxdmaSM2ucaywMZ9HbRJ1qTa"\
     -H "Content-Type: application/json"\
     -d '
     	{
				"id": "a482267f-8f7d-3ce3-b026-10db486ccd2c-23rfw-qwe2323",
        		"name": "John",
				"email": "[email protected]",
				"email_verified": true,
        		"delete_at": 1647963880
			}'

Response

Response schema: application/json

Name

Description

access_token

JWT access token that must be used for all requests to the Chat endpoint (see below).

token_type

Type of the token issued. Always returns bearer.

expires_in

Expiry time of the access token in seconds.

Example response:

{
    "access_token": "eyJraWQiOi10Y2RmY2Q0OS1kM2QyJFRlZGMtYThlZi02MDY5ZjRmZWYwNmMiLCJhbFhiOiJSUzI1NiJ9.eyJzdWIiOiJ5bWRNb3JzZV9pcGp6ZlRtMmwwRlhvd01zaXBIaWlObGZmZVlLb1ZPeWZmcmhyYmJpcGlzN2pXSlkiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImRldmljZV9pZCI6InBhcnRuZXJfcmFtcF83NDdlNWE0OTlkNTYzNjI0ZGFjMjBmYTQ4NGU1ZjQwMzczYmNiODg5YmI2NzIzYzRmNTExMjgyOTY0NmFlZWI2IiwiaXNzIjoieW1kLWludGVybmFsLXNlcnZpY2UtcHJvZCIsImp0aSI6ImZiMmNjZjJiLTNlZDYtNGRkMi04NWY4LWM1NThiODUxN2U3ZCIsImlhdCI6MTY0Nzg2MjAxOSwiZXhwIjoxNjQ3ODYzODE5fQ.rLQknhj00FvBI6fAKOcutyE3kpcO9PSJI60-PGynuU-rpAGVFXGl3oJQjlmEiJdj6cm3_bGqJbZUFXiJ56eDUwJ13coLTcQwoBPwAf2tActpJnjRMJivCB_b_sialoYRH0OZkiOysmEV01L4aHq8R535UpVlY4U-wxhhD7JYhLpo-e9BRbl2EgQhuFXLzl3s4ZPCSH7yMLn5KqfJIgcCoqL2f6nduZbFVXeKCmMjh5F2hs6QdKZPbBBVZBG9an6ACncvnwgqvUC00CmzEh76znjI8Xxeq1wSmwNYpBXQS3mPjUCpJAXIk5kjCSucu0BHngHYYBU3tL4Ifcs-vhgLqQ",
    "token_type": "bearer",
    "expires_in": 1800
}