Community discussions

 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Tue Feb 22, 2011 10:34 am

on what board you try to run this and on what RouterOS version?

Tried this on RB1000 with 5.0rc10

first, separate commands, removed quotation from =contents="some text" as that is not required to be there in rsc file.
[edit] wanted to add a bit about the protocol and how this works.
so you send in length and string, that in this case is formed this way:
=contents=blah..blah

API will read length, if it is not too long, it will read the string and see that argument is =contents= the rest of the string is value for the argument. Because of all this, you can set contents to whatever you like, even if you set it to "= contents=" it will be no concern for API.

Same thing happens when API returns some stuff, like script, you get =source=<whole script>

[/edit]

second ran it some other C++ code that did these commands
$ time ./TestAPI 
ret: !done
ret: !done

ret: !done

ret: !done


real    0m0.270s
user    0m0.000s
sys     0m0.000s



p.s. since i am paranoid of sorts, did not run your code.
 
User avatar
danikf
Frequent Visitor
Frequent Visitor
Posts: 65
Joined: Mon Mar 14, 2011 8:57 am

Re: API Links

Mon Mar 14, 2011 9:05 am

Hi,
please add this link to wiki:
.NET (C#) high-level api solution: http://code.google.com/p/mikrotik4net/

thx, danik
 
sw0rdf1sh
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Sun Nov 28, 2010 6:16 pm

Re: API Links

Tue Mar 22, 2011 1:42 pm

Please add this as well:

http://wiki.mikrotik.com/wiki/Api_php_template
Thanx
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8247
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: API Links

Wed Mar 23, 2011 12:20 am

are these examples of PHP API Class usage?..
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
sw0rdf1sh
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Sun Nov 28, 2010 6:16 pm

Re: API Links

Wed Mar 23, 2011 12:54 am

are these examples of PHP API Class usage?..
Chupaka I searched before building and posting in the wiki and I didn't find any example using this php api.So I did. If you believe they don't belong in the wiki then please delete so.

As for the use I believe it's a simple way of displaying info into a more readable form for a website rather than the respond from the api in an array format.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8247
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: API Links

Wed Mar 23, 2011 2:01 am

sure, they should be in Wiki, just correct the text: it's not "based on the PHP API Class", it "uses PHP API Class" - you deceive people a bit...

all the rest is fine =)
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Wed Mar 23, 2011 10:31 am

linked php api to these templates, thx.
 
sw0rdf1sh
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Sun Nov 28, 2010 6:16 pm

Re: API Links

Wed Mar 23, 2011 1:28 pm

sure, they should be in Wiki, just correct the text: it's not "based on the PHP API Class", it "uses PHP API Class" - you deceive people a bit...

all the rest is fine =)
Sorry for that.My mistake.It's corrected now.
 
chapeupreto
just joined
Posts: 6
Joined: Wed Jul 21, 2010 5:49 pm

Re: API Links

Wed Mar 23, 2011 4:06 pm

Hi folks.
First, thanks for those links.
By talking in PHP API, I've downloaded the php class mikrotik api posted here
http://forum.mikrotik.com/viewtopic.php?f=9&t=50176
by sw0rdf1sh and I'm using it in some of my projects.
After executing a script that uses that routeros_api.class.php class, I got this message:
Notice: Undefined variable: _ in ... on line 313
Then, I would like to ask you guys a question:
First, consider the following piece of code which exists in that php class (lines 300 up to 320)
// If we have got more characters to read, read them in.
         if ($LENGTH > 0) {
            $_ = "";
            $retlen=0;
            while ($retlen < $LENGTH) {
               $toread = $LENGTH - $retlen ;
               $_ .= fread($this->socket, $toread);
               $retlen = strlen($_);
            }
            $RESPONSE[] = $_ ;
            $this->debug('>>> [' . $retlen . '/' . $LENGTH . ' bytes read.');
         }

         // If we get a !done, make a note of it.
         if ($_ == "!done")
            $receiveddone=true;

         $STATUS = socket_get_status($this->socket);

         
         if ($LENGTH > 0)
            $this->debug('>>> [' . $LENGTH . ', ' . $STATUS['unread_bytes'] . '] ' . $_);
