Telegram Automation - api

I'm working on a program, it's mission is that we define some number for it (some of our mobile numbers) and it should register them in Telegram, and then gets all messages that send to that number. As you may know, the registration in Telegram needs providing a phone number and after that a validate the number by a code that is sent from Telegram.
I read Telegram API, but it was complex and with no certain example and explanation.
I need your help, Thanks.

To implement Telegram chat,
First of all, you should obtain your own api_id and api_hash as described here.
Read the document and get ideas about the terms used in the Protocol which will be useful to go further.
Create a TCP connection with Telegram Server via port 443.
Telegram uses a key called 'Authorization Key' (ie Auth key) for Encryption/Decryption and it will be derived in both Server and Client using Diffie-Hellman Algorithm by various steps. You can create this Auth key by following the steps explained here and you can also see a sample for this process here.
When you are successfully done all steps, you will finally receive 'dh_gen_ok' response from Telegram server.
Now you can send RPC queries (Telegram APIs). The list of APIs is given in this link https://core.telegram.org/methods
This is just brief points which will help to give an idea about this. To implement the whole process, you need to read the documents and get to know the flow and all its limitations. Hope it helps :)

Yes you can do this
BUT
first of all, you should write a program (class) for one number
and after that
create another instances of that class for another numbers
if you write main class (work by One phoneNumber)
it's very simple to extend you program to work by many numbers
Good Luck !!!

Related

replace Microsoft Teams SRTP Key with my own

I would like to replace the cryptographic key used in the Microsoft Teams by my own.
I am thinking about the master SRTP key, the web client or the stand alone one on Microsoft Windows.
I guess it is somewhere inside the javascript code (on the web client) ?
Is it possible, or is it protected in some way ? Where is it located ? Is there an api to get/set it ?
What you are asking is not really possible.
I think you are asking to wrong question.
If you want the audio/video streams for a meeting call, there is only one way:
Create a stateful call bot using the Cloud communications API.
The problem is getting the bot into the call to see the streams. Either the bot "starts" the call or the bot has to be invited into the call somehow. The how is up to you.
The other option is to use the Teams policy-based recording to get your bot invited into the call as part of call setup. Becareful of this option as it does come with a overhead. One to one calls will now go through the conference server to allow the third leg to be involved in the call. This I have found to have call startup overhead.

Assigning webhooks to Firebase Messaging "subscribe to topic" event

In my current project I am using the Kreait Firebase PHP SDK to send out push notifications to Android & iOS devices that have subscribed to notifications on named topics. No issues thus far. However, rather than have fixed topic names I would now like to generate topic names based on the current "condition" of the connecting device. The condition could, for example, be a geographic location.
This is not too difficult either and I have modified my app to handle this. However, in order to put the ability to have such autogenerated topics to use I need to know the topic names on my server so I can send out targeted messages via Kreait. I find Google's Firebase documentation a bit dense at times and have not been able to establish whether it is possible to assign webhooks that get called by Firebase whenever a SubscribeToTopic, UnsubscribeFromTopic event occurs.
A simple question - does FCM even offer anything like this capability? If so, any pointers to the relevant documentation would be much appreciated.
There is no public API to get a list of topic names from Firebase, nor is there a way to hook into the subscription mechanism.
Your best bet is to simply make two calls when a user subscribes to a topic: one to Firebase, and one to your own backend API that keeps a list of active topics/conditions.

Sonos API sends too short auth code in return?

Turning to all you smart people out there for help, tips and trix :)
I want to connect my NodeRed instance to the Sonos API to control my speakers in various ways. During the OAUTH process however, after logging in with my username and password for my account, the auth code being sent back to me through my redirect_uri seems to be too short? In the developers' guide the example auth code looks like this:
f10072fa6-2134-4fe1-93fd-ca5b9cffa738
where in my case, I just receive the first part up until the first dash sign. Eg.:f10072fa6
At first I ran the connection through a NetScaler, then I changed to using a Nginx Reverse Proxy thinking that the Netscaler might have truncated the URL (for some very odd reason), but the result turned out the same..
Ideas anyone?
The Authorization code you received is correct. The Authorization code format was recently changed and the documentation needs to be updated to reflect this. This question was also answered in Authorization code has different structure than example code.
Thanks!
-Mark
You can also use nodered-sonos to control your speakers. No need to setup oauth2 and using the cloud based api, if you can also have super fast local control of your speakers.
I'm using a combination of the following tools for total control of the speakers:
MQTT server of your choice in Docker (I'm using emqx)
Sonos2mqtt, my own app to connect sonos to mqtt in docker
Node red with normal mqtt in/out flows.
My Favorite flows:
Join playbar to group if group starts playing
Pause group is playbar leaves group (it leaves if I turn on the TV, that should stop the music)
Play ring sound (on all speakers) if someone presses the doorbell
Announce (text-to-speech) when the backdoor is opened

API Whatsapp to send messages from an external application

I want to implement Whatsapp
to send information from an external application. The idea is to use this
external application to send information throughout Whatsapp.
If you can help me about the terms and
conditions and if this query is possible to develop.
There is a way through which you can send WhatsApp message from your self created application. Use this link Chat API.
But it only provides 3 days trail period and after that you have to purchase it.
The process in that is, you have to register with your google account, then scan the QR code provided(which changes after every 45 seconds). and you are set to go, they will provide you the API for : PHP, Node.JS, Jquery, CURL.
One thing more you always have to keep your phone connected with the internet everytime.
Also I found a drawback in that, i.e. they also provide API to read messages, but it is too slow, as in my condition I can see my messages of yesterday but not of today.

Testing SMS code without access to a texting plan

Is there any way to test SMS messaging without having a texting plan?
There isn't any way to setup the equivalent of a mock email server for the purposes of testing an SMS service is there? Are there any other ways to accomplish the task? Perhaps setting up something like a GrandCentral account that can receive text messages?
I am looking to test SMS messages to multiple accounts without having to find multiple people with texting plans and coordinating the effort.
Google now has the answer for which I seek. With the roll-out of their new Google Voice (previously GrandCentral) they added the ability to received text messages to the phone number (which currently is free). While technically somewhat of a text plan, one could theoretically sign up for a few accounts and be able to test multiple phone numbers.
http://www.google.com/voice/
Update (Nov 2010):
Perhaps an even better way to do this now is to use either Tropo (tropo.com) or Twilio (twilio.com). Both of them offer low cost SMS messaging and Tropo is free for development. I've been using Tropo and it's very quick and easy to setup and write and code for.
It would depend on the method of how you're sending out the SMS messages. If you're using the email method (<ten digit number>#<cell provider's doman>) you can fake it with a regular email account that can be purged automatically. If you're using an actual SMS publisher your best bet would be to refactor the design so that you can test that your function gets called the expected number of times, but doesn't actually send the messages. Then when you want to test the production-ready code you actually round up a group of people and try it out.
Having a provider that doesn't charge for incoming text messaging (like US Cellular) comes in handy for situations like that.
SMS text can be done under a few different protocols. I've had success with SMPP using the Easy SMPP .NET library and this java-based SMPP server simulator. It saved me a bunch of overpriced service charges.
you can send email to their phone:
18005551212#txt.att.net (IIRC)