api authentication woes

I have fought and fought with the api code, and I can’t seem to get it to authenticate.

I have compared packets byte for byte via ethereal and it looks like my packets are well-formed. I have taken the hashes the python script receives and outputs and plugged it into my code and I get identical results, yet the python script is able to log in, and I always get rejected.

I have attached my simple vb6 test code if someone more familiar with the api could spot what I’m doing wrong here I’d appreciate it.

Thanks
Mikritik API Test.zip (11.7 KB)

Take a look at the VB2005 (VB.NET) code posted. IT WORKS… I have used it as a “module”..

I can login ask questions and get replys… I just need to figure out how to issue commands IE add rules etc…

The code isnt documented…

Hi Royce,

How did you go with your VB6 code?

Cheers,

James

the command, for example,

ip address add address=10.0.0.1/24 interface=ether1

will look like this

/ip/address/add
=address=10.0.0.1/24
=interface=ether1

to see what you have to write use ? in console

another example

/ip/address/print
=follow=1

will follow log printout until you issue /cancel command, if you set tag, then you can cancel one command with tag exclusively

Royce3, Mullins,

You manage to get it working in VB6? I just can’t get pass the authentication part. Do you have sample code just for that part?

Thanks,
San.

This code works.

http://forum.mikrotik.com/t/mikrotik-api-and-c/18032/3

You just need to modify it for VB6.
If you do this, please post back the code to help others.