So, there is this PHP variable $_ on it.
Besides the code above, I've glanced the entire class and saw no other mentions for that $_
I suppose my script don't execute those instructions inside that first conditional, i.e., if ($LENGTH > 0) ...
Therefore, when the script reachs that second conditional, i.e., if ($_ == "!done"), the PHP produces the notice message
undefined variable: _ 
, just because the $_ variable had never been initialized.
Although it's just a simple notice message, is that code right? I mean, don't you guys think the $_ variable should be initialized somewhere before the execution of those IF's?
I tried to contact the author of that API class, but got no success.
That's it.
Thanks for any reply and suggestions.

rod~
 
trakkasure
just joined
Posts: 8
Joined: Sun Feb 27, 2011 9:28 pm

Re: API Links

Wed May 18, 2011 8:49 pm

Just wanted to add my new API to the list of available:

Written in NodeJS: https://github.com/Trakkasure/mikronode

Installable with NPM
npm install mikronode
Features:
  • * 100% Javascript. (with NodeJS)
    * Channel based communication
    * Multiple channels can be used at once.
    * Synchronous execution of commands issued on the same channel.
    * Asynchrounous execution of commands issued on different channels.
    * Focus on high performance
... Now if only it would end up in the list on the Wiki ...
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Thu May 19, 2011 9:51 am

it would be nice if you could make wiki page for your implementation. With more explanations or example.
 
trakkasure
just joined
Posts: 8
Joined: Sun Feb 27, 2011 9:28 pm

Re: API Links

Thu May 19, 2011 7:41 pm

it would be nice if you could make wiki page for your implementation. With more explanations or example.
I didn't know I had access to create a wiki page. I'll figure it out.

The GitHub page, https://github.com/trakkasure/mikronode, has full source and examples.

And it can be installed using npm (For those who use it):
npm install mikronode
It works very well. And I have plans to further develop and support it.
 
trakkasure
just joined
Posts: 8
Joined: Sun Feb 27, 2011 9:28 pm

Re: API Links

Thu May 19, 2011 8:25 pm

I didn't know I had access to create a wiki page. I'll figure it out.
Ok. So.. I created a wiki page (http://wiki.mikrotik.com/wiki/User_talk:Trakkasure).. It's under my "talks page".
So.. how do I create one outside of my talks one? (or does someone else do that?)

Still trying to figure it out.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8247
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: API Links

Fri May 20, 2011 2:26 am

So.. how do I create one outside of my talks one? (or does someone else do that?)

Still trying to figure it out.
yeah, with Google search it's a bit tricky...

http://wiki.mikrotik.com/index.php?titl ... ction=edit - replace "MyNewPageTitle" with necessary string... or just put http://wiki.mikrotik.com/wiki/MyNewPageTitle to the Address bar and then press "Create" link
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
trakkasure
just joined
Posts: 8
Joined: Sun Feb 27, 2011 9:28 pm

Re: API Links

Fri May 20, 2011 3:54 am

put http://wiki.mikrotik.com/wiki/MyNewPageTitle to the Address bar and then press "Create" link
Ok.. Done.

http://wiki.mikrotik.com/wiki/MikroNode

I don't have permission to edit the Manual::API page. So....
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Fri Jun 03, 2011 8:53 am

added link from API page to your creation and back
 
trakkasure
just joined
Posts: 8
Joined: Sun Feb 27, 2011 9:28 pm

Re: API Links

Fri Jun 03, 2011 11:17 pm

Thanks you.
 
User avatar
saaremaa
Member Candidate
Member Candidate
Posts: 154
Joined: Tue Feb 02, 2010 7:48 pm
Location: Baltijos šalių miestas

Re: API Links

Mon Aug 01, 2011 5:06 pm

Need Help. Python API from Wiki does not work in Python 3.2.xxx.? Please share a working API.
CMDR Saaremaa (Gutamaya Sierra Alpha Alpha)
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Wed Aug 03, 2011 3:10 pm

yes, python API client example from API manual page was written some time ago and is working only with Python 2.7.x or older.

However I have created example (based on Python2 example) for Python3
 
User avatar
saaremaa
Member Candidate
Member Candidate
Posts: 154
Joined: Tue Feb 02, 2010 7:48 pm
Location: Baltijos šalių miestas

Re: API Links

Wed Aug 03, 2011 6:20 pm

yes, python API client example from API manual page was written some time ago and is working only with Python 2.7.x or older.

However I have created example (based on Python2 example) for Python3
You can upload API for Python 3.x.x ?
CMDR Saaremaa (Gutamaya Sierra Alpha Alpha)
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8247
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: API Links

Wed Aug 03, 2011 11:18 pm

Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
saaremaa
Member Candidate
Member Candidate
Posts: 154
Joined: Tue Feb 02, 2010 7:48 pm
Location: Baltijos šalių miestas

Re: API Links

Wed Aug 03, 2011 11:32 pm

Imho, api ( http://wiki.mikrotik.com/wiki/Manual:API_Python3) contains syntax errors. Or am I mistaken?
CMDR Saaremaa (Gutamaya Sierra Alpha Alpha)
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Thu Aug 04, 2011 8:25 am

well i was successful running it :), running commands etc.

and python does not complain :)
 
