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!
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"))
}
}BSD licensed. See the LICENSE file for details.