Api Php from web

Somebody can help me I need to work with API php class from web in order to comunicate with mikrotik

I can do this in my localhost but I can’t Access from web in the same way

with this code I can comunicate with mk in my local red

$API->connect("mk'sip", "'mk's user'", "'mk's pass")

but I can’t do it the same way from web, Do I need to change something from my modem in order to comunicate with mikrotik?

That means you are being blocked by firewall somewhere (at ISP? on Mikrotik?) … or your gateway address isn’t set properly somewhere.

I think so but how can I do it in order to work I don’t know if I’ve to add something to MTZ from my modem and add a rule to my rb

this is my idea
I have to tell my modem this every ask from web redirect it to my rb thats way or not