Community discussions

just joined
Topic Author
Posts: 3
Joined: Tue May 22, 2012 3:50 pm

Users and profiles in API

Tue May 22, 2012 4:43 pm


I'm working in a client that communicates with routerboard via API. In this client I can show anything about users, profiles, customers and create users in user-manager. But my problem is when I want to assign a profile in user-manager to a user.

I try to do it how I do via winbox or telnet (where it works), but seems that when I try to do the same with API doesn't find another thing that causes error.

For example (in vb6):
/tool/user-manager/user/create-and-activate-profile" & " =user=" & user & " =customer=" & costumer & " =profile=" & prof
Where user, costumer and prof are String variables.

In the Output:

!trap =message= no such command prefix
!trap =message= failure: unknown profile

Anyone can help me?
Member Candidate
Member Candidate
Posts: 267
Joined: Mon May 31, 2004 12:16 pm
Location: Sydney, Australia

Re: Users and profiles in API

Thu May 31, 2012 5:25 pm

Have you tried putting the variables in quotes as well ?

User avatar
Frequent Visitor
Frequent Visitor
Posts: 67
Joined: Thu Mar 10, 2011 12:09 pm

Re: Users and profiles in API

Sat Jun 02, 2012 11:07 am

Try with a cr before each parameter
just joined
Posts: 1
Joined: Tue Jan 15, 2013 11:56 am

Re: Users and profiles in API

Tue Jan 15, 2013 11:59 am


Did you find a solution? I'm having the exact same problem. I'm running v5.22, and using the c# api tik4net.


EDIT: I found the answer: you have to make sure there is a new line character for each variable. So it would look something liek this (in C#):
/tool/user-manager/user/create-and-activate-profile" + [b]"\n" [/b]+ "=user=" + hsuser + [b]"\n"[/b] + "=customer=admin" + [b]"\n" [/b]+ "=profile=" + hsprofile

Who is online

Users browsing this forum: No registered users and 5 guests