hotspot login

Hi I am new to mikrotik and I want to run a hotspot for people in the area to login with username and password that I will give it to them so I build a webpage that asks them to enter their phone number then I send them a message that contains username and password. So I read Php api client and found the code but the problem is when I request to access the router it says unreachable cause I haven’t login yet with my username and password. I want to know how can I access the router to add user without login , or login programmatically with API to admin user so I can add new user with limitation to the hotspot .
thanks