how to pass arguments while creating gmail watch to push notification

Viewed 93

What i did so far:

  • Prerequisites : DONE
  • Create a topic : DONE
  • Create a subscription : DONE
  • given push endpoing url : DONE
  • Grant publish rights on your topic : DONE
  • got result while creating response : {'historyId': '714707', 'expiration': '1618824687477'}
    curl --location --request POST 'https://gmail.googleapis.com/gmail/v1/users/me/watch' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'state: object' \
--header 'Authorization: Bearer <user_token>'
\
--data-raw '{
    "attributes": {
        "key1": "value1"
    },
    "labelIds": [
        "INBOX"
    ],
    "labelFilterAction": "INCLUDE",
    "topicName": "projects/appletio/topics/axdspplet" }'

i am able to push notification response like this

{   "message": {
    "data": "eyJlbWFpbEFkZHJlc3MiOiJvbXByYWthc2hrYWx1dmFAZ21haWwuY29tIiwiaGlzdG9yeUlkIjoyNDA1OTAxfQ==",
    "messageId": "2296976769072743",
    "message_id": "2296976769072743",
    "publishTime": "2021-04-14T11:36:09.297Z",
    "publish_time": "2021-04-14T11:36:09.297Z"   },   "subscription": "projects/appletio/subscriptions/applet-sub" }

but we are unable to get attribute key and value in push notification response Is there any way to get that attribute keys and value or Is there any way to send any extra attributes/parameters while creating a watch in Gmail ANY HELP IS appreciated

1 Answers
Related