Hatchfi API Authentication
Authenticating an end-user
To authenticate an end-user with Hatchfi API, you will need the userId, API Key , and Secret Key. The API Key and Secret key were available when you first created your project in your dashboard.
When you pass in the userId along with apiKey and secretKey, you will receive a Session Token, which can be used with Hatchfi Link. If the userId is a new user who hasn't been authenticated yet, we will automatically create the user object on the backend on your behalf. If the userId was used before during a previous session, a userId object would NOT be created since the end-user already exists.
curl --request POST \
--url 'https://api.hatchfi.co/v1/auth/login' \
--header 'Content-Type: application/json' \
--header 'X-Hatchfi-Api: API_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-Secret: SECRET_KEY_FROM_DASHBOARD' \
--header 'X-Hatchfi-User-Id: USER_ID'
var axios = require("axios").default;
var options = {
method: 'POST',
url: 'https://api.hatchfi.co/v1/auth/login',
params: {'': ''},
headers: {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID,
"Content-Type': "application/json"
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
import http.client
conn = http.client.HTTPSConnection("api.hatchfi.co")
payload = ""
headers = {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID,
"Content-Type': "application/json"
}
conn.request("POST", "/v1/auth/login", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import axios from "axios";
const options = {
method: 'POST',
url: 'https://api.hatchfi.co/v1/auth/login',
headers: {
"X-Hatchfi-Api": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-Secret": API_KEY_FROM_DASHBOARD,
"X-Hatchfi-User-Id": USER_ID,
"Content-Type': "application/json"
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
Updated 5 months ago