Hey there,
I’m struggling with receiving data through a websocket. What I did up till now was to open the channel so the connection is live but I don’t receive information about the requested item. Could somebody please point me to the right direction? I followed the instructions under Authentication and used the exact same object structure but to no avail:
Hello @marcopolocs! Thank you for taking an interest in Coinbase services. For the details regarding your concern, we will check on this for you with our team. We will get back to you once we have more information. Keep in touch!
Hello @marcopolocs. I’m not familiar with angular so I cannot help you troubleshoot your concern. But I suggest that you first try to subscribe to the WebSocket via a tool like Postman before integrating to the programming language/framework of your choice. Not sure if this will help but here are the steps I made when I subscribed to the WebSocket via Postman:
Here is the script I used in generating a signature:
Import crypto-js library var CryptoJS = require(“crypto-js”);
Create the JSON request object var req = { timestamp: Math.floor(Date.now()/1000), // seconds since Unix epoch method: pm.request.method, path: pm.request.url.getPathWithQuery(), body: (pm.request.method === ‘GET’ || !data) ? ‘’ : pm.request.body, message: undefined, secret: CryptoJS.enc.Base64.parse(pm.collectionVariables.get(“coinbase-api-secret”)), // read value from collection variable hmac: undefined, signature: undefined, };
Create the message to be signed req.message = req.timestamp + req.method + req.path + req.body;
Create HMAC using message and API secret req.hmac = CryptoJS.HmacSHA256(req.message, req.secret);
Obtain signature by converting HMAC to hexadecimal String req.signature = req.hmac.toString(CryptoJS.enc.Base64);
Set Postman request’s authentication headers for Coinbase REST API call pm.collectionVariables.set(“coinbase-api-timestamp”, req.timestamp); pm.collectionVariables.set(“coinbase-api-signature”, req.signature);
I see that you are subscribing to the ticker channel, please note that the ticker channel does not require authentication. The ticker channel provides real-time price updates every time a match happens. It shows market data, a publicly available information. You only need to authenticate to a WebSocket channel that returns private information regarding your account such as the user channel.