
117
FLASH
MEDIA
SERVER
4.5
CONFIGURATION
AND
ADMINISTRATION
Using the Administration API
Last updated 11/28/2012
Call an Administration API method over HTTP
1
Verify that Flash Media Administration Server is running.
2
Open a browser window and enter the following in the address bar:
http://localhost:1111/admin/ping?auser=
username
&apswd=
password
If the web browser is on a different computer than Flash Media Server, use the server address instead of
localhost
.
Substitute your administrator user name and password, which are located in the fms.ini file.
Note:
You can construct an Administration API call from any language that can send HTTP requests. This example
uses a web browser because it’s the simplest client and good for testing purposes.
3
The server sends the XML results back to the browser:
<?xml version="1.0" encoding="utf-8" ?>
<result>
<level>status</level>
<code>NetConnection.Call.Success</code>
<timestamp>10/3/2007 05:31:01 PM</timestamp>
</result>
Constructing an HTTP request string
Many Administration APIs expect one or more parameters in addition to
auser
and
apswd
. Parameters passed in an
HTTP request must adhere to the following formatting rules:
•
Name the parameters in the string. For example, the following code calls the
addAdmin()
method:
http://localhost:1111/admin/addAdmin?
auser
=adminname&
apswd
=adminpassword&
username
="joe"&
pa
ssword
="pass123"&
vhost
="_defaultRoot_/foo.myCompany.com"
•
Strings are passed as literals surrounded by quotation marks. You can use either single quotation marks (') or
double quotation marks (").
"Hello World"
'String2'
The only exceptions are the
auser
and
apswd
parameters, which should be passed without quotation marks.
•
Numbers are passed as either integer or floating-point literals.
245
1.03
-45
Note:
When a number is used for an application name, the application name must be included within quotation
marks (" ") for methods such as
reloadApp()
and
unload App()
to work properly.
•
Arrays are passed as comma-separated values enclosed in square brackets.
[1,2,3,4]
['abcd',34,"hi"]
[10,20,[31,32],40]
•
Objects are passed as inline object literals.
{foo:123,bar:456}