javakucoin

Kucoin Java SDK error KC-API-KEY not exists


Following their guide in usage here I couldn't get started.

The code:

    KucoinClientBuilder builder = new KucoinClientBuilder()
            .withApiKeyVersion(2)
            .withBaseUrl("https://openapi-sandbox.kucoin.com")
            .withApiKey("MyKey", "MySecret", "MyPass");
    KucoinRestClient kucoinRestClient = builder.buildRestClient();

    KucoinPrivateWSClient kucoinPrivateWSClient;

    try {
        kucoinPrivateWSClient = builder.buildPrivateWSClient();
        KucoinPublicWSClient kucoinPublicWSClient = builder.buildPublicWSClient();
    } catch (IOException e) {
        e.printStackTrace();
    }

builder.buildPrivateWSClient() throws an exception with this message:

KucoinApiException{code='400003', message='KC-API-KEY not exists'}

I copied the Api Key and Secret and pass from the api page

enter image description here

What am I missing here? Why the KC-API-KEY does not exist?


Solution

  • The "sandbox" account is different than the original account. Its domain is different and you need to register in the sandbox version of the website here