# README
Keap API V2 Go Library
Overview
Keap bindings for REST v2 API in golang
Features
- Lightweight: Minimalistic and easy to use.
- Placeholders: Supports placeholder replacement with values.
- Extensible: Easily extendable for more complex use cases.
Installation
To install Simple Template, use the following go get
command:
go get github.com/0x090909/keap_api
Usage
Below is an example of how to use the Keap API:
Basic Usage
- Import the library:
import "github.com/0x090909/keap_api"
- Create a new file and replace placeholders with actual values:
package main
import (
"context"
"fmt"
"github.com/0x090909/keap_api"
v2 "github.com/0x090909/keap_api/v2"
auth "github.com/microsoft/kiota-abstractions-go/authentication"
http "github.com/microsoft/kiota-http-go"
log "github.com/sirupsen/logrus"
)
func main() {
// API requires no authentication, so use the anonymous
authProvider, _ := auth.NewApiKeyAuthenticationProvider(
"YOUR_API",
"X-Keap-API-Key",
auth.HEADER_KEYLOCATION)
// Create request adapter using the net/http-based implementation
adapter, err := http.NewNetHttpRequestAdapter(authProvider)
if err != nil {
log.Fatalf("Error creating request adapter: %v\n", err)
}
if err != nil {
fmt.Printf("Error creating request adapter: %v\n", err)
}
myKeapClient := keap_api.NewKeapClient(adapter)
contacts, _ := myKeapClient.V2().Contacts().Get(context.Background(), &v2.ContactsRequestBuilderGetRequestConfiguration{})
for _, contact := range contacts.GetContacts() {
log.Info(*contact.GetGivenName())
}
}
Contributing
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
If you have any questions or suggestions, feel free to open an issue or reach out to us.
Happy coding!
# Functions
NewKeapClientV1 instantiates a new KeapClientV1 and sets the default values.
NewKeapClientV2 instantiates a new KeapClientV2 and sets the default values.
# Structs
KeapClientV1 the main entry point of the SDK, exposes the configuration and the fluent API.
KeapClientV2 the main entry point of the SDK, exposes the configuration and the fluent API.