InformlyInformly

Go SDK

Install and configure the Informly Go SDK

Installation

go get github.com/informlyco/informly-go

Initialize the Client

package main

import (
	"context"
	informly "github.com/informlyco/informly-go"
)

func main() {
	client := informly.NewClient(
		informly.WithToken("YOUR_API_TOKEN"),
	)

	ctx := context.Background()
	// Use client...
}

Configuration

OptionTypeDefaultDescription
WithTokenstringYour API token (required)
WithBaseURLstringhttp://api.informly.co/api/v1API base URL
WithHTTPClient*http.Clienthttp.DefaultClientCustom HTTP client

Error Handling

contact, err := client.Contacts.GetContact(
	ctx,
	&informly.GetContactRequest{ID: "contact-id"},
)
if err != nil {
	var apiErr *informly.APIError
	if errors.As(err, &apiErr) {
		fmt.Printf("Status: %d\n", apiErr.StatusCode)
		fmt.Printf("Message: %s\n", apiErr.Message)
	}
}

For endpoint usage examples, see the API Reference — each endpoint includes a Go tab with SDK code.

Last updated on

On this page