hello how are you friends and welcome to another video this time we are going to learn how to send whatsapp messages through noyes and the platform or the provider of you and me so let's start yes ok we are back thanks to the community for subscribing for sharing and For giving it a like so well the main requirements for this project is to have some basic prior knowledge of noiés if you are starting learning I do not leave you a playlist in which it takes you to the course in which I teach do not wait in a quick way a basic way and On the other hand, we also need to have an account on the Tulio platform, which is the platform or provider that will be in charge of sending WhatsApp in previous videos, we have seen how we use this same platform to send text messages and it also serves to make pre-loaded calls. calls of these types of the type the banks that already have an audio loaded at the beginning when you create an account of you and me the first thing you are going to do is I know that you must verify it with a number in this case I am going to use a number that I have for this type of tests in which we click verify and at this moment they must send us a text message we wait a few seconds and I do not know if it already arrived if it exists or I don't think it's 0 77 11 ok we send it and there we have it we already have the account verified after this you and I asked us what is the product that you intend to use here on the platform we are going to tell you that the whatsapp and what do you want to use it for? In this case I am going to say that alerts or notifications select that with minimal code that I am going to run it using the javascript programming language and I tell it that I plan to host the code in a service on a server of mine later completing this questionnaire thulium first thing is that you tell us activate your account sandbox and is the former account both note that to send messages by WhatsApp requires prior authorization by cua l whatsapp or facebook intervenes and gives you the registration or not of your whatsapp business number that time may vary, it may be days, it may be months depending on what you intend to use it for etc. etc. so that you do not wait when you have to wait this time the your development offers you a test environment and this is what it tells us at this time activate your test environment we say that ok I accept and that he takes me to the test environment to activate the lyon test environment he says hey send me a whatsapp to this number that we have on the screen I think it is always the same number with this code so what we are going to do is that in my case I already have the whatsapp of the number that I just placed a while ago so that the verification of the message arrives text and I am going to send you the following message I believe that the following message we copy paste we send we wait and there we have it message received and automatically you and I respond to my whatsapp with another message Welcome, etc. the next step, this is one, keep in mind that this is like a tulio recording, not like it shows you there step by step the things you can do after that, it tells you well, look, you can use whatsapp To remind your customers of their users of any activity or notify them of an order or verify by means of codes now you and I tell us hey send me a message to prove that the system that sent you is correct then hello friends and I give you send we wait a few seconds and Here we can see how Duilio already receives my message where the message from the and the mobile number of the person who is issuing this message says hello friends and finally now you and I tell us well, send a message to that number again and I write a I am going to send a message from you and I and even here we can start to see a bit of code using the language of your preference in our case we are going to use that of noiés but we are going to go into detail Lle at a moment in that for now we finish that indec tulio embroidered it and there we have the message messages from tulio ok once we finish this we give it here to configure your box and it is here we already have the verification in culminated and we go to the code well it The first thing we are going to do is create a nou project and for this in the video tutorial that I leave you on the card where he taught how to create a project, what we do is create a folder a directory in which I have created a file called app point and it is after this I have installed three things three packages one that is the package after that we can because it will be doing it npm npm install express also install the tulio duilio package and finally well this in this case we are not going to use it These two packages are essential to do this example example in which you will learn how to send messages how to send videos, images, audio from your not from your script we give enter we install the necessary packages rios and everything is ok now let's go to our point james and in our point 10 we are going to erase everything we have here and we are going to focus on these three lines number one we need a haiti that provides us with tulio number two we need a secret key that It provides us with duilio and in the third line what we do is the initialization of the connection with your self by calling it this way where we get this Haiti and this one continues with this we get it in the section here we go back again in general we go we go we go ok we are here we go in the settings section well it requires me to authenticate again we are going to identify ourselves again and I think this is the earth for a moment we identify ourselves again and there we have it again we do not know why he asked us for another Once we have to authenticate, this may also happen to us since you and I have many security measures to prevent if it is a robot or this type of malware, we are well located in the home in the dashboard and here we can see that we have the Haitian acom which is the one we need, we copy it, we replace it in this part and after that we can also see the token or sigpac key that we copy it and then paste it there Keep in mind that in a production project in a real project these would be environment variables or place them in a safer place but for practical purposes of this example we are going to place it here literally do not worry about copying this since it automatically After recording the video I will delete the twitter application after that we tell it that we are going to require duilio where the first argument will be the air and as the second argument the gum will be the simple one that ok now what are we going to do now in the documentation of you and me that is very well documented we are going to be able to observe a number of examples we are going to change the camera a bit we are going to get a series of examples that are quite useful and they are very easy to understand well there we have the camera located at such a point that the text covers us and we can go to the good section here we already have how to send and receive multimedia files we copy this piece of the example that is simply about 8 lines and we place them in this part we are going to change the camera again we place them in this section but we are going to erase it from the media we are going to first focus on how to send a simple message the simple message of hello welcome to your community hello welcome to the platform thank you for participate we are going to do it by using the messages method that comes from lists to my client instance, after that we say what messages are created and we tell them from where in this case as we are making use of tulio's business whatsapp number we have to place the WhatsApp business number of yours, which is the number that we previously saved, which is the one below, which is exactly the same number as we can We can see in good that we can see in the example I think it is not exactly the same maybe they changed it to make sure of this we copy it, tell us whatsapp and we put our business number in this case once again the one that your idiot provides us as an example later from that we are going to place the text that we want to be sent and here we can say hello world friends subscribe well and after this comes the name sorry comes the number of our client from our user once again as we are in sandbox mode only We can send to the number with which we are testing with which we verify our account and in my case this is the next number ok we get a little more issues now that we have left now we are simply going to run this code and we simply run this making use of 1.10 and we give it send and we can see that we have a local consul let's go to our whatsapp and here we can see that we have a message and the message that we have is not If it says hello world, subscribe in this way we are already sending a message a simple message now what happens now you want to send an image we are going to send an image so for this we are located again in the example that we have in this section which is exactly The example of sending multimedia files and the current case we have is sending an image and how the image is sent is as simple as in a property called a half url point, we are going to send the external links of our Our media source in this case is making use of an image that is in a dot-com splash and it is not seen that it will be the image of the example so to find out this we are going to run again our example from nou to pepe points 10 we go and here we have the message the image is of a cue and how we know this because we open the link and it is indeed the image of a cue well we also observe that when we do we it is important to keep in mind Note this when we send an image if we can attach the text no then here you can suddenly say welcome to my business and in the next shipment both the image and the text are attached now what happens now happens that you probably want to send a video Then we are going to look for a link of a video in this case I look for a video on the internet such as an example video in which here we can see is the planet and we delete we delete our array again and we run we attach the new url of the video and we run our script not to point 10 and here we are seeing that it already starts to take a little longer, it is because the multimedia file is logically heavier, it has more megabytes compared to the image and we can see that the video arrived we already have the video directly in our whatsapp With the difference that the videos are not attached to the text well now that it happens I also want to send an audio as we can perfectly send or use exactly of the same method to send an audio and we rerun our script to simulate the sending with the request in this case we are going to close this here because this was not and we observe that here we have the audio and the audio that it provides us is a good and perfect and once again we can see that the text is not attached to us, now surely the following questions arise I can send you to a WhatsApp group it is a question that arises is a question that arose at the time I was making use of a project of this system and in this case it is not possible to use the sending of whatsapp from sending a message to groups in whatsapp and that another question also arises the doubt that today we can through or through the programmed way know if a person saw this message or the famous blue chulito unfortunately still this does not provide it also in other cases we have the need to give some formatting to the text place bold type place recursive text among other things s to get the attention of our user so for this we can do it by following the format guide that you and I provide us where it tells us here if we want to send in bolder letters or in italics or strikethrough format etc. we are going to test it good and place a small example and we are going to run our code again, the message has already reached us and here we can see how we are making use of both bold and strikethrough and italics ok now all that is very good more questions arise one like me I make the request to you and me to approve me and whatsapp business so to speak no I want to leave the test environment for this it is important that you have to have a profile and here basically tulio is going to provide us with what would be a form, let's go Let's see if here they don't specify more if there is something a little more visually good not in your panel here in the panel the first thing you should do is obviously update your plan basically to to be charged you have to affiliate a card and after affiliate the card you have to buy buy a number and that is where you buy the current number and in this case you are going to go to the messengers section or basically the numbers with the that you are going to send and you are going to select the whatsapp the whatsapp messengers here you have to request access well this was the form I was looking for to be able to make use of the whatsapp api of production information with you and me you should send it a request and this request is a request that is really quite long where the personal data will open the business data the Portuguese that you want to give the country in which you are going to send or make use of this app and you have to have an idea of a facebook business manager this means the people who manage a fan page you must have a fan page basically the use cases in which you are going to tell them what are you going to use this for if you go use it for notifications for customer support or for two-step authentication how many messages per year who gets sent etc. etc. etc. and once the request is made it takes a while they approve you and you can go back to your panel where they go to generate or you will be able to select one of the authorized numbers to make use of whatsapp business now what happens if you do not want to use your book well we can go directly to a goal to write app whatsapp app and whatsapp as we select in the first link and here good a welcome message WhatsApp bla bla bla bla bla will tell you start and here's the important just as you and I WhatsApp WhatsApp own will request a form in which you also have to provide your facebook business daily the country the contact name etc. etc. etc. but whatsapp also tells you hey if the easiest way or the way we recommend is that You make this request through one of the 46 global providers in the world that have specialized in the wilmers whatsapp api and which are those 46 authorized providers web facebook or whatsapp provides us with a list of these and in this case here we can see infinity well I had 46 as in this case there are 66 66 companies authorized to make use of the whatsapp api here we can see the month is to live which is basically from facebook and we will also be able to see tulio which is the one we were using then in summary it is easy in is not easy, that is, it is quite formal, it takes its authorization time, currently I have done it with two clients and it has even taken a month for them to approve in which I verify and that is not all because after this you have to take into account that you cannot start a whatsapp conversation with the message that you want you cannot arrive tomorrow and say to one of your clients through whatsapp hello pedro, welcome and the day after tomorrow say goodbye You cannot start a conversation with the message that you want you have to preset some temples you have to preset the start messages with which you can start a conversation and we do that by passing you and I place this applies to you and live and It applies to the 66 providers this is a whatsapp rule as such that you cannot simply start with what you want and here it indicates a guide of what the temples would be, well let's say we achieved it, we do not have it here in a very visual way. I will show that in the code section this is basically a template, each line of this is a template template that after you sign up for thulium you will have to write your own templates referring to a welcome example in the parentheses or variable One the name of the client to your platform gives your company to tweet commerce dotcom well that temple and you are going to send it to whatsapp and it will take either a few days or a few hours before to tell you yes If you approve of that template or cancel it, you have to bear in mind that there are many rejection policies, everything that the template that is provided to send spam, all that template that lends itself to offend or violate some of its policies, they will not basically register the templates the temple greg initialization serve simply to welcome or to tell them your order number 1111 is in the shipping status basically these are the temples that carry you, they will approve you once the client responds to this message you Yes, you can follow the conversation with any type of text with any type of messages by sending multimedia files. You cannot initiate a conversation with a multimedia file. That was the case that we can see here because you and I, together, started the conversation with this temple because this It is the temple that you already have preset and once I responded to this conversation automatically if I could already send messages and I can send videos and I can Den see among other things well friends I hope this serves to clarify a little what is the use of whatsapp at the ape level It is not easy it is not complicated it is simply bureaucratic so just remind you that I am uploading videos every week give it like share and leave in the comments if you want me to open talk about some other platform or some other notification method remember that we have the videos on how to send emails to notify via emails how to send SMS text messages through tulio that it is much easier how to send push notifications directly to customers' browsers so go to the playlist and see you in a next video until next time