# Quick Start

<mark style="background-color:yellow;">**This is published as part of general awareness/guidance and is not intended for production use, content is still in draft phase, please have a look at Sehhati**</mark> [<mark style="background-color:yellow;">**`roadmap`**</mark>](https://docs.sehacity.com/prod/developer-guide-1/feature-list) <mark style="background-color:yellow;">**to understand at which phase you can start using the API's!!**</mark> &#x20;

## Get your API keys

You need to register on developer portal using <mark style="color:blue;"><https://developer.sehhati.ae/register>,</mark> once registered you can get your API keys.&#x20;

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error. You can generate an API key from your Dashboard at any time.

## Use a web service integration tool

The best way to interact with our API is to use one of our Postman collections:

<https://www.postman.com/downloads/>

import collection to your space <..add collection link..>

update your API key using postman <https://learning.postman.com/docs/sending-requests/authorization/#api-key>

## Make your first request

To make your first request, send an authenticated request to the referral gateway endpoint. This will give show you our API in action.

## get referral requirements.

<mark style="color:blue;">`GET`</mark> `https://api-dev.sehhati.ae/v1/referral`

check referral requirements

#### Request Body

| Name                                          | Type   | Description                                                                                                                                                                                                                                                                                                                     |
| --------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| nationalId<mark style="color:red;">\*</mark>  | string | The national ID of patient                                                                                                                                                                                                                                                                                                      |
| gender<mark style="color:red;">\*</mark>      | string | The gender of the patient **M**: male, **F**: female, **U**: unknown                                                                                                                                                                                                                                                            |
| DoB<mark style="color:red;">\*</mark>         | string | The date of birth of patient in the format of dd/mm/yyyy                                                                                                                                                                                                                                                                        |
| serviceType<mark style="color:red;">\*</mark> | string | <p>Patient's desired medical service type for community care</p><p><em>Available values</em> : Audiology, Cardiology, Dermatology, Gastroenterology, Gynecology, MentalHealthCare, Nutrition, Ophthalmology, Optometry, Orthopedics, Podiatry, PrimaryCare, Urology, WomensHealth</p><p><em>Example</em> : Gastroenterology</p> |

{% tabs %}
{% tab title="200 executed successfully" %}

```json
{
    "name":"Ahmad Ali",
    "referralRequired":"yes"
    "timestamp":"2022-11-15T13:17:58.250Z"
}
```

{% endtab %}

{% tab title="401 Permission denied" %}
please check provided api key
{% endtab %}
{% endtabs %}

Take a look at how you might call this method using our official libraries, or via `curl`:

{% tabs %}
{% tab title="curl" %}

```shell
curl https://api-dev.sehhati.ae/v1/referral 
    -u YOUR_API_KEY:  
    -d nationalId='784-1234-9876543-2'  
    -d gender='M'  
    -d dob='22-11-1999'
    -d serviceType='MentalHealthCare'  
```

{% endtab %}

{% tab title="Node" %}

```javascript
// require the myapi module and set it up with your API key
const myapi = require('myapi')(YOUR_API_KEY);

const newReferralCheck = away myapi.referral.create({
   nationalId:'784-1234-9876543-2' , 
   gender: 'M',  
   dob: '22-11-1999',
   serviceType: 'MentalHealthCare' 
})
```

{% endtab %}

{% tab title="Python" %}

```python
// Set your API key before making the request
myapi.api_key = YOUR_API_KEY

myapi.Pet.create(
   nationalId='784-1234-9876543-2' , 
   gender= 'M',  
   dob= '22-11-1999',
   serviceType= 'MentalHealthCare' 
)
```

{% endtab %}
{% endtabs %}
