From 2ee3506bb3eea5aae23dae84accd6cbeaf5e24ce Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Mon, 23 Mar 2026 16:31:08 -0500 Subject: [PATCH] docs: add examples for apps endpoints to README.md --- README.md | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2729d51..a3d26c4 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,8 @@ You may wish to refer to the full [Onspring API documentation](https://software. ```go import ( - "fmt" - "github.com/StevanFreeborn/onspring-api-sdk-go/onspring" + "fmt" + "github.com/StevanFreeborn/onspring-api-sdk-go/onspring" ) client := onspring.NewClient("your-api-key") @@ -85,7 +85,64 @@ client := onspring.NewClient("your-api-key") err := client.Ping.Get(context.TODO()) if err == nil { - fmt.Println("Connection successful!") + fmt.Println("Connection successful!") } ``` +### Apps + +#### Get App by Id + +```go +import ( + "fmt" + "github.com/StevanFreeborn/onspring-api-sdk-go/onspring" +) + +client := onspring.NewClient("your-api-key") + +app, err := client.Apps.Get(context.TODO(), 1) +``` + +#### Get Apps by Page + +##### Retrieve a single page + +```go +import ( + "fmt" + "github.com/StevanFreeborn/onspring-api-sdk-go/onspring" +) + +client := onspring.NewClient("your-api-key") + +page, err := client.Apps.List(t.Context()) +``` + +##### Retrieve all pages + +```go +import ( + "fmt" + "github.com/StevanFreeborn/onspring-api-sdk-go/onspring" +) + +client := onspring.NewClient("your-api-key") + +for app, err := range client.Apps.ListAll(t.Context()) { + // Do stuff +} +``` + +#### Get Apps by Batch + +```go +import ( + "fmt" + "github.com/StevanFreeborn/onspring-api-sdk-go/onspring" +) + +client := onspring.NewClient("your-api-key") + +batch, err := client.Apps.GetMany(t.Context(), []int{ 1 }) +```