NooB Alert NodeJs and Slack Bot build. Need Advice - node.js

Prewarning: I am a noob with development, I started doing web design when I retired from the Marines about 3 years ago. I specialized in Intelligence and Tactics, so not a computer user during that career. Fast forward to Today:
I work as an Exchange admin and migration specialist with GoDaddy, I have been through several Webdesign courses and learned a decent foundation of html/css/php however JavaScript, Nodejs, Java, Python, C++, and C# are all still things I am working on.
My issue: My lead wants to have a bot built that essentially posts messages in the #general group (I learned how to do this and actually setup a nodejs server within my test hosting server # GD and have a Joke bot running in my slack WS). The tricky part that I have been scratching my brain on is how to use an web API that GD has to monitor our call que, hold times, and agents online. I need to figure out how to get the bot to post a message regarding certain triggers automatically(exp. Hold time exceeds 10mins). I can not figure out whether to use a webhook, eventListener, or a direct bot auth'd into the GD api like my joke bot that links to chuckNorris jokes.
I appreciate all the comments truly, I have thick skin and know that I am late to the game on development. I want to build this for the experience and to integrate with slack, my end goal would be more projects to eventually become a Dev within GD.

I have a few thoughts that might help you.
Regarding these holdtimes, agents online, and call queues, think of these as events. Whenever these events occur, they should fire a payload (HTTP request) to your service that then posts messages to slack. I think you might need a slack bot token for this.
Many APIs have this functionality under webhooks. You provide them the URL to the endpoint your developing and theres usually a toggle to tell them that you want to start accepting events.
To get going on your service/bot, I'd recommend starting with learning about what these webhook event payloads will look like in terms of structure so that you can parse it.
If you have more detailed questions feel free to comment or message. Happy to help. I've written a slack bot or two.

Related

How should I build this app over communcation apps?

These days I am finding myself in the position of having to implement for one of my college courses a system that should act as a giant wrapper over many communications apps like Gmail , Facebook Messenger maybe even WhatsApp .To put it simply you should have a giant web interface where you can authorize Gmail , Messenger and use them at once when required. I am thinking of going with an REST API to manage the user's services authorized by OAuth2.Also I am thinking of using Node.JS and Express.js in the backend and React.js in the frontend. I found some sweet libraries in npm that should take care of interacting with the involved APIs(https://www.npmjs.com/package/node-gmail-api this one for instance), but I am also doubtful about this approach , for example I have no idea how to keep the use notified about its incoming mails or messages for example . I am in dire need of some expertise since I forgot to mention but I am quite the newbie in this field. To sum it up for once my question is how would you implement such an infrastructure ? Is it my approach viable or I am bound to hit some really hard to overcome obstacles?
As a college exercise, it would be a really fun experiment, so it definitely worth the time you want to put into it. However, once you want to add more features, the complexity will go up pretty fast.
Here are a couple of ideas you can think of:
It's pretty clear that your system can't do more things than the capabilities exposed by the APIs of communication apps (e.g. you can't have notifications in gmail if the API doesn't have this capability).
For that reason, you should carefully study the APIs and what functionalities they expose. They have public docs that you can check out: (Gmail API, Facebook Messanger API)
Some of the apps you want to communicate with may not have an official API (e.g. WhatsApp) - those kinds of details you definitely want to know from the start.
Based on the analysis of those APIs, you should lay out a list of requirements for your system, which can be extracted from all the APIs, for example: message notifications, file transfers, user profiles, etc.
In this way, you know exactly what capabilities your system should have, and you don't end up implementing a feature that is available only in 1 API out of 4.
Also, it would be a bit challenging to design your system from a user perspective, because the apps have different usage patterns - chat apps, where messages are coming in real-time, vs email, which is not real-time communication. That's just a detail anyway, the gist of your project is to play with those APIs.
Also, it may worth checking out the Gateway Aggergation Pattern, which is related to this project - you may want the user to send a message to multiple apps, by using a single request to your service.

Gupshup whatsapp bot estimated implementation time

Hello we are a small team looking to implement a Gupshup/Whatsapp bot.
We are wondering how long does it take for this kind of bot to setup and have in working order?
apologies if is not a technichal question, but we are not sure where else to ask.
You can ask Gupshup directly and they will be able to help better. From WhatsApp's perspective, once you create your account on Facebook Business Manager and add your WhatsApp number, it goes through an account review which typically takes around 2-3 days and once that is approved, you can start sending messages right away. However, some of these businesses like Gupshup have sandbox experiences at times that give you this experience within minutes without having to go through the entire flow.
There are two parts to the implementation. One is business registration with Whatsapp linked with vendor like Gupshup and the other is coding implementation.
These both can be achieved anywhere from one to two months depending on the use case.

I want to use Alexa API to read grocery list (for display in a web app.) Must I write a "skill"?

First my apologies if this is a dumb question, or has been asked before. I've been searching for a couple of days and can't find an answer. This usually means I'm asking a dumb question. ;-)
I have a rPi and touchscreen in my kitchen; it displays helpful things like appointments for next 7 days, weather next 7 days, news headlines, etc. It's a web app I wrote in Angular 7, and it queries a NodeJS v8 backend which I also wrote. This was a hobby project to learn Angular and Node.
The Node app performs all interactions with the outside world, using Google's Calendar API to get appointments, Yahoo Weather API, newsapi.org. All of these integrations followed the same pattern -- obtain some apikey token, and use that when invoking some API method to get the requested data in a JSON wad.
Now, I would like to also get the grocery list from my Echo. After reviewing Amazon's Alexa API documentation, it doesn't appear that I can do this the same way as the previous three integrations I did. Must I really write a "skill" for this, though I never intend to invoke it on the Echo?
And if so, could you point to a decent sample? None of the samples provided by Amazon utilize the Lists API.
Yes, you must create a skill in order to receive access_token. And then - Out of Session Interaction feature might be useful.

How do you use SetAlert with the Node.js Alex Skill SDK?

I am a ASK n00b and I want to create a skill, that when activated will send messages to the user on a schedule. Later I want to pause/resume that schedule. I am currently hacking the Node.js fact example to learn the ropes, but could use some veteran knowledge and help.
Examples are the preferable response.
Sending messages "on a schedule" is currently not supported by ASK.
This feature has been announced but there is no access yet.
https://www.engadget.com/2017/05/16/amazon-echo-push-notifications/

Create a REST-ful api in Node.js for notifications

I'm a newbie in Node.js and after doing initial learning on Node.js, I find it rather confusing to find out any best practices. My project requires to build a real-time notification system such that, when something happens at the server side or any of the connected clients, a notification can pop up at all connected clients. I couldn't find any official recommendations on what's the best approach and tools to take. I saw there are various frameworks written in Node.js seem able to do the job, but I'm hoping some one can give me some direction.
Thank you in advance.
Start with Angularfire if you want to code less.
You can create real-time apps without a backend part like so: https://github.com/tastejs/todomvc/blob/master/examples/firebase-angular/js/app.js
Note, this is a Q&A site. Ask a question next time. "Please direct me" is not allowed to ask here.

Resources