Can I use telegram api for my commercial app? - telegram

I'm more confused how to use Telegram MTProto API, but still I want to know the truth, Can I use telegram API for mobile number verification or sending messages in my own commercial app(not related to telegram)?

Can I use telegram API for mobile number verification
I don't think so.
or sending messages in my own commercial app(not related to telegram)?
You can use Telegram Bot APIs (https://core.telegram.org/bots/api). In this case (bot service), Telegram is very open and explicitely declared to me the freedom to use Bot apps for commercial/profit purposes: see my twitter page: http://www.twitter.com/solyarisoftware !

You can also use channels for commercial messages.

your Question is Unclear
Actually, you can Create your own commercial app for yourself
to do that, you should use Telegram API, so your app is related to telegram
But it's completely not related to the telegram application you use now
for example mobile apps or windows application
Now, you write your own commercial app
you should Authenticate your phoneNumber with your own app
So, You should use telegram API for mobile number verification
Good Luck !!!

Related

Get common channels with a user using Telegram API

I'm developing a mobile application using telegram API. There is a method called getCommonChats in Telegram API documentation.
My question is does this method return common channels too? or just common groups?

telegram importContacts method not working

Could you please let me know why some of the telegram methods are not working?
for example "https://api.telegram.org/bot{token}/sendMessage" works fine and it never returns 404 error whereas https://api.telegram.org/bot{token}/importContacts and many others are not working at all.
You can find the list of all methods here and you can try them
https://core.telegram.org/methods
Thanks for responding
The Telegram platform offers two separate APIs.
Telegram Bot API which is documented at Telegram bot docs and relies on the HTTPS protocol. api.telegram.org is the entry point for this API.
Telegram Client API which is documented at Telegram core documentation and relies on the MTProto protocol.
The Telegram bot protocol is significantly more limited than the Telegram Core API, if you're looking to create a client to use your own account, you need to use the MTProto API.

Firebase Cloud Messaging (FCM) - HTTP V1 API or Legacy HTTP API?

Our goal is sending notifications to groups of devices from our backend, and only from server side is possible to know which device should receive the notification.
We've done some attempts with AppCenter because we mostly work with Xamarin iOS/Android/Forms, but now we have the doubt that it's probably better to use directly Firebase API because wider and more powerful.
I see that with new version of API (HTTP V1) is not possible to send a notification to a list of tokens, feature that was available in legacy API using registration_ids parameter (https://firebase.google.com/docs/cloud-messaging/send-message).
Device group name (legacy protocols only)
I cannot use topics because when it's time to send the communication is a server's responsibility to prepare the "mailing list" for notifications.
I was thinking to use device group messaging (https://firebase.google.com/docs/cloud-messaging/android/device-group) but these are part of the legacy api, and I'm not sure if it makes sense/it's possible to use them with new version of API.
Is an option to send a batch of 100-200-500 push notifications each one to only one token? In theory there isn't a limit to notifications which is possible to send, but I'm worried that sending too many of them I could risk to be banned.
Is it better to use legacy API? Also AppCenter (Microsoft) uses legacy API, it's evident because of how the setup works and because from AppCenter's console it's possible to send notifications to a list of tokens, feature unavailable on Firebase's console.
Another person just asked something similar but the answer was to use topics (How to send firebase notification for all user at a time?).
Got here from the link in your comment in my answer here. And just to reiterate my response there, when sending messages to multiple tokens with v1, the suggested approach now is to use Topics Messaging, since registration_ids is not supported.
Is it better to use legacy API?
v1 was described as the more secure, cross platform, future proof way of sending messages to FCM clients. More secure since it uses OAuth2 security model.
However, if your use-case is better with using the legacy API, then I suggest you go ahead with using it.
This page suggests that you should stay with the legacy API if you want to continue to use the multicast feature: https://firebase.google.com/docs/cloud-messaging/migrate-v1
Any apps that use device group messaging or multicast messaging, however, may prefer to wait for future versions of the API. HTTP v1 does not support these features of the legacy API.

How to use telegram api for creating an android application?

I am trying to build a messaging app that can authenticate users and send messages using the telegram api. But I'm having problems with finding good documentations. Can anyone help me set up the api in my app from where I can implement the methods from the Telegram api?
Any help is appreciated.
The official Telegram API documentation is quite comprehensive.
Also you can use the new Telegram feature: TDLib. It handles all the encryption, network interaction and local storage. You can find documentation for TDLib in included javadoc (html).
See also:
Existing apps' source codes
MTProto docs
RU TDLib discussion board

Automate posting messages to a Telegram channel via API

I am new to the Telegram API.
I would like to automate posting messages to my public telegram channel.
I read a few posts that with bots I can achieve this, but I am not sure if that's the best way and whether the API has an option to directly post to a channel.
I would like to get some start points on how to achieve this?
Which API should I use?
Whether I need a dev account or bot, etc?
You can use bots to send message to channels. But there is some limitation, like size of files.
create your bot, by sending message to #botfather
add the bot to your channel. stackoverflow
write a code to send message to your channel. bot api
After 1 year of working with telegram API, I wanted to update this answer for best possible ways to interact with telegram API.
For posting to channels, both telegram API and telegram bot API can post to channels.
I worked directly with both the APIs, but I found the following clients for telegram API and bot API to be faster and easier to interact with telegram.
Telegram API client:
https://github.com/LonamiWebs/Telethon
Telegram bot API:
https://github.com/python-telegram-bot/python-telegram-bot
It is impossible to read messages from Telegram channels using Telegram Bot API.
In order to be able to scrape messages from Telegram channels that you do not own, you need to develop you own Telegram client that is capable of:
Joining your desired channels by links
Forwarding messages, arriving to the channels your client is subscribed to, to your own Telegram channel
In order to develop your own Telegram client, you need to use some implementation of MTProto.
You can find a lot of implementations of MTProto on https://github.com using mtproto keyword.
A few examples of well-documented implementations:
In PHP: https://github.com/danog/MadelineProto
In Python: http://github.com/LonamiWebs/Telethon
But probably it would be an overkill to develop your own solution to this problem if the only thing you want is to have several redirections from existing Telegram channels to your own channel.
There are applications that provide such a service.
For example, there is MultiFeed Bot from telespace.me team:
https://telespace.me/apps/multifeed_bot
It allows you to setup forwarding of messages within Telegram as well as redirections to external services.

Resources