Wowza Community

Connecting and disconnecting to a stream (REST API)

Hi,

I am currently using wowza version 4.4.1 I am trying to figure out how can I start and stop a stream using the REST API. I know how to do it from the admin panel by going to my app and selecting a stream an selecting connect or going to the streammanager and starting it. I could not find out how to do it on the REST API documentation. I have read in other posts that it is possible to do it by posting to the /streammanager/streamAction endpoint but when doing that I get a 401 for some reason any ideas how could I achieve this using the REST API or another wowza endpoint?

Here is the curl command:

curl -XPOST -digest -u user:password --data “action=startStream&vhostName=defaultVHost&appName=nvcEncoder_transcode/definst&streamName=160607-ch-f99d.stream&mediaCasterType=rtp” http://localhost:8086/streammanager/streamAction

But it is not doing anything :frowning:

Any thoughts?

Hi,

401 suggests unauthorised access so make sure your credentials are correct and you’ve whitelisted your address. Your example seems to be using the HTTP Provider (port 8086) rather than the REST API (port 8087).

You should be able to set a stream file to active with something like

curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/streamfiles/axiscam/actions/connect?connectAppName=live&appInstance=_definst_&mediaCasterType=rtp"

That would make the stream file axiscam.stream active in the “live” application.

Regards,

Paul