REST APIs

140 views
Skip to first unread message

Reeti Garg

unread,
May 15, 2020, 12:49:42 PM5/15/20
to Ant Media Server
Hi, 

Not able to access Ant media's rest API, even though I added the IP filter as 0.0.0.0/0

mahmut asım Onat

unread,
May 18, 2020, 7:20:02 AM5/18/20
to Ant Media Server
Hi Reeti,

There are one IP filters for each created app. The default apps, LiveApp and WebRTCAppEE, have their own filters. Could it be possible that you've set only one of them and trying to access the other app?

Best,
Asim

Reeti Garg

unread,
May 18, 2020, 10:09:11 AM5/18/20
to Ant Media Server
Hi, the apps are same. 
For instance, I have added 127.0.0.1,192.168.0.8 as IP Filter on the url https://antmediademo.s2sclasses.com/#/applications/WebRTCAppEE under the settings tab.
I am making the request to https://antmediademo.s2sclasses.com/rest/request?_path=WebRTCAppEE/rest/v2/broadcasts/count from postman and it still returns '403 Forbidden' :(

mahmut asım Onat

unread,
May 20, 2020, 9:58:57 AM5/20/20
to Ant Media Server
Hi Reeti,

Could you use the rest api like this?
https://antmediademo.s2sclasses.com/WebRTCAppEE/rest/v2/broadcasts/count

I've checked this link and it works, hope this solves your problem.

Best,
Asim

Reeti Garg

unread,
May 20, 2020, 12:46:22 PM5/20/20
to Ant Media Server
Hi, 
For some reason,this seems to work fine with postman (which earlier was not) but I still get CORS error when I make a request from my angular app :(
Please help. 

mahmut asım Onat

unread,
May 20, 2020, 2:42:52 PM5/20/20
to Ant Media Server
Hi Reeti,

Have you modified CORS filter settings? By default, it is open for everyone so you shouldn't get such error. 

Best,
Asim

Reeti Garg

unread,
May 21, 2020, 3:29:50 AM5/21/20
to Ant Media Server
Hi, This is what my CORS Filter is:
<filter>
                <filter-name>CorsFilter</filter-name>
                <filter-class>io.antmedia.filter.CorsHeaderFilter</filter-class>
                <init-param>
                    <param-name>cors.allowed.origins</param-name>
                    <param-value>*</param-value>
                 </init-param>
                 <init-param>
                        <param-name>cors.allowed.methods</param-name>
                        <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value>
                 </init-param>
        </filter>

mahmut asım Onat

unread,
May 21, 2020, 10:07:47 AM5/21/20
to Ant Media Server
Hi Reeti,

Your filter allows every request so I think the problem is angular since I can't really think of any other setting that would lead to this behavior on the server-side.

Best,
Asim

Pasula Naresh Reddy

unread,
May 23, 2020, 2:05:15 AM5/23/20
to Ant Media Server
Hi,

I have a similar problem but when i replace * with the single URL in cors.allowed.origins it works. else it doesn't work. 
even if we put multiple URLs its not working.

Thanks
Reply all
Reply to author
Forward
0 new messages