Install
openclaw skills install @psyb0t/go-intercomUnofficial Go client for the Intercom REST API, generated with oapi-codegen. Package intercom (github.com/psyb0t/go-intercom) provides typed methods for admins, contacts, companies, conversations, messages, articles, tickets, tags, teams and exports. Use when Go code needs Intercom customer support or workspace data, must perform a requested Intercom action, or already imports go-intercom.
openclaw skills install @psyb0t/go-intercomUnofficial, typed Go client for the Intercom REST API, in package intercom at the module root.
For install, main operations, pagination and response fields, see references/setup.md.
INTERCOM_ACCESS_TOKEN. Never hardcode, commit or log it, or print a request with its Authorization header.Intercom-Version: 2.17 to match the generated models.github.com/psyb0t/go-intercom.AGENTS.md in the repo.The examples below cover a few calls. Every operation in the spec has a generated method, and the spec's descriptions are on them as Go doc comments. Look names and fields up instead of guessing. After go get github.com/psyb0t/go-intercom, from inside your module:
go doc github.com/psyb0t/go-intercom ClientWithResponsesInterface # every endpoint method
go doc github.com/psyb0t/go-intercom IdentifyAdminParams # one method, params type or model
go doc -all github.com/psyb0t/go-intercom # the whole package
The same documentation is at https://pkg.go.dev/github.com/psyb0t/go-intercom.
Method names come from the spec's operation IDs. <OperationId>WithResponse takes the context, then the path parameters in order, then *<OperationId>Params when the operation has query or header parameters, then the request body when it has one. The JSON200 field (or JSON201 and so on, per declared status) holds the decoded body; it is nil for any other status. Reporting export operations that have no ID in the spec get names built from the HTTP method and path, such as GetExportReportingDataJobIdentifier.
import (
"context"
"net/http"
"os"
"github.com/psyb0t/go-intercom"
)
auth := intercom.WithRequestEditorFn(
func(_ context.Context, req *http.Request) error {
req.Header.Set(
"Authorization",
"Bearer "+os.Getenv("INTERCOM_ACCESS_TOKEN"),
)
req.Header.Set("Intercom-Version", "2.17")
return nil
},
)
client, err := intercom.NewClientWithResponses(
"https://api.intercom.io",
auth,
)
if err != nil {
return err
}
res, err := client.IdentifyAdminWithResponse(
ctx,
&intercom.IdentifyAdminParams{},
)
if err != nil {
return err
}
if res.JSON200 != nil {
_ = res.JSON200
}
Many response fields are pointers; check for nil before dereferencing. The error return covers transport, request construction and decoding failures. HTTP error statuses still return a response: inspect StatusCode(), Body and any typed error field. The generated client does not retry or paginate automatically.