/OkraGo

Okra API wrapper in Go

Primary LanguageGo

OkraGo

Okra API wrapper in Go

drawing

Usage

Install Package

go get github.com/Uchencho/OkraGo

Documentation

Please see https://docs.okra.ng/ for the most up-to-date documentation for the OKRA API.

OKRA

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 the client directory to see a sample implementation