Skip to content

A partial Go SDK for interacting with the WordPress plugin Gravity Forms' API

License

Notifications You must be signed in to change notification settings

wolveix/gravityforms-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gravity Forms Go SDK

Go SDK for interacting with the Gravity Forms API v2 (WordPress plugin).

Note: this is very incomplete, as I only implemented what I needed for a quick project. PRs welcome!

Usage

You can obtain your key and secret Gravity Forms settings -> REST API page. You'll want to use Authentication (API version 2).

package main

import (
	"fmt"
	"log"
	"time"

	"github.com/wolveix/gravityforms-go"
)

func main() {
	key := "ck_your_api_key_here"
	secret := "cs_your_api_secret_here"
	service := gravityforms.New("https://your.wordpress.domain/wp-json/gf/v2", key, secret, 15*time.Second, false)

	entries, err := service.GetEntriesByFormID(1)
	if err != nil {
		log.Fatal(err)
	}

	for _, entry := range entries {
		// Access field ID 1.
		fmt.Println(entry.GetField("1"))
	}
}

License

BSD licensed. See the LICENSE file for details.

About

A partial Go SDK for interacting with the WordPress plugin Gravity Forms' API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages