goanda
goanda copied to clipboard
Authorization issue
Hi, after I changed the code to:
package main
import (
"log"
"os"
"github.com/awoldes/goanda"
"github.com/davecgh/go-spew/spew"
"github.com/joho/godotenv"
)
func main() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}
key := os.Getenv("OANDA_API_KEY")
accountID := os.Getenv("OANDA_ACCOUNT_ID")
oanda := goanda.NewConnection(accountID, key, false)
history := oanda.GetCandles("EUR_USD", "10", "1M")
spew.Dump(history)
}
I am getting the following error:
2018/10/23 13:46:22 /root/go_projects/src/github.com/awoldes/goanda/utils.go:22:
OANDA API Error: {"errorMessage":"Insufficient authorization to perform request."}
On route: /instruments/EUR_USD/candles?count=10&granularity=1M
Account is good, I have tried with curl and it works.