title: How to subscribe to the coinbase websocket?
body: <p>I have referred to the following resources:</p>
  <p><a href="https://docs.cloud.coinbase.com/exchange/docs/websocket-overview" rel="nofollow noreferrer">https://docs.cloud.coinbase.com/exchange/docs/websocket-overview</a>
  <a href="https://docs.cloud.coinbase.com/exchange/docs/websocket-channels" rel="nofollow noreferrer">https://docs.cloud.coinbase.com/exchange/docs/websocket-channels</a></p>
  <p>After I connect to <code>wss://ws-feed.exchange.coinbase.com</code>, I send a subscribe message but it is always rejected by the server.</p>
  <p><strong>Example 1:</strong></p>
  <pre><code>To coinbase:
  {
      &quot;type&quot;: &quot;subscribe&quot;,
      &quot;product_ids&quot;: [
          &quot;ETH-USD&quot;,
          &quot;ETH-EUR&quot;
      ],
      &quot;channels&quot;: [
          &quot;level2&quot;,
          &quot;heartbeat&quot;,
          {
              &quot;name&quot;: &quot;ticker&quot;,
              &quot;product_ids&quot;: [
                  &quot;ETH-BTC&quot;,
                  &quot;ETH-USD&quot;
              ]
          }
      ]
  }
  
  From coinbase: {&quot;type&quot;:&quot;error&quot;,&quot;message&quot;:&quot;channel is required&quot;}
  </code></pre>
  <p><strong>Example 2:</strong></p>
  <pre><code>To coinbase:
  {
    &quot;type&quot;: &quot;subscribe&quot;,
    &quot;channels&quot;: [{ &quot;name&quot;: &quot;heartbeat&quot;, &quot;product_ids&quot;: [&quot;ETH-EUR&quot;] }]
  }
  From coinbase: {&quot;type&quot;:&quot;error&quot;,&quot;message&quot;:&quot;channel is required&quot;}
  </code></pre>
  <p><strong>Example 3:</strong></p>
  <pre><code>To coinbase:
  {
    &quot;type&quot;: &quot;subscribe&quot;,
    &quot;channels&quot;: [{ &quot;name&quot;: &quot;status&quot;}]
  }
  From coinbase: {&quot;type&quot;:&quot;error&quot;,&quot;message&quot;:&quot;channel is required&quot;}
  </code></pre>
  <p>Basically, I cannot subscribe to any channel.</p>
  <p><strong>Question</strong>&gt; What did I do wrong here?</p>
  <p>Thank you</p>