https://github.com/hanzoai/gochimp3
🐒 Golang client for MailChimp API 3.0.
https://github.com/hanzoai/gochimp3
api client golang golang-client mailchimp
Last synced: 7 months ago
JSON representation
🐒 Golang client for MailChimp API 3.0.
- Host: GitHub
- URL: https://github.com/hanzoai/gochimp3
- Owner: hanzoai
- License: mit
- Created: 2016-08-31T21:30:42.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-11-27T05:40:40.000Z (11 months ago)
- Last Synced: 2025-03-28T05:09:28.918Z (7 months ago)
- Topics: api, client, golang, golang-client, mailchimp
- Language: Go
- Homepage: https://github.com/zeekay/gochimp3
- Size: 73.2 KB
- Stars: 66
- Watchers: 8
- Forks: 81
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gochimp3
[![GoDoc][godoc-img]][godoc-url] [![Build Status][travis-img]][travis-url] [![Gitter chat][gitter-img]][gitter-url]## Introduction
Golang client for [MailChimp API 3.0](http://developer.mailchimp.com/documentation/mailchimp/).## Install
Install with `go get`:```bash
$ go get github.com/hanzoai/gochimp3
```## Usage
```go
package mainimport (
"fmt"
"os""github.com/hanzoai/gochimp3"
)const (
apiKey = "YOUR_API_KEY_HERE"
)func main() {
client := gochimp3.New(apiKey)// Audience ID
// https://mailchimp.com/help/find-audience-id/
listID := "7f12f9b3fz"// Fetch list
list, err := client.GetList(listID, nil)
if err != nil {
fmt.Printf("Failed to get list %s", listID)
os.Exit(1)
}// Add subscriber
req := &gochimp3.MemberRequest{
EmailAddress: "test@mail.com",
Status: "subscribed",
}if _, err := list.CreateMember(req); err != nil {
fmt.Printf("Failed to subscribe %s", req.EmailAddress)
os.Exit(1)
}
}
```### Set Timeout
``` go
client := gochimp3.New(apiKey)
client.Timeout = (5 * time.Second)
```[godoc-img]: https://godoc.org/github.com/hanzoai/gochimp3?status.svg
[godoc-url]: https://godoc.org/github.com/hanzoai/gochimp3
[travis-img]: https://img.shields.io/travis/hanzoai/gochimp3.svg
[travis-url]: https://travis-ci.org/hanzoai/gochimp3
[gitter-img]: https://badges.gitter.im/join-chat.svg
[gitter-url]: https://gitter.im/hanzoai/chat[coveralls-img]: https://coveralls.io/repos/hanzoai/gochimp3/badge.svg?branch=master&service=github
[coveralls-url]: https://coveralls.io/github/hanzoai/gochimp3?branch=master