Authenticating
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/api/v1/login
Headers
| Name | Description |
|---|---|
| Content-Type | application/json |
| x-api-key | Your Healthily API key |
Body
Request body schema: application/json
| Name | Description |
|---|---|
| partner_id (required) | A unique identifier for you, generated at registration. |
| secret (required) | Your password, generated at registration |
Example request:
curl -X POST https://portal.your.md/api/v1/login \
-H "x-api-key: GrNh3vPVdckgA9mCHxdmaSM2ucaywMZ9HbRJ1qTa"\
-H "Content-Type: application/json"\
-d '
{
"partner_id": "jZtrRBkCGWDgTWZKPqrE7CM6U8oGCJbt",
"secret": "imPG3xd94D18xLksG80LRFpLKERDpfdt"
}'Response
Response schema: application/json
| Name | Description |
|---|---|
| access_token | JWT access token that must be used for all requests to the our endpoints (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": "eyJraWQiOiIzMmJiOTM5ZS1iYWYwLTRjY2ItYTZiOC04OTVkNDQ0MjAyNjMiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJNeUhlYWx0aCIsInBpZCI6ImpadHJSQmtDR1dEZ1RXWktQcXJFN0NNNlU4b0dDSmJ0IiwibGFuZ3VhZ2UiOiJlbi1VUyIsInZlcnNpb24iOiJWNSIsInNpZCI6ImNkYWFhZTdiLTYyNmEtNDliNy05MGY1LTUwOTM2MzEwZGNlNyIsImlzcyI6InltZC1pbnRlcm5hbC1zZXJ2aWNlIiwianRpIjoiNzdiMzViMTctYWM4OC00N2E5LWI5ZjMtNjBhOWViMjNjMDY2IiwiaWF0IjoxNzYxODM3MTA1LCJleHAiOjE3NjE4Mzg5NjV9.aQ_92asD3-1MjzDwgaLu6Ory0MkB0YJyRh2nHwj3EgNQ_NsbBVyNUUWQqPxf4IrV-xedjgJZGPLCt5PjhRiRh67j3e6CH5R0Ae4G1t3WmAFjIfqs9gFNOpJoGqxQv5WJteW2lEL2VqbrZzSB7QV4Hv0NbqYGvS5q7kbAWw1YhrWpnzhwauB_Pe-EUWAl9ZW7LciFKmitBwfQR3nbTn052QU08AvmmQDUuHERbyT2tWxsIrgjgMvnu3ywxseUHFYQ8J4-Xm-Je6c37ytzznVe96qIhd1KUbjy3jHjAuRRBSnA2Aa0Ukgwe62g9SQFzE9Tl7KE_l1uL9VeXUdK-PgsUw",
"token_type": "bearer",
"expires_in": 1860
}Terms
GET https://portal.your.md/api/v1/terms
First, get the terms and conditions. Make sure you present all terms to the client in a clear way and without exceptions.
Ensure that the footer_policies are always rendered in your application, easily accessible on each screen.
POST https://portal.your.md/api/v1/terms
Secondly, when the user accepts all terms, call the POST /terms endpoint with the content_version provided in the GET /terms endpoint.
Request
{
"content_version": "7abd6bb2aa9d4c9116538f7c2f78d68a4bd28321",
"all_policies_accepted": "true"
}Response
{
"login_response": {
"access_token": "eyJraWQiOiIzMmJiOTM5ZS1iYWYwLTRjY2ItYTZiOC04OTVkNDQ0MjAyNjMiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJBdml2YUhlYWx0aCIsImxlZ2FsX2RvY3VtZW50c19zdGF0dXMiOiJBUFBST1ZFRCIsImlzcyI6InltZC1pbnRlcm5hbC1zZXJ2aWNlIiwicGlkIjoiMm5BR2JGaldjMVhSWjN5ZjlRV2oyQTFYM1phS2J4b0UiLCJsYW5ndWFnZSI6ImVuLVVTIiwibGVnYWxfZG9jdW1lbnRzX3ZlcnNpb24iOiI3YWJkNmJiMmFhOWQ0YzkxMTY1MzhmN2MyZjc4ZDY4YTRiZDI4MzIxIiwiZXhwIjoxNzY4NTY5NTcyLCJ2ZXJzaW9uIjoiVjUiLCJpYXQiOjE3Njg1Njc3MTIsImp0aSI6Ijc5NTU5MmUwLWI3MDEtNDlhYi05MjQ3LTBhYTg0MmJkNDMwOCIsInNpZCI6IjVlODNhNTM2LTVkMDYtNDMzNi04MTkxLTcxMjA3MWRmODM0ZCJ9.M4u4Al4BwOTI1l99NuPgSgilIS9906HUFxdVlKsF6_2kkUESexb3hVrJcKYhzqnxzK4FyrJwD2hbifoeIecD6dnD4Hfn4cHk1vBFLjcfiNjju6_NiaXKPioRGfxs3Nar_RDrWJtt8kXlPnVPwMame3lFkN7HXvbPfCGry2BG4vB0pp5JMxvZ9ziCtODRULEFjVtIQf-eoVucaCS12AxmlyA2aZqNtN_5_wq29uDiaiip0Aqnz5GirV0P7egx2aIgUXfywlvLZYzO6yqakGRLNB8cspOr_dOsnSUBUdfkNp4roTmcYb9UFZrBbYkZ4COXZC3li80mKHvelpij8IU5tg",
"token_type": "bearer",
"expires_in": 1860
},
"onboarding_response": {
... omitted ...
}
}The response contains the upgraded JTW token which can then be used for the remainder of the consultation.
Updated about 12 hours ago
