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,350 points
981 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
• 26,740 points

Related Questions In Blockchain

+2 votes
3 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
• 69,230 points
21,881 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,350 points
1,533 views
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,668 views
+2 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
47,999 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP