Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/theodesp/go-calendly

go-calendly is a Go client library for accessing the Calendly API https://godoc.org/github.com/theodesp/go-calendly/calendly
https://github.com/theodesp/go-calendly

calendly go

Last synced: 1 day ago
JSON representation

go-calendly is a Go client library for accessing the Calendly API https://godoc.org/github.com/theodesp/go-calendly/calendly

Awesome Lists containing this project

README

        

# go-calendly


GoDoc


License









go-calendly is a Go client library for accessing the [Calendly API v1](https://developer.calendly.com/docs/getting-started).

go-calendly requires Go version 1.8 or greater.

## Usage ##

```go
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:

```go
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:

```go
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](https://godoc.org/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](https://github.com/theodesp/go-calendly/tree/master/examples) directory.

### Authentication ###

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](https://calendly.com/integrations)), you can use it with the library using:

```go
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)
}
```

### API docs ###

For complete usage of go-calendly, see the full [package docs](https://godoc.org/github.com/theodesp/go-calendly/calendly)

[Calendly API]: https://developer.calendly.com/docs/getting-started

**API Coverage**
- [x] Event Types
- [x] User info
- [x] Webhooks

## Roadmap ##

[Contributing](./CONTRIBUTING)

## Versioning ##

In general, go-calendly follows [semver](https://semver.org/) 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.

## License ##

This library is distributed under the Apache license found in the [LICENSE](./LICENSE)
file.