API Reference
Get whoami
GET
/
whoami
JavaScript
import CompaniesSocial from '@alloy.rest/companies.social';
const client = new CompaniesSocial({
apiKey: process.env['COMPANIES_SOCIAL_API_KEY'], // This is the default and can be omitted
});
const whoami = await client.whoami.retrieve();
console.log(whoami.id);package main
import (
"context"
"fmt"
"github.com/alloy-rest/companies.social-sdk-go"
"github.com/alloy-rest/companies.social-sdk-go/option"
)
func main() {
client := companiessocial.NewClient(
option.WithAPIKey("My API Key"),
)
whoami, err := client.Whoami.Get(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", whoami.ID)
}
{
"id": "<string>",
"email": "<string>",
"name": "<string>",
"plan": "<string>",
"createdAt": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Was this page helpful?
⌘I
JavaScript
import CompaniesSocial from '@alloy.rest/companies.social';
const client = new CompaniesSocial({
apiKey: process.env['COMPANIES_SOCIAL_API_KEY'], // This is the default and can be omitted
});
const whoami = await client.whoami.retrieve();
console.log(whoami.id);package main
import (
"context"
"fmt"
"github.com/alloy-rest/companies.social-sdk-go"
"github.com/alloy-rest/companies.social-sdk-go/option"
)
func main() {
client := companiessocial.NewClient(
option.WithAPIKey("My API Key"),
)
whoami, err := client.Whoami.Get(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", whoami.ID)
}
{
"id": "<string>",
"email": "<string>",
"name": "<string>",
"plan": "<string>",
"createdAt": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}