GDAX Heartbeat Channel: Failed to subscribe error

0 votes

I'm looking at the documentation on Coinbase's Github for the GDAX API and trying to subscribe to the heartbeat channel, this is the code:

var websocket = new Gdax.WebsocketClient(
    ['BTC-USD'],
    'wss://ws-feed.gdax.com',
    {
        key: API_KEY,
        secret: API_SECRET,
        passphrase: API_PASSPHRASE,
    },
    { heartbeat: true }
)
  webSocket.on('message', data => {
    console.log(data);
  });

I get this Error:

{ 
    type: 'error',
    message: 'Failed to subscribe',
    reason: 'You need to specify at least one product ID for channel heartbeat'
}
Sep 7, 2018 in Blockchain by slayer
• 29,050 points
58 views

1 answer to this question.

0 votes

You to include "product_ids" : ["BTC-GBP"] as a field in the Json request.

Try this, it should work.

{
    "type": "subscriptions",
    "channels": [        
        {
            "name": "heartbeat",
            "product_ids": [
                "ETH-USD",
                "ETH-EUR"
            ],
        }
    ]
}

To know more, visit: https://docs.gdax.com/#subscribe

answered Sep 7, 2018 by digger
• 27,640 points

Related Questions In Blockchain

+2 votes
2 answers
0 votes
1 answer

How to fix "failed to execute script docker compose" error on windows 7?

It seems like the container is not ...READ MORE

answered Jun 27, 2018 in Blockchain by Omkar
• 67,460 points
1,357 views
0 votes
1 answer
0 votes
1 answer

How to solve "Failed to deserialize creator identity error"?

It seems like the problem is caused ...READ MORE

answered Jul 13, 2018 in Blockchain by slayer
• 29,050 points
322 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
147 views
0 votes
1 answer
0 votes
10 answers

How to solve gradle build failed error?

I migrated the project to a different ...READ MORE

answered Dec 7, 2018 in Blockchain by Rajat
6,284 views
0 votes
1 answer