https://github.com/wolveix/gravityforms-go
A partial Go SDK for interacting with the WordPress plugin Gravity Forms' API
https://github.com/wolveix/gravityforms-go
Last synced: 4 months ago
JSON representation
A partial Go SDK for interacting with the WordPress plugin Gravity Forms' API
- Host: GitHub
- URL: https://github.com/wolveix/gravityforms-go
- Owner: wolveix
- License: gpl-3.0
- Created: 2024-08-20T19:38:24.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-01-11T19:08:09.000Z (5 months ago)
- Last Synced: 2025-01-11T20:19:23.789Z (5 months ago)
- Language: Go
- Size: 22.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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)`.```go
package mainimport (
"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](LICENSE) file for details.