Prerequisites for enabling Rest API access in Mikrotik:
Allow in firewall:
/ip firewall filter add action=accept chain=input
Add local certificate:
/certificate add name=local-root-cert common-name=local-cert key-usage=key-cert-sign,crl-sign
Sign local certificate:
/certificate sign local-root-cert
Add certificate for webfig and sign it:
/certificate add name=webfig common-name=192.168.88.1
/certificate sign webfig
Enable HTTPS service:
/ip service set www-ssl certificate=webfig disabled=no