Categorygithub.com/xitonix/createsend
repositorypackage
0.0.2
Repository: https://github.com/xitonix/createsend.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

createsend

GitHub release (latest by date including pre-releases) Build Status Go Report Card codecov GitHub license GitHub issues

Campaign Monitor API wrapper in Go

Installation

go get github.com/xitonix/createsend

Example

package main

import (
    "fmt"
    "log"

    "github.com/xitonix/createsend"
)

func main() {
    client, err := createsend.New(createsend.WithAPIKey("[Your API Key]"))
    if err != nil {
        log.Fatal(err)
    }
    
    clients, err := client.Accounts().Clients()
    if err != nil {
        log.Fatal(err)
    }
    
    for _, client := range clients {
        fmt.Printf("%s: %s\n", client.ID, client.Name)
    }
}

You can also use oAuth authentication token:

client, err := createsend.New(createsend.WithOAuthToken("[OAuth Token]"))
if err != nil {
  log.Fatal(err)
}