Watch request successful but not receiving any messages - gmail-api

I am trying to get Gmail push notifications by setting up a watch notification. I went through all the steps in the Push Notification guide and received a successful historyId/expiration response, but since then all's quiet. I haven't gotten any of the emails pushed through. Any ideas?

AFAIK, your application will only receive a notification message describing the change if the mailbox update matches your watch request.
With this, try to provide the topic name and any other options in your watch() request, such as labels to filter on. For example, to be notified any time a change is made to the Inbox:
POST "https://www.googleapis.com/gmail/v1/users/me/watch"
Content-type: application/json
{
topicName: "projects/myproject/topics/mytopic",
labelIds: ["INBOX"],
}
Other than that, check your Gmail notifications settings. If that still doesn’t work, try the troubleshooting steps given here.

Related

How to let users know flow has completed?

I have a flow setup in logicapps that starts with a http response, the user enters data in an excel sheet and clicks a cell/hyperlink which kicks things off. They receive a response saying the flow has started and was wondering how I could update the response once the flow has completed (either successfully or if it has failed). I’ve only created basic flows before and when googling I’m not too sure what I should be searching for but cant find any examples of what I’m trying to achieve, any ideas?
Here is one of the workarounds that might work. You need to add the response at the end of the flow. Consider my logic app as a sample. If my "Var" is yes then in response it sends Success as a response to my postman and if it is other than yes it sends Failed. Here is my logic app for your reference:-
Result:
In postman
In your case, you can use some properties to define if they got classes or not and then use the same condition connector to send the response.

axios post request not sending data after submit

I'm having troube with my post request, for some reason it doesn't seem to be sending the data its supposed to. When I submit the request I get a status 201 which is great but when I check the https://jsonplaceholder.typicode.com/posts the post I send doesn't come up.
Here is my code, I have recreated it in a sandbox.
https://codesandbox.io/s/objective-thunder-322xi?file=/src/components/FormComponent.js
Can someone help me out please, thank you?
The JSONPlaceholder guide state that you will get the correct response, but data will not be persisted.
Important: the resource will not be really updated on the server but it will be faked as if.
(source: https://jsonplaceholder.typicode.com/guide.html)
To actually save your data you need to create your own copy of the service. For this use: https://github.com/typicode/json-server.

Sending immediate response and detailed message in DialogFlow

I have a requirement of sending two messages from my chatbot. The first message will be send immediately as a response like "please wait for a moment" and the second one will be sending after an API call.
I'm using Dialogflow with Facebook messenger. Is it possible in Dialogflow send an immediate message and later send a detailed one?
No, you can't send two responses asynchronously. You could show two simple responses but those would be sent at the same time.
app.ask(app.buildRichResponse()
.addSimpleResponse('This is the first')
.addSimpleResponse('and this is the second')
);
I don't know a way to give two responses to the user at different times, but as an alternative, you can give a default response to the user along with the fulfillment response in case something goes wrong on the server side like
Bot: Something went wrong.. please check your internet connection or try again after some time.

Stop notification for google watch when token is expired

Here is the situation.
User is connected to our application and we have authenticated him with google calendar to start Watch for any event on his calendar.
We have stared getting the event notification but now User access token is expired and we are not sure when user will re-authenticated him self with our app.
But we are still getting the notifications, which we want to stop, but we are unable to stop the Watch because his access token is expired.
Is there any way we can stop the Watch with above mention scenario?
Thanks in Advance
The notifications should stop automatically in expiration time. You can choose to stop receiving notifications for a particular channel before it expires by calling the stop method at the following URI:
https://www.googleapis.com/calendar/v3/channels/stop
This method requires that you provide at least the channel’s id and the resourceId properties, as shown in the example below.
POST https://www.googleapis.com/calendar/v3/channels/stop
Authorization: Bearer {auth_token_for_current_user}
Content-Type: application/json
{
"id": "4ba78bf0-6a47-11e2-bcfd-0800200c9a66",
"resourceId": "ret08u3rv24htgh289g"
}
Check this documentation on how to stop notifications.

Responses to emails sent from the API not threaded

I noticed that when I send messages from the gmail API and then get an email response to them, the response is never threaded with the original message. Repro steps:
On gmail.com, create a new email draft to someone. Don't send it.
Go to https://developers.google.com/gmail/api/v1/reference/users/drafts/list and log in at the bottom. Enter 'me' for userId and click Execute to get the ID for your draft.
Go to https://developers.google.com/gmail/api/v1/reference/users/drafts/send, log in at the bottom, enter 'me' for userId and fill in the ID from step 2. Click Execute to send the draft.
Have the other person respond to your email.
On gmail.com, the person's response is not threaded with the original email that was sent. However, this works just fine if you send from the gmail UI instead of the API. In examining the headers, the only difference is that the API adds a second 'Received' header. I'm not sure if this is the cause of gmail not threading.
Has anyone else seen this? What is the gmail.com UI different from the API when sending a draft?
It was a bug. Barring issues rolling out the fix, should be resolved by next Weds, July 9th.

Resources