# JWT Token API

API endpoint for this API is: `https://api.makcorps.com/auth`

### Guide

Your request to our `/free` endpoint is authenticated using this JWT token. You will need your username and password in order to access this `/auth` API.

You can find your username and password in the email you might have received while signing up on our website.

|          |                             |
| -------- | --------------------------- |
| Username | Usernames used while signup |
| Password | Password used while signup  |

### Usage

You have to send a POST request to <https://api.makcorps.com/auth> along with your username and password in the JSON body. Along with this, you have to send a header where the key will be `Content-Type` and its value will be `application/json`.

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

```bash
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "username": "your_username",
    "password": "your_password"
  }' \
  https://api.makcorps.com/auth

```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://api.makcorps.com/auth"
payload = {
    "username": "your_username",
    "password": "your_password"
}

headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, data=json.dumps(payload), headers=headers)

# Print the response
print(response.json())

```

{% endtab %}

{% tab title="Nodejs" %}

```javascript
const axios = require('axios');

const url = 'https://api.makcorps.com/auth';
const payload = {
  username: 'your_username',
  password: 'your_password'
};

const headers = {
  'Content-Type': 'application/json'
};

axios.post(url, payload, { headers })
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
  });
```

{% endtab %}
{% endtabs %}

### Response

The API response will look like this.

```
{'access_token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2ODcyNjc5NzIsImlhdCI6MTY4NzI2NjE3MiwibmJmIjoxNjg3MjY2MTcyLCJpZGVudGl0eSI6MjExMH0.HqBtNdrOg21LzKY7RmylIQpdazFx5QZSVyhhYSs6qFA'}
```

{% hint style="info" %}
Now, you can use this JWT token inside your free Hotel API.&#x20;
{% endhint %}
