title: gcloud pubsub - how to create watch request
body: <p>I've created a topic, subscribed to it, set publishing rights of the topic using Google's API Explorer and now need to create a watch request, as described here: <a href="https://developers.google.com/gmail/api/guides/push" rel="nofollow">https://developers.google.com/gmail/api/guides/push</a></p>
  
  <p>However, according to previous threads, you cannot do this with API Explorer and must do it directly from gcloud. I know the general form of the call is something like:</p>
  
  <pre><code>POST "https://www.googleapis.com/gmail/v1/users/me/watch"
  Content-type: application/json
  
  {
    topicName: "projects/myproject/topics/mytopic",
    labelIds: ["INBOX"],
  }
  </code></pre>
  
  <p>However, I'm not sure exactly how to implement this in node.js - what would the code look like? I've tried the following but I get a <code>function undefined</code> error:</p>
  
  <pre><code>gcloud.watch({  "topicName":
  "projects/pipedrivesekoul/topics/my-new-topic",  "labelIds": [  
  "INBOX"  ] })
  </code></pre>
  
  <p>Any help much appreciated!</p>