I am following Gmail API Push notifications guide given at https://developers.google.com/gmail/api/guides/push. However, when I try to create a new watch from API explorer, it gives following response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Invalid topicName does not match projects/google.com:apisexplorerconsole/topics/*"
}
],
"code": 400,
"message": "Invalid topicName does not match projects/google.com:apisexplorerconsole/topics/*"
}
}
My request seems as follows:
POST https://www.googleapis.com/gmail/v1/users/myemailaddress/watch?key={YOUR_API_KEY}
{
"labelIds": [
"INBOX"
],
"topicName": "projects/my-project-name/topics/my-topic-name"
}
Seems like faulty validation check at Google API end. Anyone else facing this problem?