👨💻
JWT Token API
If you are using our trial pack then you will need this token in order to access the /free endpoint.
API endpoint for this API is:
https://api.makcorps.com/auth
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 |
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
.Curl
Python
Nodejs
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"username": "your_username",
"password": "your_password"
}' \
https://api.makcorps.com/auth
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())
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);
});
The API response will look like this.
{'access_token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2ODcyNjc5NzIsImlhdCI6MTY4NzI2NjE3MiwibmJmIjoxNjg3MjY2MTcyLCJpZGVudGl0eSI6MjExMH0.HqBtNdrOg21LzKY7RmylIQpdazFx5QZSVyhhYSs6qFA'}
Now, you can use this JWT token inside your free Hotel API.
Last modified 3mo ago