How to connect mtproto telegram client without library / framework? - dart

I've been looking for a way to make a connection to the telegram api for a long time, but I didn't find anything suitable
i have read this: https://core.telegram.org/mtproto
and this: How to implement authorization using a Telegram API?
But I can't figure out how to decode and encrypt it. I've read other open-source code, but I still don't understand how to port it to the language I'm going to use.
Can you write instructions on how to use the mtproto api telegram on dart? you can write the language you prefer.
I want to use the client on dart language

Related

What are the endpoints for the new Microsoft speech service WebSocket APIs?

I want to use the new MS Speech Translation API, but I am working with Go so there is no SDK. I have a WebSockets implementation for the previous Translator Speech API, so raw WebSocket are no issue.
The documentation states that it is using WebSockets, but I was unable to find the endpoints in the documentation. Does anyone know what are the WS endpoints and their path/header parameters?
EDIT:
The documentation also says: "If you already have code that uses Bing Speech or Translator Speech via WebSockets, you can update it to use the Speech service. The WebSocket protocols are compatible, only the endpoints are different." But the new endpoints are missing.
After digging into the binaries of client SDKs I have found the Speech Translate API to be wss://<REGION>.s2s.speech.microsoft.com/speech/translation/cognitiveservices/v1
Another problem is that the WebSocket protocol is NOT compatible despite the documentation says so. Good thing is that after experiments I have found out that the new Speech Translation WS API uses the same protocol as the old Bing Speech WS API, except for URL query parameters. The Bing Speech API has a language parameter and the Speech Translate preview API has from, to, voice and features. The from and to work as expected, you can even send more languages in to (comma separated and the TTS is missing). I have not tried the voice. The features looks like doing nothing and there are always partial results, timing info and TTS.
The responses are also different, but similar to Bing Speech. They have headers and there are multiple different JSONs. Just observe the raw strings.
As this is a preview API it can change at any time.
There hasn't been substantial changes in the Websocket protocol, so the old documentation should be reasonable accurate.
The Microsoft Cognitive Services Speech SDK doesn't support GO yet, it is on the roadmap, but will not happen this calendar year.
thx
Wolfgang

Gcloud, ruby on rails, speech to text

I am trying to use Google's new speech to text api: https://cloud.google.com/speech/docs/rest-tutorial . They currently have python and node.js examples.
Unfortunately, my application is RoR. I was looking through https://github.com/GoogleCloudPlatform/gcloud-ruby , which is a gem that interacts with google cloud services (but not speech). I was hoping that I could use the two together to come out with a working solution, but my knowledge of how to use API's is limited.
Enough background, my questions are:
Does anyone know if Google is going to put out a Ruby version of the speech to text api? If yes, is there a timeline?
If I am impatient, how would I go about using their current API's. By this I mean, is there a good resource for someone to learn how to use generic API's?
The gcloud-ruby gem now supports google-cloud-speech.
To address your other questions, there are no language specific versions of the APIs themselves. They are all HTTP APIs (either REST or gRPC), so they can be used from anything that can make HTTP requests. It can be tricky to use them directly though, because of things like how authentication is handled, which is why client libraries exist for different languages.
If you want to learn more about how to use the REST APIs directly, first take a look at the doc 'Using OAuth 2.0 for Web Server Applications' to find out how to manually authenticate, which has examples for Ruby and raw HTTP/REST.

How to connect from your iOS app to a backend server? how to read, modify and fetch data to backend server?

I am new in developing iOS applications. I like to learn communication between my app and a specific back-end server(which is written in ruby). I would like to learn how to read, fetch and modify data on the back-end server? I do not have any idea where I should start? I am very welcome if you could refer me to any online resource/tutorial for this topic.
First, you have to create an API in ruby. Here is a tutorial on how to do it: https://www.codeschool.com/courses/surviving-apis-with-rails.
After that, when you are sure that your API is working correctly, you can write a service for HTTP communication. You can do it by yourself, but in my opinion, a much better option would be using the third party for that. I prefer using AFNetworking: https://github.com/AFNetworking/AFNetworking.
You can also use Heroku. First you can create your API and make some tests then implement to your server.

How do I use external auth via MVC API from iOS?

Background: I'm trying to use social oath providers to sign up and sign in on an iOS app. I believe MVC's API is the right way of doing this, but I have a few holes.
The MVC API has a GET /Account/ExternalLogin API call that returns valid external login providers, (often social) login options.
How should I use this from iOS?
Additional parts to this question:
I'm not familiar with the x-auth-token header but I think I'll need to use this in combination with the JSON payload itself. How do I use this?
Buried in the payload is a double encoded URL that I can use with something like GTM oAuth. Is this something I need to decode twice before I use it?
GTM oAuth library looks like a candidate library to use to help out.
Is ExternalLogins the right place to start? If I try and login from the app then the app needs to know client secrets and the like. Shouldn't these be managed safely in the API?
I'm happy to refine this question if it's not up to scratch before you reject it.
Thanks!

exposing part of my parse.com api to other developers via ouath 2.0

It's now trivial to create a web app that sits atop Parse.com. Now that I have this webapp, I want to expose parts of it to other developers via an oauth accesible api. So, they can develop an app that lets my site users 'give them permission' via oauth and they can now access the api.
How would I start going about doing this?
Update: After #Mubix response, I felt the following clarification would help
Currently I am accessing Parse from the server via a REST api, to get around any javascript security issues re:api keys etc. So, the api would be served of a server other than Parse. Also, the server code is in javascript / nodejs. I came across https://github.com/jaredhanson/oauth2orize which seems a likely candidate, was wondering how others are doing it and if anyone has actually gone a further step and integrated Parse access.
Hmmm .. Intereesting question!
Legal:
First of all their ToS doesn't seem to prohibit what you are trying to do but you should read it carefully before you start.
Implementation:
While parse doesn't provide feature to build your own APIs you could implement something yourself. You could treat the third party developers as users of your app. And you can use the ACL to control access.
Problems:
I don't see any way to implement oAuth entirely within parse.
How will third party apps access your API? Ideally you would like them to use a REST interface but with the parse.com REST API you won't be able to manage access to different parts of your data.
Conclusion:
It seems like too much trouble to implement the API entirely within parse. I would suggest that you write a thin API layer that takes care of auth and uses parse as the backend. You can use one of the service side libraries available for parse. eg. PHP Library, Node Parse.

Resources