Authentication
In order to make authorized calls to Habitify APIs, you must obtain your API Key from client-app(mobile app, web-app). This page describes the different ways of obtaining an API Key.
1. Obtaining API Key
From Mobile Apps(iOS, Android)
From Web App
2. Using API Key
$ curl "https://api.habitify.me/habits" \
-H "Authorization: {API_KEY}" \const request = require('request');
const options = {
method: 'GET',
url: 'https://api.habitify.me/habits',
headers: { Authorization: '{API_KEY}' }
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.habitify.me/habits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "{API_KEY}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}Last updated