User avatar
saaremaa
Member Candidate
Member Candidate
Posts: 154
Joined: Tue Feb 02, 2010 7:48 pm
Location: Baltijos šalių miestas

Re: API Links

Thu Aug 04, 2011 8:32 am

well i was successful running it :), running commands etc.

and python does not complain :)
OS: Ubuntu Server + Python 3.2

File "./api.py", line 33
attrs[w] =
^
SyntaxError: invalid syntax
CMDR Saaremaa (Gutamaya Sierra Alpha Alpha)
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Thu Aug 04, 2011 8:37 am

wiki spacing could be the problem. File added to wiki. Just have to rename it to py from txt it is saved on the wiki.

this is how it runs:
$ python3 api.py tst admin ''
<<< /login
<<<
>>> !done
>>> =ret=39fe3aa4385c1820b5df799739b50761
>>>
<<< /login
<<< =name=admin
<<< =response=000ef1c4c0919129902827644fe9c65efb
<<<
>>> !done
>>>
edit:
did changes to article and made sure that wiki spacing does not interfere with python

downloaded from python.org && compiled
$ python3 --version
Python 3.2.1
 
User avatar
saaremaa
Member Candidate
Member Candidate
Posts: 154
Joined: Tue Feb 02, 2010 7:48 pm
Location: Baltijos šalių miestas

Re: API Links

Thu Aug 04, 2011 8:47 am

Thank you for your help. The problem is not only in the gaps Wiki. In Ubuntu it was set to simultaneously release Python v2 and v3. Removed Python v2 and everything started.
CMDR Saaremaa (Gutamaya Sierra Alpha Alpha)
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Thu Aug 04, 2011 10:12 am

reading post elsewhere in the forum realised that python3 example is not capable to connect to ipv6 hosts, so i did small update to correct that.
 
User avatar
saaremaa
Member Candidate
Member Candidate
Posts: 154
Joined: Tue Feb 02, 2010 7:48 pm
Location: Baltijos šalių miestas

Re: API Links

Thu Aug 04, 2011 10:54 pm

Python3 API crashed if comment contain symbol`s different from the English symbol`s.
<<< /login
<<<
>>> !done
>>> =ret=a341a4f9r5b81fadfr40w29y04c2d8c4
>>>
<<< /login
<<< =name=asdfgh
<<< =response=00a919e4rd2795wqdfc036brc8ay19a9911
<<<
>>> !done
>>>
/ip/firewall/address-list/getall

<<< /ip/firewall/address-list/getall
<<<
>>> !re
>>> =.id=*11
>>> =list=local-net
>>> =address=192.168.39.0/24
>>> =dynamic=false
>>> =disabled=false
>>> =comment=test0
>>>
>>> !re
>>> =.id=*4F
>>> =list=l-2048-2048
>>> =address=192.168.39.0/24
>>> =dynamic=false
>>> =disabled=false
>>> =comment=Unauth custommers speed
>>>
>>> !re
>>> =.id=*114
>>> =list=l-1536-1536
>>> =address=192.168.38.0/24
>>> =dynamic=false
>>> =disabled=true
Traceback (most recent call last):
File "api.py", line 164, in <module>
main()
File "api.py", line 148, in main
x = apiros.readSentence()
File "api.py", line 50, in readSentence
w = self.readWord()
File "api.py", line 60, in readWord
ret = self.readStr(self.readLen())
File "api.py", line 131, in readStr
s = self.sk.recv(length - len(ret)).decode('UTF-8')
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc4 in position 9: invalid continuation byte
CMDR Saaremaa (Gutamaya Sierra Alpha Alpha)
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Mon Aug 08, 2011 12:28 pm

similar to cli it will show weird symbol. as generally it is not known what value is paced there and what it should mean.
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2409
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: API Links

Mon Aug 29, 2011 11:52 pm

Hi.

Please add this to the Wiki:
https://sourceforge.net/projects/netrouteros/

