Authentication
curl --location --request POST 'https://api.butlr.io/api/v2/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "[email protected]",
"password": "your_password"
}'package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.butlr.io/api/v2/login"
method := "POST"
payload := strings.NewReader(`{
"username": "[email protected]",
"password": "your_password"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}{
"access_token": "your_access_token",
"refresh_token": "your_refresh_token",
"id_token": "your_id_token",
"scope": "your_scopes",
"expires_in": 1000,
"token_type": "Bearer"
}How to create your client credentials


Last updated