Send push notifications to audience defined by BigQuery result - node.js

Is any possibility trigger push notifications for specific group of users which is defined by BigQuery result. Is any way how to connect Firebase push notifications and BigQuery without programming some own backend service?
Use case is notify users based on retention other parameters queried from BigQuery.
I reached dead end in searching. So I am asking for help from someone skilled in google services or just way where to continue.
Thank you.

Unfortunately, for now, BigQuery doesn't provide a notification system. You could create a feature request here.
Alternately, you could do this using some scripting, I found an interesting Stackoverflow topic, about sending an e-mail to users defined in a BQ table, by using Firebase Cloud Functions.
I hope it helps.

Related

How to get User credentials in Azure chatbots

I have created a baisc QnA Bot using Azure services. But now after deploying the bot. I want it to be able to receive user mail id. So that I can give specific results on basis of the user currently using the bot.
Is it possible?
And what is the correct way of doing so.
Thanks in advance.
Please refer to the suggestion mentioned in this SO thread.
For details about how to obtain an access token for your bot, see Authenticate requests from your bot to the Bot Connector service.
Write directly to storage Azure blob transcript storage provides a specialized storage option that allows you to easily save and retrieve user conversations in the form of a recorded transcript.

configure Gmail accounts to send notifications for mailbox updates to a topic

I am new to gsuite application.
I am trying to push any new email that comes to Gmail I want to push to a topic.
Here is the link i am following:
https://developers.google.com/gmail/api/guides/push#protocol
To configure Gmail accounts to send notifications to your Cloud Pub/Sub topic, simply use your Gmail API client to call watch() on the Gmail user mailbox similar to any other Gmail API call.
I was not sure how it can be achieved? any sample running code will be great.do we need to write python scipt or do we need to write cloudfunction to configure, please advise?
This tutorial may be a good place to start: it walks you through the steps of enabling the Gmail API, authorizing access, and setting up Cloud Functions for watching for messages and processing incoming messages. The tutorial is in JavaScript, not Python, but it should give you a good idea of an architecture that can accomplish what you're interested in.
As for Python-specific resources: the Gmail API Python quickstart is a good place to get started making Gmail API calls. Once you have that working, you can try switching it to call watch().
Note that if you want to continue to get notifications on your Cloud Pub/Sub topic, you will need to call watch() at least every 7 days. One way to achieve this could be to use Cloud Scheduler to periodically trigger a Cloud Pub/Sub topic that in turn triggers a Cloud Function, which calls watch().

Chatbase API to get analytics data?

We are using Chatbase for multiple clients that we identify with a different version number.
See my previous question here: Track multiple context for the same Bot
We have a dashboard for all those clients and would like to show them their own data. A bit like Google analytics allows it.
So:
Is an API in the pipeline (I couldn't find any existing resources)
If not, in what alternative way could we get the data to present it?
We have a .csv export that is currently limited to the first 500 rows of your message variations report. It is on our roadmap to increase the scope of this report, however there is no official timeline for release.
Our recommendation for deploying an integration like you described in your message is as follows:
Have the user create a Chatbase account in order to obtain the API key
Have the user integrate their analytics on your platform by providing the API key
Send the messages from their bot to their Chatbase API
Provide the user deeplinks to the Chatbase reports from within your UI
Alternatively, you could configure your bot to send a redundant message to an internal database, or bigquery table to have access to all of your logs.
If you would like access to data you have sent to Chatbase up to this point, please contact chatbase-support#google.com and provide your bot's name and/or api key and we can provide a one-time export.

Watching hashtags with tweepy after API Update

Twitter is updating their API and by updating they mean shutting down some services such as the Streaming API.
Sadly enough, I am using these streaming APIs on my bot to watch either messages posted with a certain hashtag and messages sent by mentionning the account or commands sent by direct messages.
And I found no idea on how to migrate to the new API. Any idea ?
For now I'm using this :
mainStream = tweepy.Stream(auth=api.auth, listener= mainStreamListener())
mainStream.filter(track=[Hashtag], is_async=True)
cmdStream = tweepy.Stream(auth=api.auth, listener= cmdStreamListener())
cmdStream.userstream(is_async=True)
Only one of the two streaming APIs that you are using is currently about to be removed (user streams is being removed, filter is not, but is on Twitter's roadmap for replacement in the future).
If you are interested in how to migrate to the Account Activity API, Twitter has a migration guide here. The basic principle is that your code would need to register a webhook and subscription for the user's account activity messages, and then respond to Direct Message events (instead of the code you're currently implementing in the cmdStream section). I do not know whether the tweepy library currently has specific support for the Account Activity API.

Connect Google calendar api and api.ai

So here is what i am trying to do :
I built a bot with api.ai for my business that is hosted on my webpage and my Facebook page right now. Bot works well.
I want to push it to the next step by allowing my customers to make querys on my calendar, ask to book a specific time, see if available, if not offer other time similar, then make a booking.
I have been reading this thread and the great answer attached to it but i think my case is a bit different.
I was wondering if the bot could always have a token so every guests won't have to Auth to query the calendar ?
Obviously i am new to this, i have been reading the guide of google calendar api and api.ai but i don't really see how to do that yet. I guess there is a way to store a token somewhere and then just trigger the query with some specific intents but not to sure how.
I have also done the node.js quickstart guide of the G-calendar api, and it works fine if that helps.
Thanks for your help !
You will probably want to use a Service Account that is permitted to the calendar in question. Service Accounts are similar to regular accounts, but they are expected to do server-to-server communication only, so the method to create an auth token is a little different to keep it secure.
See https://developers.google.com/identity/protocols/OAuth2ServiceAccount for more information about using Service Accounts.
In general, you'll be using a shared secret to create and sign a JSON Web Token (JWT) you send to Google's servers. You'll get back an access token which you'll then use to call the Calendar API. The access token expires in about an hour, at which point you'll need to repeat the process.
There are libraries available to do much of this for you. For example, if you're using the node.js library https://github.com/google/google-api-nodejs-client, then it will take care of this for you (although you need to modify the key file - see the documentation for details).

Resources