It's for PHP, but unlike the previous ones, it's heavily OOP and requires PHP 5.3 (for the sake of namespaces), and this in an effort to make it look like a more "natural" extension to PHP, rather than a "bolt on" (and also to simplify some stuff that if you want to use with the other APIs, you really need to know what you're doing).

I'd appreciate any feedback, both here, and on the project page.
PEAR2_Net_RouterOS(1.0.0b6) - My API client in PHP
(Rate my posts? If you want... no pressure...)
 
ormg770
just joined
Posts: 1
Joined: Tue Oct 18, 2011 7:16 pm

Re: API Links

Tue Oct 18, 2011 7:18 pm

Wish someone could help me with an asp API.

Thanks in advance
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2409
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: API Links

Tue Oct 18, 2011 8:37 pm

Wish someone could help me with an asp API.

Thanks in advance
On the bottom of the API's wiki page, you can see 3 .NET clients - in C#, VB.NET, and an external C# project.

Assuming that by "ASP", you're talking about "ASP.NET", you can use any one of these clients (IMHO, mikrotik4net looks like the most sophisticated client, and as such, the one I'd pick). If by "ASP", you really mean "ASP", as in "ASP classic", I must ask... why? Why not upgrade to ASP.NET?

If you mean you're actually using one of these clients and are having problems... post a new topic about it or something.
PEAR2_Net_RouterOS(1.0.0b6) - My API client in PHP
(Rate my posts? If you want... no pressure...)
 
User avatar
vthinkteam
just joined
Posts: 7
Joined: Sun Nov 20, 2011 7:23 am
Location: Mataram, Indonesia
Contact:

Re: API Links

Sun Nov 20, 2011 7:45 am

We have developing Mikrotik RouterOS API Library from Denis Basta (denis.basta@gmail.com) routeros_api class and we change it to our core class with name Mapi_Core. We have been tested with RouterOS version 3 and above. This spark library allow your Mikrotik RouterOS via CodeIgniter Framework for PHP, and we have make it easier than before for access and manipulating Mikrotik RouterOS API with specific method.

If you are CodeIgniter Framework Programmer, you can get Library for CodeIgniter Spark in this link :

Spark Library : http://getsparks.org/packages/mikrotik_api/show
Spark Repository : https://github.com/vthink/mikrotik_api
Documentation : http://doc.vthink.web.id
Updates Info : http://vthink.web.id/index.php/content/categories/21

if you have codeigniter but doesn't have a spark management package you can install it via terminal with this command :
php -r "$(curl -fsSL http://getsparks.org/go-sparks)"
more information about what is CodeIgniter Spark PHP Framework, please open this link:
http://getsparks.org/install
Thinking is an Art!
http://vthink.web.id
 
ve3nbe
just joined
Posts: 3
Joined: Tue Nov 29, 2011 8:59 pm

Re: API Links

Thu Dec 01, 2011 12:02 pm

Thank you very much
 
User avatar
vthinkteam
just joined
Posts: 7
Joined: Sun Nov 20, 2011 7:23 am
Location: Mataram, Indonesia
Contact:

Re: API Links

Fri Dec 02, 2011 11:57 am

By the way how about Mikrotik API Java that janisk created... how it licensed???
I was read in wiki, license said that

Code is provided as is and can be freely used freely. I, as a writer of code, am not responsible for anything that may arise from use of this code.


But I can't see that licensed on GPL or MIT or BSD or something else???
I was developing library that I plan for license on GPL 3. My Core library using MikroTik API Java that was created by Janisk, and I'm doing some modification for adapting with My Library. How do I license janisk work to be part of my library, and how to say that I was doing modification on that class.

If janisk here please respond me...
Thinking is an Art!
http://vthink.web.id
 
User avatar
vthinkteam
just joined
Posts: 7
Joined: Sun Nov 20, 2011 7:23 am
Location: Mataram, Indonesia
Contact:

Re: API Links

Fri Dec 02, 2011 11:58 am

And one things I'm new on Licensing... soo, help me to understand it..
Thinking is an Art!
http://vthink.web.id
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Fri Dec 02, 2011 2:21 pm

i see all of these licenses restrictive for this peace of code. So, the code is provided AS-IS, you can freely use it as a whole or parts of it, edit it to suit your needs and your project. If you see errors in the code and want them fixed you can contact me and notify about those. If you are going to publish source of your code under some license, just make sure that nobody is going to write me saying that i have some licensed code on the page that i either have to license under same license and write down who the real author is.
 
User avatar
vthinkteam
just joined
Posts: 7
Joined: Sun Nov 20, 2011 7:23 am
Location: Mataram, Indonesia
Contact:

