Users and profiles in API

Hi,

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
!done
!trap =message= failure: unknown profile
!done

Anyone can help me?

Have you tried putting the variables in quotes as well ?

Paul

Try with a cr before each parameter

Hi

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

Regards
Dovi

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