I'm making a web application using Coinbase API. You could see this API from here: https://github.com/coinbase/coinbase-java
Now i'm trying to run a simple program but i'm getting error as:
com.coinbase.api.exception.UnauthorizedException:
at com.coinbase.api.CoinbaseImpl.doHttp(CoinbaseImpl.java:1191)
at com.coinbase.api.CoinbaseImpl.get(CoinbaseImpl.java:1214)
at com.coinbase.api.CoinbaseImpl.getUser(CoinbaseImpl.java:142)
at Main.main(Main.java:12)
Here is my Program:
import com.coinbase.api.Coinbase;
import com.coinbase.api.CoinbaseBuilder;
public class Main {
public static void main(String[] args){
try {
Coinbase cb=new CoinbaseBuilder()
.withApiKey(System.getenv("My API KEY"), System.getenv("MY API SECRET"))
.build();
cb.getUser().getEmail();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Can you please, Help me?
Help, would be appreciated!!
Start by creating a new OAuth 2.0 application
Now you can call methods on coinbase similar to the ones described in the api reference. For example: