This is the users management API. It allows you to add, update, and remove users from the Webinato database. You have to use this API with the utmost caution!
Note: You will need to have a skilled web programmer who has a strong knowledge of programming languages such as PHP in order to implement these APIs.
First add the user; then add the room access. You must know the roomID.
NOTE: Please review the SSO API. Using SSO, you can have your customers in your own database and set your own login rules.
API Methods
Get list of users or Search for a User
Using this function, you can retrieve the entire list of users for the company, those that have specific rights to a room, or search for a particular user based on the parameters described. Please see the example below in the sample code section.
Required Parameters:
(int) companyID //Found in Modify Organization Settings section of the admin page (str) companyPass //Found in Modify Organization Settings section of the admin page (str) action //Must be 'searchUsers' Optional Parameters (int) userNo //Search by UserNo (str) email //Search by User e-mail (str) fn //Search by User First Name (str) ln //Search by User Last Name (str) roomID //Search for Users for this room only
Sample Code:
<?php $url = "http://www.webinato.com/support/apis/users.php"; searchUsers($url) function searchUsers($url) { $params = array( 'action' => 'searchUsers', 'companyID' => 1234, 'companyPass' => 'yourPassword1234', 'userNo' => '', 'email' => '', 'roomID' => '', 'fn' => '', 'ln' => '' ); $resp = callRemote($url, $params, true); header("Content-type: text/xml"); print_r($resp); } function callRemote($url, $params, $returnResponse = true) { $c = curl_init($url); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, http_build_query($params)); curl_setopt($c, CURLOPT_HEADER, false); curl_setopt($c, CURLOPT_RETURNTRANSFER, $returnResponse); $response = curl_exec($c); curl_close($c); if ($returnResponse) return $response; }
Sample Output:
<root> <user> <userNo>12490</userNo> <firstName>John</firstName> <lastName>Smith</lastName> <email>person@email1.com</email> <admin>1</admin> <billing>1</billing> <room1234_access>moderator_admin</room1234_access> </user> <user> <userNo>12888</userNo> <firstName>Jane</firstName> <lastName>Doe</lastName> <email>jane@doe.com</email> <admin>1</admin> <billing>0</billing> <room4567_access>moderator</room4567_access> </user> . . . </root>
Add User
Using this function, you are able to add users. Please see the example below in the sample code section.
After adding the user you may use the function “modifyRoomAccess” to grant access to the room(s) and add the user role, or you can include them in the addUser call.
Required Parameters:
(int) companyID //Found in Modify Organization Settings section of the admin page (str) companyPass //Found in Modify Organization Settings section of the admin page (str) action //Must be 'addUser' (str) fn //User First Name (str) ln //User Last Name (str) email //User e-mail (str) password //User password Optional Parameters: (int) admin //1=Super Admin for the account, 0=not super admin (int) billing //1=Billing contact for the account (will receive invoices, etc), 0=not billing contact (int) sendEmail //1=Send Webinato account creation email to user, 0=do not send email from Webinato (str) bio //A text or link of biographical information about the user (Shows up in the room). (str) room#### //values: 'no_access', 'registered_user', 'presenter', 'presenter_admin', 'moderator', //'moderator_admin' //The #### should be the roomID of the room you are granting these permissions for, //ex. room23001 //You can specify multiple rooms, ex. room2301, room2305, room4134, etc...
Sample Code:
<?php function addUser($url) { $params = array( 'action' => 'addUser', 'companyID' => 1234, 'companyPass' => 'thepass1245', 'fn' => 'John', 'ln' => 'Smith', 'email' => 'johnsmith@thecompany.com', 'password' => 'johnsPassword', 'admin' => 1, 'billing' => 1, 'bio' => 'John is an accomplished businessman. He is the CEO of ...', 'room3001' => 'registered_user', 'room3414' => 'moderator_admin', 'sendEmail' => 0 ); $resp = callRemote($url, $params, true); header("Content-type: text/xml"); print_r($resp); } ?>
Sample Output
<root> <status>success</status> <email>johnsmith@thecompany.com</email> <userNo>19848</userNo> <room3001_access>registered_user</room3001_access> <room3414_access>moderator_admin</room3414_access> <firstName>John</firstName> <lastName>Smith</lastName> </root>
Edit User
Using this function, you are able to edit users. Please see the example below in the sample code section.
Please Note: If you are changing the user’s password or email address, you must use the UserNo to reference the record.
Required Parameters:
(int) companyID //Found in Modify Organization Settings section of the admin page (str) companyPass //Found in Modify Organization Settings section of the admin page (str) action //Must be 'editUser' (int) userNo //UserNo or // one of these must be passed (str) email //User e-mail Optional Parameters: (str) fn //User First Name (str) ln //User Last Name (str) password //User password (int) admin //1=Super Admin for the account, 0=not super admin (int) billing //1=Billing contact for the account (will receive invoices, etc), 0=not billing contact (str) bio //A text or link of biographical information about the user (Shows up in the room). (str) room#### //values: 'no_access', 'registered_user', 'presenter', 'presenter_admin', 'moderator', //'moderator_admin' //The #### should be the roomID of the room you are granting these permissions for, //ex. room23001 //You can specify multiple rooms, ex. room2301, room2305, room4134, etc...
Sample Code:
<?php function editUser($url) { $params = array( 'action' => 'editUser', 'userNo' => 22334, 'companyID' => 1234, 'companyPass' => 'thepass1245', 'fn' => 'John', 'ln' => 'Smith', 'email' => 'johnsmith@thecompany.com', 'password' => 'johnsPassword', 'admin' => 1, 'billing' => 1, 'bio' => 'John is an accomplished businessman. He is the CEO of ...', 'room3001' => 'registered_user', 'room3414' => 'moderator_admin', ); $resp = callRemote($url, $params, true); header("Content-type: text/xml"); print_r($resp); } ?>
Sample Output
<root> <status>success</status> <email>johnsmith@thecompany.com</email> <userNo>19848</userNo> <room3001_access>registered_user</room3001_access> <room3414_access>moderator_admin</room3414_access> <firstName>John</firstName> <lastName>Smith</lastName> </root>
Modify Room Access
Using this function you are able to add, update, or delete access to a room for an existing user.
Parameters required:
(int) companyID //Found in Modify Organization Settings section of the admin page (str) companyPass //Found in Modify Organization Settings section of the admin page (str) action //Must be 'modifyRoomAccess' (int) userNo //UserNo or // one of these must be passed (str) email //User e-mail (str) room#### //values: 'no_access', 'registered_user', 'presenter', 'presenter_admin', 'moderator', //'moderator_admin' //The #### should be the roomID of the room you are granting these permissions for, //ex. room23001 //You can specify multiple rooms, ex. room2301, room2305, room4134, etc...
Sample Code:
<?php function modifyRoomAccess($url) { $params = array( 'action' => 'modifyRoomAccess', 'companyID' => 1234, 'companyPass' => 'compAPass123', 'email' => 'johnsmith@thecompany.com', 'room3001' => 'moderator_admin' ); $resp = callRemote($url, $params, true); header("Content-type: text/xml"); print_r($resp); } ?>
Sample Output:
<root> <status>success</status> <email>johnsmith@thecompany.com</email> <userNo>12318</userNo> <room3001_access>moderator_admin</room3001_access> </root>
Delete User
This method allows you to delete a user from the database.
Required Parameters:
(int) companyID //Found in Modify Organization Settings section of the admin page (str) companyPass //Found in Modify Organization Settings section of the admin page (str) action //Must be 'deleteUser' (int) userNo //UserNo or // one of these must be passed (str) email //User e-mail
Sample Code:
<?php $params = array( 'action' => 'deleteUser', 'companyID' => 1234, 'companyPass' => 'cpass1234', 'email' => 'johnsmith@thecompany.com' ); $resp = callRemote($url, $params, true); header("Content-type: text/xml"); print_r($resp);
Sample Output:
<root> <status>success</status> <email>johnsmith@thecompany.com</email> </root>
Function execute
Sample code
<?php $url = 'http://www.webinato.com/support/apis/users.php'; function callRemote($url, $params, $returnResponse = true) { $c = curl_init($url); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $params); curl_setopt($c, CURLOPT_HEADER, false); curl_setopt($c, CURLOPT_RETURNTRANSFER, $returnResponse); $response = curl_exec($c); curl_close($c); if ($returnResponse) return $response; } ?>