Re: API Links

Fri Dec 02, 2011 5:31 pm

Thankz for reply my post...

Can I get your email? cause when I want to contact you, I cannot see email or any other contact for communicating with you.
send me message to vthinkteam@gmail.com

I analyze what you said in this.
If you are going to publish source of your code under some license, just make sure that nobody is going to write me saying that i have some licensed code on the page that i either have to license under same license and write down who the real author is.
first thing, I want to publish my source code with the your source code inside some package of my source code. I will make library called JRouterOS and I want use GPL 3 license on it.

This the situation :
Your code using AS-IS or in other words "unlicensed" (this my opinion).
My Code using license GPL 3.
I want to distribute jar , javadoc, and src in one bundle, that your code in that bundle too.
Your code will be inside JRouterOS.jar in some package on classpath of this jar.


With this situation my question is :
1. Does the license GPL with unlicensed will compatible in one bundle...
2. or, Do my code cannot licensed to GPL 3, so I have to use AS-IS too...
Thinking is an Art!
http://vthink.web.id
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Thu Dec 08, 2011 1:37 pm

AFAIK you can use my code, just in header add notice that where this code was taken from. That should suffice.
 
legrang
just joined
Posts: 22
Joined: Wed Nov 03, 2010 4:05 pm
Location: South Africa
Contact:

Re: API Links

Mon Dec 30, 2013 2:12 pm

I have written a Java client library for the Mikrotik API.

The library, source code and examples can be found here: https://github.com/GideonLeGrange/mikrotik-java

Current version is 1.0, with 1.1 - which will support TLS encryption - due shortly.

I appreciate all questions and comments.

-
Gideon
Gideon le Grange
RouterOS Java API: https://github.com/GideonLeGrange/mikrotik-java
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Mon Mar 24, 2014 1:46 pm

somehow i missed your post. Added your java link to the wiki.
 
comtihon
just joined
Posts: 1
Joined: Fri Jun 13, 2014 3:45 am

Re: API Links

Fri Jun 13, 2014 3:47 am

I made api for Erlang, please add it to your wiki -> https://github.com/comtihon/erotik
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8247
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: API Links

Fri Jun 13, 2014 12:51 pm

I made api for Erlang, please add it to your wiki -> https://github.com/comtihon/erotik
ahhh, I'm in love with than name!..
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
serthan
Frequent Visitor
Frequent Visitor
Posts: 61
Joined: Sat Jun 16, 2007 10:49 am

Re: API Links

Wed Jul 09, 2014 5:30 pm

/ip/hotspot/user/remove
=numbers=123

username:123
password:123

api kod doesnt work, mikrotik removing another user which have id=123
can we use =name= or anything instead of =numbers=
thx
Best Regards.
Serthan Öztürk
Electronic Engineer
http://www.sgsbilisim.com.tr
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5823
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: API Links

Wed Jul 09, 2014 6:19 pm

You can get ID by name
/ip/hotspot/user/print
?name=123
=.proplist=.id


and tehn run remove command
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8247
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: API Links

Wed Jul 09, 2014 7:11 pm

/ip/hotspot/user/remove
=numbers=123

username:123
password:123

api kod doesnt work, mikrotik removing another user which have id=123
can we use =name= or anything instead of =numbers=
thx
well, not 'numbers' but '.id', I think. also, .id is in '*number' format, so if '123' is username, then you can use it as .id (need to be checked, but in other places you can use unique name for .id) without worrying that user with .id equal to *123 will be deleted
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Topic Author
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: API Links

Tue Aug 05, 2014 3:09 pm

I made api for Erlang, please add it to your wiki -> https://github.com/comtihon/erotik
thanks for example, added to wiki.
 
ibrahim10101
just joined
Posts: 2
Joined: Wed Oct 29, 2014 5:05 pm

Re: API Links

Wed Oct 29, 2014 5:13 pm

how to read data with c# ????
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8247
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: API Links

Thu Oct 30, 2014 12:25 pm

how to read data with c# ????
http://wiki.mikrotik.com/wiki/API_in_C_Sharp
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
luan
just joined
Posts: 4
Joined: Sun May 31, 2015 9:06 pm

Re: API Links

Mon Jun 01, 2015 1:26 am

Hi folks.
I need to print on a table id and the name of the hostpot users.
and remove the User by his id.
Can anyone help me.

Who is online

Users browsing this forum: No registered users and 8 guests