Get current user
package main
import (
"context"
"fmt"
"github.com/chamelaion/chamelaion-go"
"github.com/chamelaion/chamelaion-go/option"
)
func main() {
client := chamelaion.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Users.GetCurrent(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Name)
}
{
"name": "My API Token"
}{
"error": "missing authorization header"
}{
"error": "invalid authorization format"
}{
"error": "missing token"
}{
"error": "invalid token"
}{
"error": "unauthorized"
}{
"error": "internal error"
}Returns Examples
{
"name": "My API Token"
}{
"error": "missing authorization header"
}{
"error": "invalid authorization format"
}{
"error": "missing token"
}{
"error": "invalid token"
}{
"error": "unauthorized"
}{
"error": "internal error"
}