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?
Related
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.
I am hoping to use the Telegram API to create channels and groups. Also hoping that these can be set from the API, such as Private or Public channels, etc.
Is this possible?
If you want to make a channel/group using the Telegram Bot API, then you can't.
But you can create a channel/group using the Telegram Apps API.
Please look at these Telegram API Methods: https://core.telegram.org/methods
How should I use them and by which programming language?!
Are they API and can I use them in URL?
Telegram offer two kinds of APIs for developers. The Bot API allows you to easily create programs that use Telegram messages for an interface. The Telegram API allows you to build your own customised Telegram clients.
I would assume that you are referring to the Bot API, and here is where you can see the list of languages supported with their respective wrapper created by the community, otherwise you can create your own with the API as the Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. The language supported includes PHP, Python, Java, C#, Ruby, Go, Lua, Node.js and Haskell.
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.
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 !!!