go-calendly is a Go client library for accessing the Calendly API v1.
go-calendly requires Go version 1.8 or greater.
import "github.com/theodesp/go-calendly/calendly"
Construct a new Calendly client, then use the various services on the client to access different parts of the Calendly API. For example:
client := calendly.NewClient(nil)
// list all event types for current user
eventTypes, _, err := client.EventTypes.List(context.Background(), nil)
Some API methods have optional parameters that can be passed. For example:
client := calendly.NewClient(nil)
// list all event types for current user including the owner data
opt := &calendly.EventTypesOpts{Include: calendly.IncludeTypeOwner}
eventTypes, _, err := client.EventTypes.List(context.Background(), opt)
NOTE: Using the context package, one can easily
pass cancelation signals and deadlines to various services of the client for
handling a request. In case there is no context available, then context.Background()
can be used as a starting point.
For more sample code snippets, head over to the examples directory.
The go-calendly library does not directly handle authentication. Instead, when
creating a new client, pass an http.Client
that can handle authentication for
you. If you have an API access token (for example, a integrations), you can use it with the library using:
func main() {
ctx := context.Background()
// NewTokenAuthClient adds X-Token auth header
authClient := calendly.NewTokenAuthClient(&calendly.Config{ApiKey: apiKey})
client := calendly.NewClient(authClient)
resp, _, _ := client.Echo(ctx)
fmt.Println(resp)
}
For complete usage of go-calendly, see the full package docs
API Coverage
- Event Types
- User info
- Webhooks
In general, go-calendly follows semver as closely as we can for tagging releases of the package. For self-contained libraries, the application of semantic versioning is relatively straightforward and generally understood. But because go-calendly is a client library for the Calendly API, which itself changes behavior, and because we are typically pretty aggressive about implementing preview features of the Calendly API, we've adopted the following versioning policy:
- We increment the major version with any incompatible change to non-preview functionality, including changes to the exported Go API surface or behavior of the API.
- We increment the minor version with any backwards-compatible changes to functionality, as well as any changes to preview functionality in the Calendly API.
- We increment the patch version with any backwards-compatible bug fixes.
Preview functionality may take the form of entire methods or simply additional data returned from an otherwise non-preview method. Refer to the Calendly API documentation for details on preview functionality.
This library is distributed under the Apache license found in the LICENSE file.