Stevan Freeborn 126b027a81 fix: correct paging parameter logic and add paging options
- fix bug where `pageNumber` and `pageSize` were swapped during default
initialization in `apps.go`.
- fix bug in `pagingRequest.go` where `ToParams` mapped keys to the
incorrect struct fields.
- add `ForPageNumber` and `WithPageSize` functional options to allow
custom paging configuration.
- enhance `Apps` endpoint tests to verify that `pageNumber` and
`pageSize` query parameters are correctly passed to the API.
- add test case for verifying non-default paging options.
2026-01-15 17:03:59 -06:00
2025-12-05 10:42:32 -06:00
2025-12-05 10:42:32 -06:00
2025-12-05 10:42:32 -06:00
2026-01-12 18:14:20 -06:00

Onspring API Go SDK

⚠️ Under Construction ⚠️

The Go SDK for the Onspring API is meant to simplify development in Go for Onspring customers who want to build integrations with their Onspring instance.

Note: This is an unofficial SDK for the Onspring API. It was not built in consultation with Onspring Technologies LLC or a member of their development team.

This SDK was developed independently using Onspring's existing C# SDK, the Onspring API's swagger page, and api documentation as the starting point with the intention of making development of integrations done in Javascript with an Onspring instance quicker and more convenient.

Dependencies

Go

Requires use of Go version 1.18 or higher.

Installation

To install the Onspring API Go SDK, use the following command:

go get github.com/StevanFreeborn/onspring-api-sdk-go

API Key

In order to successfully interact with the Onspring Api you will need an API key. API keys are obtained by an Onspring user with permissions to at least Read API Keys for your instance via the following steps:

  1. Login to the Onspring instance.
  2. Navigate to Administration > Security > API Keys
  3. On the list page, add a new API Key - this will require Create permissions - or click an existing API key to view its details.
  4. Click on the Developer Information tab.
  5. Copy the X-ApiKey Header value from this tab.

Important:

  • An API Key must have a status of Enabled in order to make authorized requests.
  • Each API Key must have an assigned Role. This role controls the permissions for requests made. If the API Key used does not have sufficient permissions the requests made won't be successful.

🔒 Permission Considerations

You can think of any API Key as another user in your Onspring instance and therefore it is subject to all the same permission considerations as any other user when it comes to its ability to access data in your instance. The API Key you use needs to have all the correct permissions within your instance to access the data requested. Things to think about in this context are role security, content security, and field security.

Start Coding

Client

The most common way to use the SDK is to create a Client instance and call its methods to interact with the Onspring API. Here is an example of how to create a Client instance. You will need to provide your API key when creating the client. It is best practice to store your API key securely and not hard-code it in your source code.

import "github.com/StevanFreeborn/onspring-api-sdk-go/onspring"

client := onspring.NewClient("your-api-key")

The Client instance can be further configured by providing optional configuration settings via the ClientConfig struct. For example, you can set a custom base URL for the Onspring API if needed:

import "github.com/StevanFreeborn/onspring-api-sdk-go/onspring"

client := onspring.NewClient(
    "your-api-key",
    onspring.WithBaseURL(customURL),
)

Full API Documentation

You may wish to refer to the full Onspring API documentation when determining which values to pass as parameters to some of the OnspringClient methods. There is also a swagger page that you can use for making exploratory requests.

Examples

Connectivity

Verify connectivity

import (
    "fmt"
    "github.com/StevanFreeborn/onspring-api-sdk-go/onspring"
)

client := onspring.NewClient("your-api-key")

err := client.Ping.Get(context.TODO())

if err == nil {
    fmt.Println("Connection successful!")
}
S
Description
No description provided
Readme
261 KiB
Languages
Go 100%