---
title: Accessing the API
slug: accessing-the-api
icon: {"faIcon":"fa-solid fa-file"}
createdAt: 2023-01-17T17:39:08.000Z
---

The GetHealthy Dispensary API allows practices to integrate their storefront with custom applications to create and and manage patients, recommendations and orders processed through the GetHealthy platform.

# Overview

The Dispensary API is organized around the REST protocols and and aims to offer predictable, resource oriented URLs. It generally returns JSON-encoded responses but may also return simple integer and boolean responses for some requests. Review the documentation for each endpoint and it’s possible responses.

## Authentication

The GetHealthy API uses API Keys to authenticate requests. The API key must be passed on every request using the Bearer Token authorizaton method. The API Key must be delivered via the Authorizaton header.

<u>**Example**</u>****
`Authorization: Bearer 2heoeg91vuwx52ix4tjbk2cn4ny35ji2`

### Obtaining an API Key

API keys must presently be obtained by the Practice via the GetHealthy Customer Support team.

## Constructing requests

Each practice in the GetHealthy ecosystem has its own, distinct API Url. The url consists of of a custom host name as well as a scope identifier. Both, Url and scope identifier will be communicated by the GetHealthy Customer Support team along with the API Key Request.

The **host** routes the API requests to the proper server, while the **scope** identifier automatically limits the results to the practice's scope.

### Scope modifier

Generally, the scope is identical to the subdomain. E.g. for `drlevi.gethealthy.store` the practice scope code would most likely be `drlevi`. However some practices may choose to have a custom domain - e.g. `shop.drleviwhite.com` where the scope modifier could not be determined from the hostname. This why the modifier for the scope needs to be determined by the `storeList` or `practice_config` call. The scope modifier is always equivalent to the `store_code` .

### Special ALL modifier

All dispensary api requests use the scope modifier to limit results to that particular practice scope. Additionally, some endpoints support a special `all` modifier and will return the results for the entire instance. The support of these modifiers is documented in each API call.

The `all` modifier is primarily used to give access to catalog data at the instance level.

**Pseudo API Request Template**

`https://{api_host}/rest/{scopemodifier}/{api_version}/{endpoint}`

The current API version is `V1`

**Example**

`https://drlevi.gethealthy.store/rest/drlevi/V1/dispensary/recommendation`

****

