How to use mtproto telegram api using curl or postman? - telegram

I dont want to use python libraries like telethon to interact with telegram MtProto api, instead I want to hit the api directly with http-request like curl or via Postman
The reason is that, the actual api response and the library response for an api call, could be different.

If you want to start from scratch and interact with mtproto you should start with this post and also have a look at the Official docs

Related

http endpoint for webhook

good afternoon. I need to create http endpoint to which the webhook will be sent. I need to see what data will be in the webhook.
Please tell me the simple way to create an endpoint on my PC (Windows) with which I can send a webhook like this.
maybe there is some simple implementation on node.js or with using IIS.

Getting Firebase Bearer token by simple HttpCall (REST API)

I am currently facing the following situation.
Sending Firebase Messages via HttpCall via the google API endpoint:
https://fcm.googleapis.com/v1/projects/projectName/messages:send
Here we have to use OAuth2.0 with a valid Bearer Token like discussed in this question:
What Bearer token should I be using for Firebase Cloud Messaging testing?
After following these steps I was able to send Firebase Messages via the google API.
Now I would like to get the Bearer Token via a HttpCall without doing the manual step with the Playground https://developers.google.com/oauthplayground.
I cannot find any documentation on how to "Exchange authorization code for tokens" via simple HttpCall. I have no possibility to implement any code because I would like to send Firebase messages inside a "Dataverse Cloud Flow/PowerAutomate", therefore no possibility to load any external DLL (like the Firebase Admin Dll, which would implement this functionality).
I am not,looking for a solution which depends on external Dll like https://firebase.google.com/docs/database/rest/auth#authenticate_with_an_access_token or Pre-RequestScript
Any help is appreciated
What you are after is fundamentally not possible, since you can't hook the result of the bearer token into the same URL process to send messages. By the sounds of it you are unable to fetch one URL, process the results from that URL to pass onto the other which is what the REST API would do.
As such, you will need a secondary service that you can simply send messages to and it will invoke the Message and authentication for you, a bridge as you will. You can use Firebase Cloud Functions with an onRequest call or a simple express server on a Google Compute Engine instance (f1 free tier).
Then you can send your message request from your service to this bridge which will authenticate for you and send the message, it would be a fairly simple script to implement, specially with the admin-sdk.

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.

What is the web request to send a message to my telegram bot?

I tried this:
https://api.telegram.org/botXXtokenxx/sendMessage?chat_id=chat_id&text=text
But this is to send a message from the bot.
But what I need to do to send to the bot? (not from the bot)
You can either use a regular Telegram client (Telegram, Telegram X, Telegram Desktop, etc) to do it manually, or if you need an API (for whatever reason)...
You need the client API.
https://core.telegram.org/#getting-started
Once you have an API key for the client API and all that, you can send messages as explained here.
https://core.telegram.org/method/messages.sendMessage
Note that a human should be triggering this, as Telegram encourages (may be against ToS?) using a bot API for programatic access rather than the client API.

WSO2 API publisher and store issue

I need add multiple API publisher and store but I don't want to use WSO2 UI to add one by one.
How to use program to add all API publisher and store?
Thank you.
You can use the APIs published by WSO2. Take a look at their documentation.
Before you make an API calls, you to have call following APIs to receive scope & access_token:
Register your application using /register.(the client from which you will be making API call needs to be verified.)
Get access_token using /token API.

Resources