Keap bindings for REST v2 API in golang
- Lightweight: Minimalistic and easy to use.
- Placeholders: Supports placeholder replacement with values.
- Extensible: Easily extendable for more complex use cases.
To install Simple Template, use the following go get
command:
go get github.com/0x090909/keap_api
Below is an example of how to use the Keap API:
- 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())
}
}
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.
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or suggestions, feel free to open an issue or reach out to us.
Happy coding!