Skip to content

freman/genesysapi

Repository files navigation

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

About

Unofficial go sdk for Genesys / MyPureCloud

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published