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: https://developers.google.com/gmail/api/guides/push
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:
POST "https://www.googleapis.com/gmail/v1/users/me/watch"
Content-type: application/json
{
topicName: "projects/myproject/topics/mytopic",
labelIds: ["INBOX"],
}
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 function undefined
error:
gcloud.watch({ "topicName":
"projects/pipedrivesekoul/topics/my-new-topic", "labelIds": [
"INBOX" ] })
Any help much appreciated!