modulepackage
0.0.0-20240708045602-853dd42c31fb
Repository: https://github.com/freman/genesysapi.git
Documentation: pkg.go.dev
# README
GenesysAPI
An unofficial go SDK client library for the mypurecloud api generated from the official swagger.json
Get SDK Package
Retrieve the package from https://github.com/freman/genesysapi using go get:
go get github.com/freman/genesysapi
Use the SDK
Importing the package
import (
"github.com/freman/geneysapi/client"
)
Configuring the SDK
The SDK can be configured by setting properties on a Configuration instance. Applications using this library really can only use client credentials as I have not implemented any of the other auth schemes.
uri, err := url.Parse("https://api.mypurecloud.com.au")
if err != nil {
panic(err)
}
config := client.Config{
URL: uri,
}
err := config.AuthorizeClientCredentials(os.Getenv("GENESYS_CLOUD_CLIENT_ID"), os.Getenv("GENESYS_CLOUD_CLIENT_SECRET"))
if err != nil {
panic(err)
}
api := client.New(config)
Transport debugging
Enabling debug will trace out all http requests
api.SetDebug(true)
Generating
Prerequisites
You need to have goswagger installed but I have provided a shell script to re-generate this package from the official swagger.json
./generate.sh
Versioning
None yet
Authors
- Shannon Wynter - Initial work - Freman
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Acknowledgments
- Genesys / MyPureCloud, couldn't have done this without their swagger document.
- Stratoscale for their swagger template from which swagger-template/client is derived from
- etc