Google Reports API Push notifications / Watch Requests not being received - google-admin-sdk

A day ago I was able to use oauthplayground to successfully receive push notifications to my specified URL. Now when I send another watch request, I get a 200 ok as a response in the oauthplayground response box, but checking logs at the address (AWS API Gateway + Lambda Proxy) there is no POST message from google. No sync message or anything.
I tried to use google python client to send a watch request and same thing occurs.
body={'type':'web_hook','id':"id123",'address':'https://myaddress.com/notifications'}
response = service.activities().watch(userKey='all',applicationName='drive',body=body).execute()
I get similar response as in oauthplayground
{'kind': 'api#channel', 'id': 'some_id', 'resourceId': 'resource123', 'resourceUri': 'https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive?alt=json', 'expiration': '1594846986000'}
I am able to send a POST message through Postman to my url and I see a log of that in CloudWatch. I have tried multiple times to send watch requests but although they are 200 status ok, I am still not receiving anything at my endpoint.
Could there possibly be a limitation on how many watch requests I am able to receive? Is there a reason Google accepts the request, but is not sending it to my URL?

Related

Instagram API Webhook URL not receiving test updates

I have a Business App in dev mode and would like to test the handling of a test updates to my webhook for Instagam, but none of my test updates seem to go through.
I'm trying to use a Firebase HTTP Cloud Function to handle the verification and notification updates. Upon setting up the HTTP cloud function to respond appropriately if it's invoked with a GET or a POST request, I deployed my function to Firebase Cloud Functions.
I followed the steps in the getting started pages of using Webhooks, including configuring the Webhook Product, enabling page subscriptions, I have access to the Instagram Account and Facebook Page with admin access, but none of my test updates are going through to the webhook url, which I specified as a url to my Firebase Cloud Function.
My firebase cloud function url is
https://us-xxxx-xxxx-xxxxx.cloudfunctions.net/webhooks with the "xxxx" covering my project id details. When I first specify my url Webhook URL using "Instagram" and subscribing to "messages" I see that my function get's one GET request, but that's it. No test updates, or subscribing updates go through.
What the function currently does is respond with the hub.challenge if the request to the cloud function is a GET request, and if it's a POST request to the cloud function, I'll send 200 OK HTTPS. I have print messages along the way so I would know in my cloud function logs that something is being triggered. Any ideas?
Any suggestions on what to do to get the test webhooks to show up would be great. Thanks

Notification endpoint validation timeout when deployed to AWS

When renewing a subscription to a user's mail inbox via Microsoft Graph API, we periodically get the following error from the Microsoft Graph API (a few times a day):
{
'error': {
'code': 'ValidationError',
'message': 'Subscription validation request timed out.',
'innerError': {...}
}
}
Since the request often times succeeds, it's doesn't look like an issue on our side. There are no issues in our logs and the response time is < 1s all the time.
Instead it seems like sometimes the validation request from Microsoft Graph API doesn't even come through to our endpoint. We use an AWS API Gateway. Is Microsoft Graph API sometimes blocking requests to https://subdomain.execute-api.eu-central-1.amazonaws.com?
The above error tells that its related to subscription. So check at your subscription level something changed or not. For troubleshooting, you can try, ngrok or POSTMAN.
Looks like the issue been resolved without doing any changes in your side. If there is any issue you can check with Microsoft support.

Facebook messenger webhook did not receive any messages

I am a beginner to use Facebook Graph API. I'm trying to set up a webhook to receive and send messages (or just only send messages). I have already verified it and succeeded. Then my webhook's also received messages from test webhooks. But when I use a real account to send messages or some acctions to my page. Nothing happened in my webhook.
Here's is my simple code in my webhook.
#csrf_exempt
def WebhookPAGEAPI(request):
event_json = json.loads(request.body)
print(event_json)
return HttpResponse('OK',status=200)
I tried enable live mode but still failed.

Dialogflow caches webhook request session

I am using Dialogflow V1 with Django as the webhook target. The trouble I am having is that one of the Dialogflow servers somehow caches the cookie/sessionid and sends to the webhook every time, which is wrong.
In one of the webhook calls, my server creates a new user and logs in the user which in turn writes sessionid to the request cookie. Somehow the session/cookie will be cached by that particular DialogFlow server, and that server always sends the same sessionid/cookie to the webhook. With the sessionid, Django auto-login the request with the same user, which causes problems.
I tried the flowing ways to remove the cached cookie, but all failed
unset cookies
logout user: logout(request)
try to find a config in Dialogflow
Interestingly, only that particular server sends the wrong request, which causes our chat breaks intermittently.

How can I debug my SNS subscription?

I have created a basic SNS topic. It's a HTTP (and HTTPS) request a an endpoint on my web server. The web server is not on AWS.
The endpoint the SNS subscription points to sends me an email containing all of the headers of the request. Even if the headers are empty and email will be sent. A request of any kind will result in an email.
The endpoint will process the request regardless of the HTTP verb used (GET, POST, etc).
If I visit the endpoint in my browser, I receive an email. When I try to request a confirmation within the AWS control panel, I get nothing.
I thought this could be down to me using a Let's Encrypt SSL, but I have also tried using a HTTP endpoint, rather than HTTPS, but get the same issue.
How can I debug this? Is there any way of seeing why the request is failing?
When I need to debug http web hooks and such like this, I use this tool:
https://ngrok.com/
to setup a public endpoint that points to my local web server, that I am running in my development environment, so I can see the request come in, and depending on the language (usually .net for me), I can step thru the code as the request is received in my debugger. You'll need to temporarily point your sns topic to this endpoint.
This won't help if you are not getting the request at all, but if there is any question that the request is coming in, but its not being processed correctly, this may help.