Okra API wrapper in Go
go get github.com/Uchencho/OkraGo
Please see https://docs.okra.ng/ for the most up-to-date documentation for the OKRA API.
package main
import (
"fmt"
"os"
okra "github.com/Uchencho/OkraGo"
)
token := os.Getenv("OKRA_TOKEN")
const sandboxUrl = "https://api.okra.ng/sandbox/v1/"
- Initialize a client
func main () {
okraClient, err := okra.New(token, sandboxUrl)
if err != nil {
fmt.Println(err)
}
//okraClient returns an error if token or sandboxUrl is empty
body, err2 := okraClient.RetrieveTransaction()
if err != nil {
log.Println(err2)
}
fmt.Println(body.Data,"\n\n", body.StatusCode)
/*
okraClient has access to all the products OKRA API offers
*/
}
Use Product Name to Access Underlying Resources...
NOTE
Check theclient
directory to see a sample implementation