how do I start wiriting a API to my router

I want to write a program for windows that will give me to change some setting inside the router
for example: change ssid,tx-power, apn\user\pass after changing sim , etc
and also give me “real time data” like signal-strength of the modem

how do I start ?
what is the best why to write it ?

is there any startup guide for this subject ?


Thanks ,

API clients are available in many programming languages, so whatever programming language you know already, you can use its client. The way to start writing an API application in your language of choice is exactly the same as writing any application in that same language, with the addition that you’d at some point connect to the router.

If you don’t have experience in any programming language, you’re really asking “what is the best programming language”, which… Is a little bit like asking “what’s the best [insert sport] team?”… Everybody has their opinions (which they sometimes defend religiously), and while there are some undisputable facts about each option, it ultimately boils down to personal preference.

Like, I personally prefer languages that have optional strict typing (and behaves like a loosely typed language for variables not using strict typing), optional pre-compilation (ideally to machine code NOT to a runtime code) which otherwise defaults to JIT compilation, languages that have rich built in library and make it easy to install 3rd party ones, languages which can produce programs that can run across OS-es without any OS specific code (except where the OS feature is by design OS specific and doesn’t have an analog in the runtime OS), and can be ran on consoles, desktops, phones and web servers alike with little adjustments for each environment.

I haven’t found any language that’s a perfect match to all of the above, but PHP, C# and JAVA are all closest to it (in different ways) IMHO, and they’re closely followed by Python (which loses too many points for the lack of strict typing).



Certain languages are better in certain environments (though the bunch above can work in all environments). Like, IMHO, PHP best at web applications, while C# is best at desktop (more specifically Windows) applications. JAVA in the meantime is best suited for both phones and desktop (not so much for web), but requires you to get familiar with totally different libraries for each environment, that sometimes feel like you’re using a different language altogether… So in addition to figuring our your language, you need to figure out the environment your application will work on.

I want it to work as windows app.
so I guess I should try writing it in C# , I wanted to start learning it any why - so now I have more reason to do so.

Do you know if there is any where I can find a start up for this ?
something simple that just show me how it work ? and then I can start ‘play’ with this ? and learn as I do?

Thanks ,

Well, I’ve personally studied it in University, so I can’t reccomnd from first hand a good tutorial, but just googling “C# tutorial” gives a few interesting results, such as this one from Microsoft (the creators) themselves, and this one from a popular site having various programming language tutorials.

These tutorials deal primarily with command line applications, which you should get familiar with before jumping into GUI ones.

Creating a GUI works in a similar principle to a command line application, except that instead of writing to the screen, you’re instead modifying a particular characteristic (e.g. text) of a particular GUI element (e.g. a button, a text field, etc.), when particular events occur (e.g. the press of a button, text being typed in a field, etc.). You define the actual GUI either by adding it “manually” during the program’s runtime, or you define it in advance, visually, from Visual Studio, by dragging and dropping stuff in a main area representing a window (and you can define multiple windows, making one of them the starting one).


When you’re ready for the RouterOS API… Just don’t use the Wiki client… Please! It’s very broken… this one here is one of the better ones.

what I meant is tutorials for creating mikortik API , not for the C#(this is not the problem )
how to start , simple page … etc .

I have download virtual studio 2012 ,and I’m trying to run the files without any success.
it just open the virtual studio and show me nothing , an empty page
am I doing something wrong?


Thanks ,

If tou have decided to use Visual studio then it could be helpfull: https://www.visualstudio.com/en-us/get-started/overview-of-get-started-tasks-vs.aspx

You mean you created a new project? Of course it’s normal that it’s empty, especially if it’s a command line app - there’s nothing to be seen initially.

If you specifically create a new Windows Forms application, you should get an empty visual window (onto which you can drag form elements).

If you mean you opened the C# client above into Visual Studio, that’s normal too - the client does not have any visual things to be shown. It’s a library, to be included as part of other projects, potentially visual ones too. You could only see the code itself, if you double click on the specific file you’d like to see the code of. The list of files and projects should be visible from the right.

The file you should be trying to open is either the .sln file, or from inside Visual Studio, open the different .csproj files.

Different API clients do it their own way, and many simply don’t have any documentation beyond source code documentation, and even those that do would assume familiarity with creating interfaces, rather than guiding you all the way from creating a blank app, to filling it with GUI elements, connecting and hooking the output to GUI elements. Everything short of doing the connection and the command, you’re expected to know in advance.

If you’re good with C# itself, you should have no difficulty getting started without tutorials, thanks to C#'s strict typing.

You’d simply find out the name of the “main” API class by simply using your common sense (but to save you some time with the above client: “Connection” is the main class, type “Command” being the thing to send with the “ExecuteCommand” method), and follow things from there by seeing what methods are there, what arguments they accept, and how would you initiate an argument of the specified type.


Heck, even with my API client, my docs, while very extensive, assume basic PHP and HTML knowledge. The docs don’t guide you about how you’d create a web app from scratch, that happens to use the client. I very much welcome others to write such tutorials and articles, but the place for those is not within the API client’s docs.

I got lose
I will try to it first with c , and then see how it work for me

Thanks for the time and answers

Thanks ,