Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uchencho/okrago

Okra API wrapper in Go
https://github.com/uchencho/okrago

go golang okra

Last synced: 6 days ago
JSON representation

Okra API wrapper in Go

Awesome Lists containing this project

README

        

# OkraGo
[Okra](https://okra.ng/) API wrapper in Go

drawing

## Usage

### Install Package

```bash
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

```go
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

```go

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... ![](https://github.com/Uchencho/OkraGo/blob/master/client/okra.gif)

>**NOTE**

>Check the `client` directory to see a sample implementation