Skip to content

benkrig/active-campaign-sdk-go

Repository files navigation

active-campaign-sdk-go

go.dev reference Build Status codecov Go Report Card

active-campaign-sdk-go provides access to the Active Campaign API V3 for Go. Currently, it's heavily under development.

Usage

package main

import "github.com/benkrig/active-campaign-sdk-go" 

Construct a new client, then use the services available within the client to access the Active Campaign API.

package main

import (
    ac "github.com/benkrig/active-campaign-sdk-go"
    "os"
) 

func main() {
    baseURL := os.Getenv("YOUR_BASE_URL_KEY")
    token := os.Getenv("YOUR_TOKEN_KEY")

    a, err := ac.NewClient(
        &ac.ClientOpts{
            BaseUrl: baseURL, 
            Token: token,
        },
    )
    if err != nil {
        panic(err)
    }

    c := ac.CreateContactRequest{
        &ac.Contact{
            Email: "test@email.com",
            FirstName: "testf",
            LastName: "testl",
            Phone: "1234567890",
        },
    }

    contact, _, err := a.Contacts.Create(&c)
    if err != nil {
        panic(err)
    }
}

Code structure

The code structure of this package was inspired by google/go-github and andygrunwald/go-jira.

Everything is based around the Client. The Client contains various services for resources found in the Active Campaign API, like Contacts, or Automations. Each service implements actions for its respective resource(s).

Contribution

PR's are always welcome! The SDK is still being heavily developed and is missing many entities.

It doesn't matter if you are not able to write code. Creating issues or holding talks and helping other people use the SDK is contribution as well! A few examples:

  • Correct typos in the README / documentation
  • Reporting bugs
  • Implement a new feature or endpoint

If you are new to pull requests, checkout Collaborating on projects using issues and pull requests / Creating a pull request.

License

This project is released under the terms of the MIT license.

About

Active Campaign SDK for the Go programming language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages