User management PHP query examples for the Wowza Streaming Engine REST API

Wowza Streaming Engine media server software includes a REST Application Programming Interface (API) that you can use to configure, manage, and monitor the media server through HTTP requests. This article describes how to identify and manage users of a Wowza Streaming Engine media server by using PHP to query the Wowza Streaming Engine REST service.

Notes:

Contents


Get a list of users
Create a user
Remove a user
For developers

Get a list of users


To get a list of users that have been created in a given Wowza Streaming Engine media server instance, use the following request:
$sf = new Com\Wowza\User();
$response = $sf->getAll();
This request returns a list of JSON user objects in the following format:
{"serverName":"_defaultServer_","users":[{"userName":"newuser2","groups":[]},{"userName":"newuser","groups":[]},{"userName":"admin","groups":["admin","advUser"]},{"userName":"newuser4","groups":["admin"]},{"userName":"newuser3","groups":[]}]}

Create a user


To create a user and include the group, use the following request. This example creates a user named newuser4 in the admin group with a password of newpass4.
$sf = new Com\Wowza\User("newuser4");
$response = $sf->create("newpass4", array("admin"));
This request returns a success or fail response as follows:
{"success":true,"message":"","data":null}

Remove a user


To remove an existing user (in this example, newuser3), use the following request:
$sf = new Com\Wowza\User("newuser3");
$response = $sf->remove();
This request returns a success or fail response as follows:
{"success":true,"message":"","data":null}

For developers


Source code is available on GitHub.

Wowza Media Systems™ provides developers with a platform to create streaming applications and solutions. See Wowza Developer Tools to learn more about our APIs and SDK.