Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
FME® Server 2013 REST API Specifications
E-mail: [email protected] • Web: www.safe.com
2 FME Server REST API Specifications
Safe Software Inc. makes no warranty either expressed or implied, includ-ing, but not limited to, any implied warranties of merchantability or fitnessfor a particular purpose regarding these materials, and makes such mate-rials available solely on an “as-is” basis.
In no event shall Safe Software Inc. be liable to anyone for special, col-lateral, incidental, or consequential damages in connection with or arisingout of purchase or use of these materials. The sole and exclusive liability ofSafe Software Inc., regardless of the form or action, shall not exceed thepurchase price of the materials described herein.
This manual describes the functionality and use of the software at the timeof publication. The software described herein, and the descriptions them-selves, are subject to change without notice.
Copyright
© 1994 – 2013 Safe Software Inc. All rights are reserved.
Revisions
Every effort has been made to ensure the accuracy of this document. SafeSoftware Inc. regrets any errors and omissions that may occur and wouldappreciate being informed of any errors found. Safe Software Inc. will cor-rect any such errors and omissions in a subsequent version, as feasible.Please contact us at:
Safe Software Inc.7445 – 132nd Street, Suite 2017Surrey, BCCanada V3W 1J8
www.safe.com
Safe Software Inc. assumes no responsibility for any errors in this doc-ument or their consequences, and reserves the right to make improve-ments and changes to this document without notice.
Trademarks
FME is a registered trademark of Safe Software Inc.
3 FME Server REST API Specifications
All brands and their product names mentioned herein may be trademarks orregistered trademarks of their respective holders and should be noted assuch.
Document Information
Document Name: FME Server REST API Specifications
Version: FME Server 2013
Updated: December 2013
FME Server REST API Specifications 4
Contents
Web Application Properties 7
REST API Documentation 13
Required Parameters 13Request Parameters 13HTTP Response Code and Errors 14HTTP Status Codes 14Error Messages 14Repository Methods 14GET /repositories 14GET /repositories/<repository> 16PUT /repositories/<repository> (create) 18POST /repositories (create) 18DELETE /repositories/<repository> (remove) 19Workspace, Custom Format and Custom Transformer Methods 20Item Management Methods 20Workspace Information Retrieval Methods 23Workspace Service Methods 33Resource Methods 38Item Action Methods 42Service Management 45GET /services 45GET /services/<service> 48PUT /services/<service> (create, update) 49POST /services (create, update) 50DELETE /services/<service> (remove) 51GET /services/<service>/properties 52POST /services/<service>/properties (update) 53DELETE /services/<service>/properties (remove) 54GET/services/<service>/registration 55Transformation Management 56GET /jobs 56GET /jobs/running 58GET /jobs/completed 59DELETE /jobs/completed 60GET /jobs/queued 61
5 FME Server REST API Specifications
GET /jobs/<id> 62GET /jobs/<id>/result 64POST /jobs/<id>/cancel 66POST /jobs/running/cancel 67POST /jobs/queued/cancel 67GET /engines 68Schedule Management 69GET /repositories/<repository>/<workspace>/schedule 69GET /repositories/<repository>/<workspace>/schedule/request 71POST /repositories/<repository>/<workspace>/schedule 72DELETE /repositories/<repository>/<workspace>/schedule 74Notifications 75Overview 75Topic Management 79Subscriber Management 85Subscription Management 89Publisher Management 109Publication Management 113Publishing 133Log File Management 136GET/logs 136GET/logs/<log> 137GET/logs/<log>/view 139GET/logs/<log>/download 139DELETE/logs 140
FME Server REST API Specifications 6
Web Application PropertiesThe following table lists the properties file path and web application prop-erties of the REST service.
Properties file
<WebAppDir>/fmerest/WEB-INF/conf/propertiesFile.properties
Key Property Description
SERVER_NAME The computer where the Transformation Manager isrunning. Can be specified as a network name or anIP.
Default value = localhost
SERVER_PORT The port on which the Transformation Manager isrunning on the remote machine. This is an integerbetween 1025 and 65535.
Default value = 7071 (the default Transformation Man-ager listening port)
SCHEDULER_PORT The port on which the Scheduler Manager is lis-tening.
Default value = 7073
NOTIFIER_REQUEST_PORT
The request port of FME Notifier.
Default value = 7072
CONNECTION_POOL_EXPIRY
The length of time in seconds in which an FMEServer connection remains idle before expiringfrom the connection pool.
If a value of less than or equal to zero is specified,there is no connection pooling.
Default value = 300
RESOURCE_PATH This is the path to the textual resources of the log.This file stores all the messages that will appear inthe log as well as their code.
FME Server REST API Specifications 7
Properties file
<WebAppDir>/fmerest/WEB-INF/conf/propertiesFile.properties
Key Property Description
MIN_TIME_BETWEEN_REQS
This is the minimal amount of time that a clientmust wait before sending another request. If arequest is sent before that interval, it will beignored. The time is specified in milliseconds.
Default value = 1000
LOG_FILE_NAME The file name that the log files will have in com-mon. The log files will have that name with anumber before the dot (such as green.log =>green1825841623.log).
A subdirectory can be specified before the filename. The base file path is stored in the mes-sageLogger resource bundle, which is a mes-sageLogger.properties file on the hard drive (underResources/). The LOG_FILE_NAME content is simplyappended to that path.
INCLUDE_TIMES-TAMP_IN_LOG
A boolean value that determines the formatting ofthe log file. If set to true, the timestamp will appearat the begining of each log message.
Default value = true
INCLUDE_THREAD_NAME_IN_LOG
A boolean value that determines the formatting ofthe log file. If set to true, the thread name willappear at the begining of each log message.
Default value = false
Web Application Properties
8 FME Server REST API Specifications
Properties file
<WebAppDir>/fmerest/WEB-INF/conf/propertiesFile.properties
Key Property Description
APPEND_TO_EXIST-ING_LOG
A boolean value that determines if new instances ofthe log will use the same log file or create a newfile. If set to true only one log file will be used.
Default value = true
ECHO_LOG_TO_CON-SOLE
A boolean value that determines if log messagesare passed to the console after being written to thelog file. If set to true, messages will appear on theconsole as well as in the log.
Default value = false
MAX_LOG_FILE_LINES
An integer value that specifies the maximumnumber of lines allowed in the log file before cre-ating a new one.
Default value = 3000
MAX_LOG_FILE_AGE An integer value that specifies the number of sec-onds the log file stays valid for. After this amount oftime, any messages logged will be stored in a newlog file.
Default value = 604800
DEFAULT_RESPONSE_FORMAT
The default response format. See "Configuring Serv-ice Response Format" on page 1.
DEFAULT_USER_ID The default user ID to log in FME Server.
DEFAULT_PASSWORD The default password for default user ID.
SECURE_CLIENT_ADDRESS
A boolean value that determines if token authen-tication includes the client address. Set it to true ifenhanced security is required.
Default value = false
FME Server REST API Specifications 9
Properties file
<WebAppDir>/fmerest/WEB-INF/conf/propertiesFile.properties
Key Property Description
SECURITY_CLIENT_ID The client ID assigned to this web service.
TOKEN_PROVIDER URL to the token provider service.
HTML_TEMPLATE_DIRECTORY
The directory where the HTML response XSLT tem-plates are stored.
LOCALE The locale of the service. If no value, the defaultsystem locale is used. If specified, the specifiedlocale is used.
The language, country and variant are separated byunderscores. Language is always lower case, andcountry is always upper case.
Examples: "en", "de_DE", "_GB", "en_US_WIN","de__POSIX", "fr__MAC"
Web Application Properties
10 FME Server REST API Specifications
Properties file
<WebAppDir>/fmerest/WEB-INF/conf/propertiesFile.properties
Key Property Description
FAILOVER_SERVER_NAMES
An optional list of space-separated FME Server hostnames. Each host named in this list must be runningan FME Server.
If this service cannot connect to (or loses its con-nection to) its primary FME Server, it will attemptto connect to the first FME Server system named inthe list. If connection failure is similarly encoun-tered with this system, this service will attempt toconnect to the next system in the list.
This failover sequence is followed until all FMEServer systems in the list have been tried once.After this, a subsequent connection failure willtrigger a final attempt by this service to connect tothe original, primary FME Server system again. Ifthis also fails, this service returns an error mes-sage to the client.
To use FAILOVER_SERVER_NAMES, uncomment theline and replace <namelist> with a space-sep-arated list of one or more FME Server host names.Do not include the angle-brackets in the namelist.For example:
FAILOVER_SERVER_NAMES=red green blue
FME Server REST API Specifications 11
12 FME Server REST API Specifications
Required Parameters
REST API DocumentationUse the table of contents in this Reference Manual to locate the followingcomponents of the REST API:
n HTTP Response Codes and Errors
n Repository Methods
n Workspace, Custom Format and Custom Transformer Methods
n Service Management
n Transformation Management
n Schedule Management
n Notification Management
Required ParametersAccessing the REST interface requires a security token, which can be gen-erated using the FME Server token service. The security token is a string ofencrypted information sent between client and server to manage authen-tication.
For information about requesting a security token, see the FME Server Ref-erence Manual or the FME Server Developer's Guide.
The following example is a GET request to list all available repositories, andincludes the security token parameter:
httpRequest.open("GET", "/fme-rest/repositories.json?token="+token_, true);
Request ParametersFor all requests other than Notifications requests, including PUT and POSTrequests for making updates, parameters must be specified in the query-string and not as part of the request body. In other words, using "appli-cation/x-www-form-urlencoded" or "multipart/form-data" content-types are not allowed, except for Notifications requests.
FME Server REST API Specifications 13
HTTP Response Code and ErrorsHTTP Status Codes
FME REST Service returns HTTP status code to every REST request. Formost GET requests, a response message will be returned in your requestedformat along with the status code. For most PUT and DELETE requests, onlystatus code is returned to indicate whether the operation is successful ornot. Refer to the rest of the specifications for more details.
200 OK: Success
400 Bad Request: The request was invalid. An accompanying error mes-sage will explain why.
401 Unauthorized: Authentication credentials were missing or incorrect.
403 Forbidden: The request is understood, but it has been refused. Anaccompanying error message will explain why.
404 Not Found: The URI requested is invalid or the requested resourcedoes not exist.
Error Messages
FME REST Service returns error messages in your requested format. Forexample, an error message in XML format may look like below:
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<statusInfo><status>failure</status><message>Invalid service name ‘fmedownload’.</message>
</statusInfo></serviceResponse>
Repository MethodsGET /repositories
Returns all the repositories
URI:
REST API Documentation
14 FME Server REST API Specifications
Repository Methods
/fmerest/repositories.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n repositories: list of repositories
Sample request URL:
http://localhost/fmerest/repositories.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>fmerest/repositories</requestURI><repositories>
<repository><name>FME_Store</name><uri>/fmerest/repositories/FME_Store</uri><description/>
</repository><repository>
<name>Samples</name><uri>/fmerest/repositories/Samples</uri><description/>
</repository></repositories>
</serviceResponse>
FME Server REST API Specifications 15
GET /repositories/<repository>
Returns all the workspaces, custom formats and custom transformers ofthe specified repository
URI:
/fmerest/repositories/<repository>.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n workspaces: list of workspaces
n customFormats: list of custom formats
n customTransformers: list of custom transformers
Sample request URL:
http://localhost/fmerest/repositories/Samples.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fmerest/repositories/Samples</requestURI><repository>
<name>Samples</name><description/><workspaces>
<workspace><title>City of Austin: Apartments and other (ACAD 2
KML)</title>
REST API Documentation
16 FME Server REST API Specifications
Repository Methods
<uri>/fmerest/repositories/Sa-mples/austinApartments.fmw</uri>
<isEnabled>true</isEnabled> <description>
Filters DWG points with attributes by name intocategories (apartments, shopping, schools, airports), stylesthe points by category and then writes the points to KML.
</description><name>austinApartments.fmw</name>
</workspace><workspace>
<title>Earthquakes: GeoRSS to KML Diagrams</title> <uri>/fmerest/repositories/Sa-
mples/earthquakesextrusion.fmw</uri><isEnabled>true</isEnabled><description/><name>earthquakesextrusion.fmw</name>
</workspace></workspaces><customTransformers>
<customTransformer><uri>/fmerest/repositories/Sa-
mples/AreaUnitConverter.fmx</uri><description/><name>AreaUnitConverter.fmx</name>
</customTransformer></customTransformers><customFormats>
<customFormat>
<uri>/fmerest/repositories/Samples/TestFormat.fds</uri><description/><name>TestFormat.fds</name>
</customFormat></customFormats>
FME Server REST API Specifications 17
</repository></serviceResponse>
PUT /repositories/<repository> (create)
Creates a new repository or does nothing if the repository already exists
URI:
/fmerest/repositories/<repository>.<format>
Formats:
xml, json, html
HTTP Method(s):
PUT
Parameters:
n description: required. The description of the repository you’re cre-ating.
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/repositories/NewRepository?description=test
POST /repositories (create)
Creates a new repository or does nothing if the repository already exists.
URI:
/fmerest/repositories.<format>
Formats:
xml, json, html
HTTP Method(s):
POST
REST API Documentation
18 FME Server REST API Specifications
Repository Methods
Parameters:
n repository: required. The name of the repository you’re creating.
n description: required. The description of the repository you’re cre-ating.
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/repositories
POST parameters:
repository=NewRepositorydescription=MyNewRepository
DELETE /repositories/<repository> (remove)
Deletes an existing repository
URI:
/fmerest/repositories/<repository>.<format>
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
n none
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
FME Server REST API Specifications 19
http://localhost/fmerest/repositories/NewRepository.xml
Workspace, Custom Format and Custom TransformerMethodsItem Management Methods
GET /repositories/<repository>/<item.extension>
Downloads the repository item (workspace, custom format, custom trans-former)
URI:
/fmerest/repositories/<repository>/<item.extension>
Formats:
application/octet-stream
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n The item file is returned as HTTP stream if operation issuccessful, otherwise error code and message will bereturned
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload.fmw
PUT /repositories/<repository>/<item.extension>)
Uploads the item file (workspace, custom format or custom transformer)to the specified repository. The old item will be overwritten if it alreadyexists.
URI:
REST API Documentation
20 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
/fmerest/repositories/<repository>/<item.extension>.<format>
Formats:
xml, json, html
HTTP Method(s):
PUT
Parameters:
n item file: required. The item file is attached to PUT request body
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/repositories/Samples/myworkspace.xml
POST /repositories/<repository> (create, update)
Uploads the item file (workspace, custom format or custom transformer) tothe specified repository. The old item will be overwritten if it already exists.
URI:
/fmerest/repositories/<repository>.<format>
Formats:
xml, json, html
HTTP Method(s):
POST
Parameters:
n item: required. The item name
n item file: required. The item file is attached to POST request body
Response:
FME Server REST API Specifications 21
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/repositories/Samples.xml
POST parameters:
This POST request needs to contain a multipart/mixed request body.
Parts:
n item: demo.fmw
n <file content>
DELETE /repositories/<repository>/<item.extension> (remove)
Deletes the item (workspace, custom format or custom transformer) in thespecified repository
URI:
/fmerest/repositories/<repository>/<item.extension>.<format>
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
n none
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/repositories/Samples/myworkspace.xml
REST API Documentation
22 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
Workspace Information Retrieval Methods
GET /repositories/<repository>/<workspace>/readers
Returns all the readers of the workspace
URI:
/fmerest/repositories/<repository>/<workspace>/readers.<for-mat>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response Elements:
n readers: list of readers of this workspace
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/readers.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fme-rest/repositories/Samples/austinDownload/readers</requestURI>
<readers><reader>
<uri>/fmerest/repositories/Sa-mples/austinDownload.fmw/source/SHAPE</uri>
<isSource>true</isSource><location>C:\S-
ampleData\austin\transportation\airports.shp</location>
FME Server REST API Specifications 23
<name/><format>SHAPE</format>
</reader></readers>
</serviceResponse>
GET /repositories/<repository>/<workspace>/writers
Returns all the writers of the workspace
URI:
/fmerest/repositories/<repository>/<workspace>/writers.<for-mat>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response Elements:
n writers: list of writers of this workspace
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/writers.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fme-rest/repositories/Samples/austinDownload/writers
</requestURI><writers>
<writer>
REST API Documentation
24 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
<uri>/fmerest/repositories/Samples/austinDownload/writers/GENE-RIC</uri>
<isSource>false</isSource><location>C:/Program Files (x86)/FM-
EServer/DefaultResults</location><name>GENERIC_1</name><format>GENERIC</format>
</writer></writers>
</serviceResponses>
GET /repositories/<repository>/<workspace>/[readers|writers]/<da-taset>
Returns the feature types of the reader/writer dataset specified by FME for-mat
URI:
/fmerest/repositories/<repository>/<workspace>/[read-ers|writers]/<dataset>.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response Elements:
n featureTypes: list of feature types
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/readers/SHAPE_1.xml
Sample response (XML):
FME Server REST API Specifications 25
<?xml version="1.0" encoding="UTF-8"?><serviceResponse> <requestURI>/fme-rest/repositories/Samples/austinDownload/readers/SHAPE_1</requestURI>
<reader><name>SHAPE_1</name><format>SHAPE</format><location>""C:/Program Files/FME-
Server//Server/Sa-mpleData\austin\transportation\airports.shp""C:/Program Files/FME-Server//Server/SampleData\austin\transportation\cenart.shp" "C:/ProgramFiles/FME-Server//Server/Sa-mpleData\austin\transportation\railroad.shp""C:/Program Files/FME-Server//Server/Sa-mpleData\austin\transportation\streetcl.shp""</location>
<isSource>true</isSource><featureTypes>
<featureType><uri>/fme-
rest/repositories/Samples/austinDownload/readers/SHAPE_1/ra-ilroad</uri>
<name>railroad</name><description/>
</featureType><featureType>
<uri>/fme-rest/repositories/Samples/austinDownload/readers/SHAPE_1/streetcl</uri>
<name>streetcl</name><description/>
</featureType>
REST API Documentation
26 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
<featureType><uri>/fme-
rest/repositories/Samples/austinDownload/readers/SHAPE_1/cenart</uri>
<name>cenart</name><description/>
</featureType><featureType>
<uri>/fme-rest/repositories/Samples/austinDownload/readers/SHAPE_1/a-irports</uri>
<name>airports</name><description/>
</featureType></featureTypes>
</reader></serviceResponse>
GET /repositories/<repository>/<workspace>/[readers|writers]/<da-taset>/<feature type>
Returns the specified feature type of the reader/writer dataset
URI:
/fmerest/repositories/<repository>/<workspace>/[read-ers|writers]/<dataset>/<feature type>.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response Elements:
n featureType: all attributes of the feature type
FME Server REST API Specifications 27
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/readers/SHAPE_1/ra-ilroad.format
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse><requestURI>/fme-rest/repositories/Samples/austinDownload/writers/GENERIC_1/railroad</requestURI>
<featureType><name>railroad</name><description/><attribute>
<decimals>5</decimals><fme_type>decimal</fme_type><width>24</width><name>LENGTH</name>
</attribute><attribute>
<decimals>0</decimals><fme_type>char</fme_type><width>30</width><name>SOURCE</name>
</attribute></featureType>
</serviceResponse>
GET /repositories/<repository>/<workspace>/parameters
Returns all the published parameters of the workspace
URI:
/fmerest/repositories/<repository>/<workspace>/parameters.<format>
Formats:
REST API Documentation
28 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n parameters: list of published parameters
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/parameters.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse> <requestURI>/fme-rest/repositories/Samples/austinDownload/parameters</reque-stURI>
<parameters><parameter>
<name>THEMES</name><description>Layers to Download:</description><defaultValue>airports</defaultValue><optionsType>MULTICHOICE_CONFIG</optionsType><type>LISTBOX</type><options>
<option><value>airports</value></option><option><value>cenart</value></option><option><value>railroad</value></option><option><value>streetcl</value></option>
</options></parameter> <parameter>
<name>BBOX_COORDSYS</name>
FME Server REST API Specifications 29
<description>Search Envelope CoordinateSystem:</description>
<defaultValue>LL84</defaultValue><optionsType>DEFAULT</optionsType><type>COORDSYS</type><options></options>
</parameter></parameters>
</serviceResponse>
GET /repositories/<repository>/<workspace>/properties
Returns all the workspace properties
URI:
/fmerest/repositories/<repository>/<workspace>/properties.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n properties: list of published parameters
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/properties.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
REST API Documentation
30 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
<requestURI>/fme-rest/repositories/Samples/austinDownload/properties</reque-stURI>
<properties><property>
<category>fmedatastreaming_FMEUSERPROPDATA</category><name>OUTPUT_WRITER</name><value>OGCKML_1</value>
</property><property>
<category>fmekmllink_FMEUSERPROPDATA</category><name>NetworkLink/Link/viewFormat</name><value>BBOX=[bboxWest],[bboxSouth],[bboxEast],[bbox-
North]</value></property><property>
<category>fmekmllink_FMEUSERPROPDATA</category><name>NetworkLink/Link/refreshMode</name><value>onInterval</value>
</property></properties>
</serviceResponse>
POST /repositories/<repository>/<workspace>/properties (update)
Adds a new or updates an existing workspace property
URI:
/fmerest/repositories/<repository>/<workspace>/property.<for-mat>
Formats:
xml, json, html
HTTP Method(s):
POST
Parameters:
FME Server REST API Specifications 31
n category: required. The property category
n name: required. The property name
n value: required. The property value
n attributes: optional. The list of attributes in comma-delimitedname/value pairs
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/properties
POST parameters:
category=test
name=myprop
value=propvalue
DELETE /repositories/<repository>/<workspace>/properties (remove)
Removes an existing workspace property
URI:
/fmerest/repositories/<repository>/<workspace>/properties.<format>
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
REST API Documentation
32 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
n category: required. The property category
n name: required. The property name
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http:/-/loca-lhost/fmerest/repositories/Samples/austinDownload/properties?category=test&name=myprop
Workspace Service Methods
GET /repositories/<repository>/<workspace>/<service>
Returns the resources of the service registered with this workspace
URI:
/fmerest/repositories/<repository>/<workspace>/<service>.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n repository: the repository name
n workspace: the workspace name and published parameters
n service: the details of specified service, including name, display nameand URL pattern
n properties: URI of the service specific properties of this workspace
FME Server REST API Specifications 33
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinApartments/fmekmllink.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse> <requestURI>/fme-rest/repositories/Samples/austinApartments/fmekmllink</requestURI>
<workspaceService><service>
<name>fmekmllink</name><displayName>KML Network Link</displayName><urlPattern>http://SHOCKWAVE:8080/fmekmllink</url-
Pattern></service><repository>
<name>Samples</name></repository><workspace>
<name>austinApartments.fmw</name><parameters>
<parameter><name>SourceDataset_ACAD</name><description>Source AutoCAD File:</description><defaultValue>C:/Program Files (x86)/FM-
EServer/Server/SampleData/austin/Landmarks/Landmarks.dwg</defaultValue>
<optionsType>FILEFILTER_CONFIG</optionsType><type>MULTIFILE</type><options>
<option><value>DWG_Files(*.dwg)/DXF_Files(*.dxf)
|*.dwg;*.dxf|DWG_Files(*.dwg)|*.dwg|DXF_Files(*.dxf)|*.dxf|All_Files|*.*</value>
</option>
REST API Documentation
34 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
</options></parameter>
</parameters></workspace><properties> <uri>/fme-
rest/re-positories/Samples/austinApartments/fmekmllink/properties</uri>
<name>properties</name></properties>
</workspaceService></serviceResponse>
GET /repositories/<repository>/<workspace>/<service>/properties
Returns the workspace properties related to the specified service
URI:
/fmerest/repositories/<repository>/<workspace>/<service>/pr-operties.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n properties: list of published parameters
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/fmekmllink /pro-perty.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?>
FME Server REST API Specifications 35
<serviceResponse><properties>
<property><category>fmekmllink_FMEUSERPROPDATA</category><name>NetworkLink/Link/viewFormat</name><value>BBOX=[bboxWest],[bboxSouth],[bboxEast],[bbox-
North]</value></property><property>
<category>fmekmllink_FMEUSERPROPDATA</category><name>NetworkLink/Link/refreshMode</name><value>onInterval</value>
</property></properties>
</serviceResponse>
POST /repositories/<repository>/<workspace>/<service>/properties(update)
Adds a new or updates an existing workspace property related to the spec-ified service
URI:
/fmerest/repositories/<repository>/<workspace>/<service>/pr-operties.<format>
Formats:
xml, json, html
HTTP Method(s):
POST
Parameters:
n name: required. The property name
n value: required. The property value
REST API Documentation
36 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
n attributes: optional. The list of attributes in comma-delimitedname/value pairs
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http:/-/localhost/fmerest/repositories/Samples/austinDownload/fmedatadownload/properties
POST parameters:
name=testvalue=myvalue
DELETE /repo-sitories/<repository>/<workspace>/<service>/properties/<property>(remove)
Removes an existing workspace property related to the specified service
URI:
/fmerest/repositories/<repository>/<workspace>/<service>/pr-operties/<property>.<format>
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
n none
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
FME Server REST API Specifications 37
http:/-/loca-lhost/fmerest/repositories/Samples/austinDownload/fmekmllink/properties/testprop
Resource Methods
GET /repositories/<repository>/<item>/resources
Returns all the resources of the item (workspace, custom format or customtransformer)
URI:
/fmerest/repositories/<repository>/<item>/resources.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n resources: list of item resources
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/resources.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse> <requestURI>/fme-rest/repositories/Samples/austinApartments/resources</reque-stURI>
<resources><resource>
REST API Documentation
38 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
<name>roads.shp</name><description/>
<uri>/fmerest/repositories/Samples/austinDownload/resources/roads.shp</uri>
</resource></resources>
<resource><name>airports.shp</name><description/>
<uri>/fmerest/repositories/Samples/austinDownload/resources/ai-rports.shp</uri>
</resource></resources>
</serviceResponse>
GET /repositories/<repository>/<item>/resources/<resource>
Downloads the specified resource file of the item (workspace, custom formator custom transformer)
URI:
/fme-rest/repositories/<repository>/<item>/resources/<resource>
Formats:
application/octet-stream
HTTP Method(s):
GET
Parameters:
FME Server REST API Specifications 39
n none
Response elements:
n The resource file is returned as HTTP stream if the operation is suc-cessful, otherwise error code and message will be returned in therequested format
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/resources/data.shp
PUT /repositories/<repository>/<item>/resources/<resource> (create,update)
Uploads a resource file for the specified item (workspace, custom formator custom transformer) in repository. The old resource file will be over-written if it already exists.
URI:
/fmerest/repositories/<repository>/<item>/resources/<resource>.<format>
Formats:
xml, json, html
HTTP Method(s):
PUT
Parameters:
n resource file: required. The resource file is attached to PUT requestbody
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/repositories/Samples/myworkspace/resources/data.csv
REST API Documentation
40 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
POST /repositories/<repository>/<item>/resources (create, update)
Uploads a resource file for the specified item (workspace, custom format orcustom transformer) in repository. The old resource file will be overwrittenif it already exists.
URI:
/fmerest/repositories/<repository>/<item>/resources.<format>
Formats:
xml, json, html
HTTP Method(s):
POST
Parameters:
n resource: the resource name
n resource file: required. The resource file is attached to PUT requestbody
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/repositories/Samples/myworkspace/resources
POST parameters:
This POST request needs to contain a multipart/mixed request body.
Parts:
n resource: data.csv
n <file content>
DELETE /repositories/<repository>/<item>/resources/<resource>(remove)
Removes the specified resource file of the item
FME Server REST API Specifications 41
URI:
/fmerest/repositories/<repository>/<item>/resources/<resource>.<format>
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
n none
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/repositories/Samples/myworkspace/resources/data.csv
Item Action Methods
GET, POST /repositories/<repository>/<workspace>/run
Run an FME transformation job using the specified workspace
URI:
/fmerest/repositories/<repository>/<workspace>/run.<format>
Formats:
xml, json, html
HTTP Method(s):
GET, POST
Parameters:
REST API Documentation
42 FME Server REST API Specifications
Workspace, Custom Format and Custom Transformer Methods
n opt_servicemode: required. The value is either ‘sync’ or ‘async’, whichspecifies if the job will run synchronously or asynchronously respec-tively.
n subsection: optional. The subsection name for this transformationrequest. The default value is ‘REST_SERVICE’ if not specified.
n published parameters: optional. Workspace published parameterspassed in as name/value pairs in query URL for GET or in messagebody for POST
n TM directives: optional. Prefixed with ‘tm_’, passed in by the sameway as published parameters.
n NM directives: optional. Prefixed with ‘nm_’, passed in by the sameway as published parameters.
Response elements:
n fmeTransformationResult: the transformation result returned fromFME Server, if opt_servicemode is ‘sync’
n jobID: the ID of the transformation job, if opt_servicemode is ‘async’
Sample request URL:
Example 1:
http:/-/loca-lhost/fmerest/repositories/Samples/austinDownload/run.xml?opt_servicemode=sync
Example 2:
http:/-/loca-lhost/fmerest/repositories/Samples/austinDownload/run.html?opt_servicemode=async&nm_jobsuccess_topic=JOB_SUCCESS&nm_jobfailure_topic=JOB_FAILURE
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?>
FME Server REST API Specifications 43
<serviceResponse> <requestURI>/fme-rest/repositories/Samples/austinDownload/run</requestURI>
<fmeTransformationResult><fmeServerResponse>
<serviceSuccess>true</serviceSuccess><id>90</id><requestKeyword>REST_SERVICE</requestKeyword><!--Other auxilary properties of the result are
skipped here--> </fmeServerResponse><fmeEngineResponse>
<statusMessage>Translation Successful</statusMessage><statusNumber>0</statusNumber><NumFeaturesOutput>49</NumFeaturesOutput>
</fmeEngineResponse></fmeTransformationResult><jobID>90</jobID>
</serviceResponse>
PUT /repositories/<repository>/<item>/registration/<service> (create)
Registers the item with the specified service
URI:
/fmerest/repositories/<repository>/<item>/registration/<service>
Formats:
xml, json, html
HTTP Method(s):
PUT
Parameters:
n none
Response:
REST API Documentation
44 FME Server REST API Specifications
Service Management
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http:/-/loca-lhost/fmerest/repositories/Samples/austinDownload/registration/fmedatastreaming
DELETE /repositories/<repository>/<item>/registration/<service>(remove)
Unregisters the item with the specified service
URI:
/fme-rest/repositories/<repository>/<item>/registration/<service>
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
n none
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http:/-/localhost/fmerest/repository/Samples/austinDownload/registration/fmedatadownload
Service ManagementGET /services
Returns all the available services
URI:
FME Server REST API Specifications 45
/fmerest/services.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n services: list of all services
Sample request URL:
http://localhost/fmerest/services.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fmerest/services</requestURI><services>
<service><uri>/fmerest/services/fmedatadownload</uri><isEnabled>true</isEnabled><description>This service accepts and carries out
transformation requests as specified by aworkspace.</description>
<name>fmedatadownload</name><displayName>Data Download</displayName>
<isWorkspaceRegistrationAllowed>true</isWorkspaceRegistrationAllowed>
</service><service>
<uri>/fmerest/services/fmedatastreaming</uri><isEnabled>true</isEnabled>
REST API Documentation
46 FME Server REST API Specifications
Service Management
<description>This service accepts and carries outtransformation requests as specified by a workspace andreturns the results as a data stream.</description>
<name>fmedatastreaming</name><displayName>Data Streaming</displayName>
<isWorkspaceRegistrationAllowed>true</isWorkspaceRegistrationAllowed>
</service><service>
<uri>/fmerest/services/fmedataupload</uri><isEnabled>true</isEnabled><description>This service accepts uploaded files for
subsequent use in transformation requests.</description><name>fmedataupload</name>
<displayName>Data Upload</displayName> <isWorkspaceRegistrationAllowed>false
</isWorkspaceRegistrationAllowed></service><service>
<uri>/fmerest/services/fmejobsubmitter</uri><isEnabled>true</isEnabled><description>This service accepts and runs workspace
job requests.</description><name>fmejobsubmitter</name>
<displayName>Job Submitter</displayName> <isWorkspaceRegistrationAllowed>true
</isWorkspaceRegistrationAllowed></service><service>
<uri>/fmerest/services/fmekmllink</uri><isEnabled>true</isEnabled><description>This service accepts and carries out
transformation requests as specified by a workspace andreturns the results as a KML network link.</description>
<name>fmekmllink</name><displayName>KML Network Link</displayName>
FME Server REST API Specifications 47
<isWorkspaceRegistrationAllowed>true</isWork-spaceRegistrationAllowed>
</service> <service>
<uri>/fmerest/services/WMS</uri><isEnabled>true</isEnabled><description>This service supplies WMS
functionality.</description><name>WMS</name>
<displayName>OGC Web Mapping Service</displayName> <isWorkspaceRegistrationAllowed>true
</isWorkspaceRegistrationAllowed></service>
</services> </serviceResponse>
GET /services/<service>
Returns the specified service
URI:
/fmerest/services/<service>.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n name: the service name
n description: the service description
n isEnabled: indicates if the service is enabled
REST API Documentation
48 FME Server REST API Specifications
Service Management
n displayName: the service display name
n isWorkspaceRegistrationAllowed: indicates if the service allows work-space registration
Sample request URL:
http://localhost/fmerest/services/fmedatadownload.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fmerest/services/fmedatadownload</requestURI><service>
<isEnabled>true</isEnabled><description>This service accepts and carries out trans-
formation requests as specified by a workspace.</description><name>fmedatadownload</name>
<displayName>Data Download</displayName><isWorkspaceRegistrationAllowed>true</isWorkspaceRegistrationAllowed>
<urlPattern>http://local/fmedatadownload</urlPattern></service></serviceResponse>
PUT /services/<service> (create, update)
Creates a new or updates an existing service
URI:
/fmerest/services/<service>.<format>
Formats:
xml, json, html
HTTP Method(s):
PUT
Parameters:
FME Server REST API Specifications 49
n description: required. The service description
n displayname: required. The service display name
n urlpattern: required. The service URL pattern
n isenabled: required. It specifies if the service is enabled
n isregallowed: required. It specifies if the service allows workspaceregistration
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http:/-/loca-lhost/fmerest/services/mynewservice?displayname=mynewservice&description=testservice&urlpattern=http://localhost/mynewservice&isenabled=true&isregallowed=true
POST /services (create, update)
Creates a new or updates an existing service
URI:
/fmerest/services.<format>
Formats:
xml, json, html
HTTP Method(s):
POST
Parameters:
n service: required. The service name
n description: required. The service description
n displayname: required. The service display name
n urlpattern: required. The service URL pattern
REST API Documentation
50 FME Server REST API Specifications
Service Management
n isenabled: required. It specifies if the service is enabled
n isregallowed: required. It specifies if the service allows workspace reg-istration
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/services
POST parameters:
service=mynewservicedisplayname=mynewservicedescription=testserviceurlpattern=http://localhost/mynewserviceisenabled=trueisregallowed=true
DELETE /services/<service> (remove)
Removes an existing service
URI:
/fmerest/services/<service>.<format>
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
n none
Response:
FME Server REST API Specifications 51
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/services/mynewservice
GET /services/<service>/properties
Returns the service specific properties
URI:
/fmerest/services/<service>/properties.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n properties: list of published parameters
Sample request URL:
http://localhost/fmerest/services/fmedatadownload/properties.xml
Sample response (XML):
<?xml version="1.0" encoding="ISO-8859-1"?><serviceResponse>
<requestURI>/fmerest/services/fmedatadownload</requestURI><properties>
<property><category>FMEUSERPROPSCHEMA</category><name>OUTPUT_WRITER</name>
REST API Documentation
52 FME Server REST API Specifications
Service Management
<value>ALL</value><attribute>
<name>gui</name><value>GUI OPTIONAL TEXT OUTPUT_WRITER Desired Out-
put Writer:</value></attribute><attribute>
<name>fme_global_id</name><value>0</value>
</attribute><attribute>
<name>option</name><value>WRITER_LISTBOX</value>
</attribute> </property>
</properties></serviceResponse>
POST /services/<service>/properties (update)
Adds a new or updates an existing service specific property
URI:
/fmerest/services/<service>/properties.<format>
Formats:
xml, json, html
HTTP Method(s):
POST
Parameters:
n category: required. The property category
n name: required. The property name
n value: required. The property value
FME Server REST API Specifications 53
n attributes: optional. The list of attributes in comma-delimitedname/value pairs
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/services/fmedatadownload/properties
POST parameters:
category=newcategoryname=mypropvalue=myvalue
DELETE /services/<service>/properties (remove)
Removes an existing service specific property
URI:
/fmerest/services/<service>/properties.<format>
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
n category: required. The property category
n name: required. The property name
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
REST API Documentation
54 FME Server REST API Specifications
Service Management
http:/-/loca-lhost/fmerest/services/fmedatadownload/properties?category=newcategory&name=myprop
GET/services/<service>/registration
Returns the workspaces, custom formats and custom transformers reg-istered with this service
URI:
/fmerest/services/<service>/registration.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n workspaces: list of workspaces
n customFormats: list of custom formats
n customTransformers: list of custom transformers
Sample request URL:
http://localhost/fmerest/services/fmedatadownload/registration.xml
Sample response (XML):
<serviceResponse><reque-stURI>/fmerest/services/fmecatalog/registration</requestURI><workspaces>
<workspace><name>austinApartments.fmw</name><uri>/fm-erest/repositories/Samples/austinApartments</uri>
FME Server REST API Specifications 55
<dis-playName>Samples/austinApartments.fmw</displayName><repository>Samples</repository><title>City of Austin: Apartments and other (ACAD 2KML)</title><description>
Filters DWG points with attributes by name into cat-egories (apartments,shopping, schools, airports),styles the points by category and then writes thepoints to KML.
</description></workspace>
</workspaces><customFormats>
<customFormat><name>GPS_ROAD.fds</name><uri>/fmerest/repositories/Samples/GPS_ROAD.fds</uri><displayName>Samples/GPS_ROAD.fds</displayName><repository>Samples</repository><title>My GPS Road</title><description/>
</customFormat></customFormats><customTransformers>
<customTransformer><name>KMLDiagrammer.fmx</name><uri>/fm-erest/repositories/Samples/KMLDiagrammer.fmx</uri><displayName>Samples/KMLDiagrammer.fmx</displayName><repository>Samples</repository><title>KMLDiagrammer</title><description/>
</customTransformer></customTransformers></serviceResponse>
Transformation ManagementGET /jobs
Returns all job categories
REST API Documentation
56 FME Server REST API Specifications
Transformation Management
URI:
/fmerest/jobs.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n running: URI to get running jobs
n completed: URI to get completed jobs
n scheduled: URI to get scheduled jobs
n queued: URI to get queued jobs
Sample request URL:
http://localhost/fmerest/job.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fmerest/jobs</requestURI><categories>
<category><name>running</name><description>running jobs</description><uri>/fmerest/job/running</uri>
</category><category>
<name>completed</name><description>completed jobs</description>
<uri>/fmerest/job/completed</uri>
FME Server REST API Specifications 57
</category><category>
<name>scheduled</name><description>scheduled jobs</description>
<uri>/fmerest/job/scheduled</uri></category><category>
<name>queued</name><description>queued jobs</description><uri>/fmerest/job/queued</uri>
</category></categories>
</serviceResponse>
GET /jobs/running
Returns all running jobs
URI:
/fmerest/jobs/running.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n joblimit: optional. The starting point and the duration of the jobsbeing returned. Comma is used for delimiter. For example, the value"0,10" means the first job will start at position 0 and 10 subsequentjobs will be returned.
Response elements:
n jobs: list of jobs
Sample request URL:
http://localhost/fmerest/jobs/running.xml
REST API Documentation
58 FME Server REST API Specifications
Transformation Management
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fmerest/jobs/running</requestURI><jobs>
<job><id>1</id>
<uri>/fmerest/job/1</uri> </job>
<job><id>2</id>
<uri>/fmerest/job/2</uri> </job>
</jobs></serviceResponse>
GET /jobs/completed
Returns all completed jobs
URI:
/fmerest/jobs/completed.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n joblimit: optional. The starting point and the duration of the jobs beingreturned. Comma is used for delimiter. For example, the value "0,10"means the first job will start at position 0 and 10 subsequent jobs willbe returned.
Response elements:
n jobs: list of completed jobs
FME Server REST API Specifications 59
Sample request URL:
http://localhost/fmerest/jobs/completed.xml?joblimit=0,10
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fmerest/jobs/completed</requestURI><jobs>
<job><id>1</id>
<uri>/fmerest/jobs/1 </uri> </job>
<job><id>2</id>
<uri>/fmerest/jobs/2 </uri> </job>
</jobs></serviceResponse>
DELETE /jobs/completed
Deletes completed jobs.
URI:
/fmerest/jobs/completed
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
REST API Documentation
60 FME Server REST API Specifications
Transformation Management
n range: optional. The range of job IDs to be deleted, e.g. range=1-20
n maxage: optional. The max age (in days) of completed jobs. Any jobsolder will be deleted.
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/job/completed
(Delete all completed jobs)
http://localhost/fmerest/job/completed?range=1-20
(Delete the jobs with IDs between 1 and 20)
http://localhost/fmerest/job/completed?maxage=5
(Delete the jobs which are more than 5 days old)
GET /jobs/queued
Returns all queued jobs
URI:
/fmerest/jobs/queued.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n joblimit: optional. The starting point and the duration of the jobs beingreturned. Comma is used for delimiter. For example, the value "0,10"means the first job will start at position 0 and 10 subsequent jobs willbe returned.
Response elements:
FME Server REST API Specifications 61
n jobs: list of queued jobs
Sample request URL:
http://localhost/fmerest/jobs/queued.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>\
<requestURI>/fmerest/jobs/queued</requestURI><jobs>
<job><id>5</id>
<uri>/fmerest/jobs/5</uri> </job>
<job><id>6</id>
<uri>/fmerest/jobs/6</uri> </job>
</jobs></serviceResponse>
GET /jobs/<id>
Returns the job specified by job ID
URI:
/fmerest/jobs/<id>.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
REST API Documentation
62 FME Server REST API Specifications
Transformation Management
n job: the job entry including all properties
Sample request URL:
http://localhost/fmerest/jobs/1.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fmerest/jobs/1</requestURI><job>
<FMEEngineHost>SHOCKWAVE</FMEEngineHost><FMEEngineName>Engine1</FMEEngineName><ID>1</ID><dateDelivered>Mon Sep 13 12:18:35 PDT 2010</dat-
eDelivered><dateFinished>Mon Sep 13 12:18:35 PDT
2010</dateFinished><dateQueued>Mon Sep 13 12:18:26 PDT 2010</dateQueued><dateRequested>Mon Sep 13 12:18:26 PDT 2010</dat-
eRequested><dateStarted>Mon Sep 13 12:18:26 PDT 2010</dateStarted><dateSubmitted>Mon Sep 13 12:18:26 PDT 2010</date-
Submitted><description/><jobStatus>SUCCESS</jobStatus><request>0</request><transformationRequest>
<FMEDirectives></FMEDirectives><TMDirectives>
<complexity>null</complexity><fmeInstance/><fmeHost/><outputFormatTag/><requesterHost>SHOCKWAVE</requesterHost><apiVersion>1</apiVersion><jobID>1</jobID>
FME Server REST API Specifications 63
<priority>100</priority><timeRequested>Mon-13-Sep-2010 12:18:26 PM</tim-
eRequested><requesterResultPort>49533</requesterResultPort><description/><requesterEmail/><secondsFromNow>null</secondsFromNow>
</TMDirectives><publishedParameters>
<token>c759eaf09e4638954f63ace0ce1b53b40f62ccb7</token></publishedParameters><subsection>REST_SERVICE</subsection><workspacePath>"Sam-
ples/austinApartments/austinApartments.fmw"</work-spacePath>
</transformationRequest></job>
</serviceResponse>
GET /jobs/<id>/result
Returns the transformation job result
URI:
/fmerest/jobs/<id>/result.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
REST API Documentation
64 FME Server REST API Specifications
Transformation Management
n result: the result entry including all result properties
Sample request URL:
http://localhost/fmerest/jobs/1/result.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<fmeTransformationResult><fmeServerResponse>
<id>1</id><jobStatus>SUCCESS</jobStatus><resultSuccess>true</resultSuccess><serviceMsg>success</serviceMsg><serviceSuccess>true</serviceSuccess><timeRequested>Mon-13-Sep-2010 12:18:26 PM</tim-
eRequested><!--Other auxilary properties of the FME transformationresult are skipped here-->
</fmeServerResponse><fmeEngineResponse>
<statusNumber>0</statusNumber><statusMessage>Translation Successful</statusMessage><NumFeaturesOutput>49</NumFeaturesOutput><LogFileLocation>C:/Program Files (x86)/FM-
EServer/Logs/rest/FME_5D150E1F_1284405506417_4304.log</Log-FileLocation><LogFileName>rest/FME_5D150E1F_1284405506417_4304.log</LogFileName>
</fmeEngineResponse></fmeTransformationResult>
</serviceResponse>
Job Status Values
The <jobStatus> element can have the following values:
FME Server REST API Specifications 65
Value Description
SUBMITTED The job has been received by the FME Server but has notbeen added to the job queue.
QUEUED The job has been added to the job queue and is waiting for afree FME Engine before it is processed.
ABORTED The job has been aborted.
SUCCESS The job has completed and the FME Engine reported that thetransformation was successful.
FME_FAIL-URE
The job has completed, but the FME Engine reported a failurewhile attempting to run the transformation.
JOB_FAIL-URE
The FME Server could not process the job.
PULLED The job has been pulled from the job queue and is being proc-essed by the FME Engine.
POST /jobs/<id>/cancel
Cancels the transformation job specified by ID
URI:
/fmerest/jobs/<id>/cancel.<format>
Formats:
xml, json, html
HTTP Method(s):
POST
Parameters:
n none
Response:
REST API Documentation
66 FME Server REST API Specifications
Transformation Management
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/jobs/1/cancel.xml
POST /jobs/running/cancel
Cancels all running jobs
URI:
/fmerest/jobs/running/cancel.<format>
Formats:
xml, json, html
HTTP Method(s):
POST
Parameters:
n none
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/jobs/running/cancel.xml
POST /jobs/queued/cancel
Cancels all queued jobs
URI:
/fmerest/jobs/queued/cancel.<format>
Formats:
xml, json, html
HTTP Method(s):
FME Server REST API Specifications 67
POST
Parameters:
n none
Response:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/jobs/queued/cancel.xml
GET /engines
Returns the available FME Engines
URI:
/fmerest/engines.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n engines: list of FME Engines
Sample request URL:
http://localhost/fmerest/engines.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fmerest/engines</requestURI>
REST API Documentation
68 FME Server REST API Specifications
Schedule Management
<engines><engine>
<currentJobID>5</currentJobID><fmeBuildNumber>6200</fmeBuildNumber><fmeHostName>SHOCKWAVE</fmeHostName><fmeInstanceName>SHOCKWAVE_1</fmeInstanceName><maxTransactionResultSuccess>100</max-
TransactionResultSuccess><maxTransactionResultFailure>100</max-
TransactionResultFailure><resultSuccessCount>10</resultSuccessCount><resultFailureCount>1</resultFailureCount><transactionPort>7100</transactionPort>
</engine></engines>
</serviceResponse>
Schedule ManagementGET /repositories/<repository>/<workspace>/schedule
Returns all scheduled tasks for the specified workspace
URI:
/fmerest/repositories/<repository>/<workspace>/schedule.<for-mat>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
FME Server REST API Specifications 69
n category: the task category
n name: the task name
n description: the task description
n trigger
n type: the trigger type (Cron or DateInterval)
n intervalUnit: the unit of repeat interval (for DateInterval triggeronly)
n repeatInterval: the repeat interval
n startTime: the task start-time
n endTime: the task end-time
n expression: the Cron expression (for Cron trigger only)
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/schedule.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse> <requestURI>/fme-rest/repositories/Samples/austinDownload/schedule</reque-stURI>
<tasks><task>
<name>test2</name><description>test task 2</description><category>new</category><trigger>
<type>DateInterval</type><intervalUnit>HOUR</intervalUnit><repeatInterval>1</repeatInterval><startTime>Wed Sep 22 00:00:00 PDT 2010</startTime><endTime>Thu Sep 23 00:00:00 PDT 2010</endTime>
REST API Documentation
70 FME Server REST API Specifications
Schedule Management
</trigger></task> <task>
<name>test1</name><description>test task 1</description><category>new</category><trigger>
<type>DateInterval</type><intervalUnit>MINUTE</intervalUnit><repeatInterval>5</repeatInterval><startTime>Tue Sep 21 00:00:00 PDT 2010</startTime><endTime>Wed Sep 22 00:00:00 PDT 2010</endTime>
</trigger></task>
</tasks></serviceResponse>
GET /repositories/<repository>/<workspace>/schedule/request
Returns the FME transformation request for a scheduled task
URI:
/fmerest/repositories/<repository>/<workspace>/sch-edule/request.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n category: the task category
n name: the task name
Response elements:
n fmeTransformationRequest: the FME transformation request
FME Server REST API Specifications 71
Sample request URL:
http:/-/loca-lhost/fmerest/repositories/Samples/austinDownload/schedule.xml?category=new&name=test1
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse> <requestURI>/fme-rest/repositories/Samples/austinDownload/schedule/reque st
</requestURI><fmeTransformationRequest>
<FMEDirectives></FMEDirectives><TMDirectives></TMDirectives><publishedParameters></publishedParameters><subsection>REST_SERVICE</subsection><workspacePath>Sam-
ples/austinDownload/austinDownload.fmw</workspacePath>
</fmeTransformationRequest></serviceResponse>
POST /repositories/<repository>/<workspace>/schedule
Add a scheduled task for the specified workspace
URI:
/fmerest/repositories/<repository>/<workspace>/schedule.<format>
Formats:
xml, json, html
HTTP Method(s):
POST
Parameters:
REST API Documentation
72 FME Server REST API Specifications
Schedule Management
n category: the task category
n name: the task name
n description: optional. The task description
n trigger: the trigger type, either ‘cron’ (Cron trigger) or ‘dateint’ (dateinterval trigger)
n start: optional. The starting time of the scheduled task. The default isstarting immediately.
n end: optional. The ending time of the scheduled task. The default isnever ending.
n repeatint: optional but the ‘unit’ parameter must also be specified ifthis parameter is specified. The repeat interval indicated by an integervalue. (date interval trigger only)
n unit: optional but the ‘repeatint’ parameter must also be specified ifthis parameter is specified. The interval unit for date interval triggeronly. The accepted values are: SECOND, MINUTE, DAY, HOUR, WEEK,MONTH, YEAR
n expression: the Cron expression (Cron trigger only)
n subsection: optional. The subsection name for this transformationrequest. The default value is ‘REST_SERVICE’.
n published parameters: optional. Workspace published parameterspassed in as name/value pairs.
n TM directives: optional. Prefixed with ‘tm_’, passed in as name/valuepairs.
Response elements:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/repositories/Samples/austinDownload/schedule
POST parameters:
FME Server REST API Specifications 73
category=NewCategoryname=NewTask1description=TestTasktrigger=dateintstart=2010-09-24end=2010-09-25repeatint=1unit=HOURTHEMES=roads
DELETE /repositories/<repository>/<workspace>/schedule
Delete a scheduled task
URI:
/fmerest/repositories/<repository>/<workspace>/schedule.<format>
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
n category: the task category
n name: the task name
Response elements:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http:/-/loca-lhost/fmerest/repositories/Samples/austinDownload/schedule?category=NewCategory&name=NewTask1
REST API Documentation
74 FME Server REST API Specifications
Notifications
NotificationsOverview
Status Return Codes
The following are the HTTP status return codes for the Notifications API calls:
ReturnCode
Description
200 Successful completion of the requested task or operation.
201 When an object is created; response includes URL to retrieve thenewly created object.
202 After a request to initiate an operation that is currently pending,queued, or not yet complete.
204 Successful delete, indicating there is no content.
400 Improperly formatted request.
401 Attempt to access, modify, or create an object when the currentuser is not authenticated.
403 Attempt to access, modify, or create an object when the currentuser has insufficient permissions to do so.
404 Attempt to update a non-existent object unavailable to the user.
409 Attempt to create an object that already exists .
415 Any of the following:
n A request body format other than XML or JSON
n Using a request body for requests that do not allow bodies(only support query-string parameters).
n Making a request without a JSON or XML request body for arequest that requires one.
501 The call's request method/URI is unsupported by the API.
FME Server REST API Specifications 75
Error Conditions
All error return codes include an accompanying response body formattedaccording to the extension (see "Content Types" on the facing page). Thisresponse body contains additional details about the error that occurred,including a statusInfo object with at least a nested message property con-taining a description of the error.
The following table shows additional properties nested beneath the stat-usInfo object, by error code:
ErrorCode
Error Mean-ing
Status Info Prop-erty
Property Meaning
404 Not found what The name of the resourcethat was not found or doesnot exist.
409 Resourceconflict
resource The object that alreadyexists on the server.
415 Unsupportedmedia type
mediaType The content-type specifiedin the request
supportedTypes<types>
A list of format types sup-ported by the URL. For for-mat types that correspondto MIME content types, see"Content Types" on the fac-ing page.
Sample Response – JSON
HTTP Status 415 – Unsupported Media Type
{"serviceResponse":{
"statusInfo":{"mediaType":"application/xv+xml; charset=UTF-8","message":"The media type \"application/xv+xml; char-set=UTF-8\" is not supported by this URL, these arethe allowed types: [JSON, XML, FORM]",
REST API Documentation
76 FME Server REST API Specifications
Notifications
"supportedTypes":["JSON","XML","FORM"
]},"reque-stURI":"/fmerest/notifications/subscriptions.json","token":"0f0c6960f0569f6e2595215911fdfc66b54eb029"
}}
Sample Response – XML
HTTP Status 415 – Unsupported Media Type
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<statusInfo><mediaType>multipart/form-data; charset=UTF-8</me-diaType><message>The media type "multipart/form-data; char-set=UTF-8" is not supported by this URL, these are theallowed types: [JSON, XML, FORM]</message><supportedTypes>
<type>JSON</type><type>XML</type><type>FORM</type>
</supportedTypes></statusInfo><reque-stURI>/fm-erest/notifications/subscriptions.xml</requestURI><token>0f0c6960f0569f6e2595215911fdfc66b54eb029</token>
</serviceResponse>
Content Types
Request
A few REST calls require a request body entity that mandates setting therequest Content-Type header that appropriately identifies the data. This
FME Server REST API Specifications 77
header does not determine the content-type of the response; the URL exten-sion is used for that purpose.
MIME Type Format Type
application/xml XML
text/xml
application/json JSON
text/json
application/x-www-form-urlencoded FORM
multipart/form-data MultiPartResponse
URL extension Format Type
*.xml XML
*.json JSON
Request Methods
Certain semantics apply to each request method. In order to preserve con-vention, the following general rules apply for each request method:
l GET – Retrieves data from the server (either an object or a list) anddoes not make any modifications to the server (no side-effects,idempotent).
l PUT – Replaces data on the server (either an object or a list), nodata that was present before persists, it is completely replaced withthe data specified in the request, and there are no other side-effects(idempotent).
l DELETE – Removes data from the server (a single object or a com-plete list) and does not result in any other side-effects (idem-potent).
REST API Documentation
78 FME Server REST API Specifications
Notifications
l POST – Used to create data on the server (a single object or a com-plete list), but in general is reserved for any kind of operation. Referto the task-specific documentation whenever this method isemployed. Side-effects are common (non-idempotent).
XML Versus JSON
The dialect of XML used in this section is slightly different than the generatedJSON. Whenever an array/collection of elements occurs in a response, orwhenever it is required in the request body, there is an additional wrappingelement whose name takes on the singular form of the parent array/col-lection element name’s plural form. For example, an element called “topics”in JSON contains the children directly under, whereas in XML the element con-tains nested “topic” elements, each containing one child. This asymmetryaddresses fundamental differences between the JSON and XML syntax.
Topic Management
Properties
topics The collection of topics available to the user on the server.
topic An individual topic object, follows beneath the topics ele-ment.
name Uniquely identifies the topic.
description Detailed description of the topic’s role and purpose.
Calls
Retrieve a List of Topics
URI:
GET /notifications/topics.<format>
Sample Response - JSON
GET /notifications/topics.json
{"serviceResponse":{
"requestURI":"/fmerest/notifications/topics.json",
FME Server REST API Specifications 79
"token":"0f0c6960f0569f6e2595215911fdfc66b54eb029","topics":[
{"description":"A notification for this topic isgenerated when an FME transformation fails.","name":"JOB_FAILURE"
},{
"description":"A notification for this topic isgenerated when an FME transformation succeeds.","name":"JOB_SUCCESS"
},{
"description":"This is a sample topic.","name":"SAMPLE_TOPIC"
}]
}}
Sample Response- XML
GET /notifications/topics.xml
<?xml version="1.0"?><serviceResponse>
<reque-stURI>/fmerest/notifications/topics.xml</requestURI>
<token>0f0c6960f0569f6e2595215911fdfc66b54eb029</token><topics>
<topic><description>A notification for this topic is
generated when an FME transformation fails.</description><name>JOB_FAILURE</name>
</topic><topic>
REST API Documentation
80 FME Server REST API Specifications
Notifications
<description>A notification for this topic isgenerated when an FME transformation succeeds.</description>
<name>JOB_SUCCESS</name></topic><topic>
<description>This is a sample topic.<-/description>
<name>SAMPLE_TOPIC</name></topic>
</topics></serviceResponse>
Retrieve Details on a Single Topic
URI:
GET /notifications/topics/<name>.<format>
Sample Response - JSON
GET /notifications/topics/JOB_SUCCESS.json
{"serviceResponse":{
"requestURI":"/fmerest/notifications/topics/JOB_SUC-CESS.json","token":"0f0c6960f0569f6e2595215911fdfc66b54eb029","topic":{
"name":"JOB_SUCCESS","description":"A notification for this topic is gen-erated when an FME transformation succeeds."
}}
}
Sample Response - XML
GET /notifications/topics/JOB_SUCCESS.xml
<?xml version="1.0"?><serviceResponse>
FME Server REST API Specifications 81
<requestURI>/fmerest/notifications/topics/JOB_SUC-CESS.xml</requestURI>
<token>0f0c6960f0569f6e2595215911fdfc66b54eb029</token><topic>
<name>JOB_SUCCESS</name><description>A notification for this topic is gen-
erated when an FME transformation succeeds.</description></topic>
</serviceResponse>
Update an Existing Topic
URI:
PUT /notifications/topics/<name>.<format>
Parameters:
l description – New description for the topic
Sample Request / Response - JSON
Request
PUT /notifications/topics/JOB_SUC-CESS.json?description=Here+is+a+modified+description
Corresponding Response
{"serviceResponse":{
"requestURI":"/fmerest/notifications/topics/JOB_SUC-CESS.json","token":"0f0c6960f0569f6e2595215911fdfc66b54eb029","topic":{
"name":"JOB_SUCCESS","description":"Here is a modified description"
}}
}
REST API Documentation
82 FME Server REST API Specifications
Notifications
Sample Request / Response - XML
Request
PUT /notifications/topics/JOB_SUC-CESS.xml?description=Here+is+a+modified+description
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/topics/JOB_SUC-CESS.xml</requestURI>
<token>0f0c6960f0569f6e2595215911fdfc66b54eb029</token><topic>
<name>JOB_SUCCESS</name><description>Here is a modified descrip-
tion</description></topic>
</serviceResponse>
Create a New Topic
URI:
POST /notifications/topics.<format>
Parameters:
l name – The name for the new topic, must be unique.
l description – An optional description for the new topic.
Sample Request / Response - JSON
Request
POST /not-ifi-cations/topics.json?name=MyNewTopic&description=New+Description
Corresponding Response
{"serviceResponse":{
FME Server REST API Specifications 83
"reque-stURI":"/-fmerest/notifications/topics/MyNewTopic.json","token":"0f0c6960f0569f6e2595215911fdfc66b54eb029","topic":{
"name":"MyNewTopic","description":"New Description"
}}
}
Sample Request / Response - XML
Request
POST /not-ifi-cations/topics.xml?name=MyNewTopic&description=New+Description
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<reque-stURI>/fm-erest/notifications/topics/MyNewTopic.xml</requestURI>
<token>0f0c6960f0569f6e2595215911fdfc66b54eb029</token><topic>
<name>MyNewTopic</name><description>New Description</description>
</topic></serviceResponse>
Remove an Existing Topic
Returns: Nothing. Refer to the HTTP response "Notifications" on page 75 todetermine if the operation completed successfully.
URI:
DELETE /notifications/topics/<name>.<format>
REST API Documentation
84 FME Server REST API Specifications
Notifications
Subscriber Management
Properties
subscribers The collection of subscribers available to the user on theserver.
subscriber An individual subscriber object, follows beneath a sub-scribers element.
name Uniquely identifies a subscriber.
displayName Reader-friendly name for the subscriber, not guaranteedto be unique.
properties The properties specific to each subscriber, only availablein detail mode.
name (prop-erty)
The name of a single property belonging to the prop-erties collection.
value (prop-erty)
The value of a single property.
attributes A collection of GUI attributes.
attribute Describes the visual formatting of a property, followsbeneath an attributes element.
name (attrib-ute)
Name of the attribute used for visual formatting, eithergui_label or gui_type.
value (attrib-ute)
Value of the attribute used for visual formatting.
Calls
Retrieve a List of Subscribers
Returns: The subscribers collection of subscriber types available to the user
URI:
GET /notifications/subscribers.<format>
Sample Response - JSON
GET /notifications/subscribers.json
FME Server REST API Specifications 85
{"serviceResponse":{
"reque-stURI":"/fmerest/notifications/subscribers.json","token":"9f73e0988c101d1448ac1b4a54b4cdf9337191a7","subscribers":[
{"name":"email","displayName":"Email"
},{
"name":"logger","displayName":"Logger"
},{
"name":"push","displayName":"Push"
}]
}}
Sample Response - XML
GET /notifications/subscribers.xml
<?xml version="1.0"?><serviceResponse>
<reque-stURI>/fmerest/notifications/subscribers.xml</requestURI>
<token>9f73e0988c101d1448ac1b4a54b4cdf9337191a7</token><subscribers>
<subscriber><name>email</name><displayName>Email</displayName>
</subscriber><subscriber>
<name>logger</name>
REST API Documentation
86 FME Server REST API Specifications
Notifications
<displayName>Logger</displayName></subscriber><subscriber>
<name>push</name><displayName>Push</displayName>
</subscriber></subscribers>
</serviceResponse>
Retrieve Detailed Information for a Particular Subscriber
Returns: The subscriber object for the one requested.
URI:
GET /notifications/subscribers/<name>.<format>
Sample Response - JSON
GET /notifications/subscribers/email.json
{"serviceResponse":{
"reque-stURI":"/fmerest/notifications/subscribers/email.json","token":"9f73e0988c101d1448ac1b4a54b4cdf9337191a7","subscriber":{
"name":"email","displayName":"Email","properties":[
{"name":"URL","attributes":[
{"name":"gui_label","value":"Target URL:"
},{
"name":"gui_type","value":"TEXT"
}]
}
FME Server REST API Specifications 87
]}
}}
Sample Response- XML
GET /notifications/subscribers/email.xml
<?xml version="1.0"?><serviceResponse>
<reque-stURI>/fm-erest/notifications/subscribers/email.xml</requestURI>
<token>9f73e0988c101d1448ac1b4a54b4cdf9337191a7</token><subscriber>
<name>email</name><displayName>Email</displayName><properties>
<property><name>URL</name><value/><attributes>
<attribute><name>gui_label</name><value>Target URL:</value>
</attribute><attribute>
<name>gui_type</name><value>TEXT</value>
</attribute></attributes>
</property></properties>
</subscriber></serviceResponse>
REST API Documentation
88 FME Server REST API Specifications
Notifications
Subscription Management
Properties
subscriptions A collection of subscriptions.
subscription A single subscription object, follows beneath a sub-scriptions element.
name Uniquely identifies a subscription.
topics The collection of topics assigned to a subscription.
topic A topic assigned to a subscription, appears beneath atopics element.
subscriberName The type of subscriber for a subscription.
properties The collection of subscriber properties applicable toa particular subscription.
property A key/value pair used for subscriber configuration,appears beneath properties.
name (prop-erty)
The name of a subscriber property for a sub-scription.
value (prop-erty)
The value of a subscriber property for a subscription.
Top Level Calls
Retrieve the List of Subscriptions
Retrieves a list of all the subscriptions that each yield superficial subscriptiondetails. Use "Retrieve Detailed Subscription Information" on page 91 for fullsubscription details on a particular subscription.
Returns: The subscriptions collection of all subscriptions available to theuser
URI:
GET /notifications/subscriptions.<format>
Sample Response - JSON
GET /notifications/subscriptions.json
FME Server REST API Specifications 89
{"serviceResponse":{
"reque-stURI":"/fmerest/notifications/subscriptions.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","subscriptions":[
{"topics":[
"JOB_FAILURE"],
"name":"Email_JobFailure","subscriberName":"email"
},{
"topics":["JOB_SUCCESS"
],"name":"Email_JobSuccess","subscriberName":"email"
},{
"topics":["JOB_SUCCESS","JOB_FAILURE","SAMPLE_TOPIC"
],"name":"Logger_Default","subscriberName":"logger"
}]
}}
Sample Response - XML
GET /notifications/subscriptions.xml
<?xml version="1.0"?><serviceResponse>
REST API Documentation
90 FME Server REST API Specifications
Notifications
<reque-stURI>/fmerest/notifications/subscriptions.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><subscriptions>
<subscription><topics>
<topic>JOB_FAILURE</topic></topics><name>Email_JobFailure</name><subscriberName>email</subscriberName>
</subscription><subscription>
<topics><topic>JOB_SUCCESS</topic>
</topics><name>Email_JobSuccess</name><subscriberName>email</subscriberName>
</subscription><subscription>
<topics><topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic><topic>SAMPLE_TOPIC</topic>
</topics><name>Logger_Default</name><subscriberName>logger</subscriberName>
</subscription></subscriptions>
</serviceResponse>
Retrieve Detailed Subscription Information
Retrieves all of the subscription details, including its properties, for one sub-scription.
Returns: The full subscription object requested.
URI:
FME Server REST API Specifications 91
GET /notifications/subscriptions/<name>.<format>
Sample Response - JSON
GET /notifications/subscriptions/Logger_Default.json
{"serviceResponse":{
"reque-stURI":"/fmerest/notifications/subscriptions/Logger_Default.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","subscription":{
"topics":["JOB_SUCCESS","JOB_FAILURE"
],"name":"Logger_Default","subscriberName":"logger","properties":[
{"name":"URL","value":"http:/-/SHOC-KWAVE:8080/fmejobsubmitter/Test/recvtext.fmw"
},{
"name":"CONTENT_FORMAT","value":"JSON"
}]
}}
}
Sample Response - XML
GET /notifications/subscriptions/Logger_Default.xml
<?xml version="1.0"?><serviceResponse>
REST API Documentation
92 FME Server REST API Specifications
Notifications
<requestURI>/fmerest/notifications/subscriptions/Logger_Default.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><subscription>
<topics><topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic>
</topics><name>Logger_Default</name><subscriberName>logger</subscriberName><properties>
<property><name>URL</name><value>http://S-
HOCKWAVE:8080/fmejobsubmitter/Test/recvtext.fmw</value></property><property>
<name>CONTENT_FORMAT</name><value>JSON</value>
</property></properties>
</subscription></serviceResponse>
Create a New Subscription
Subscribes to a number of notifications topics using one of the installed sub-scribers. A JSON or XML request body specifies the object data instead ofparameters because by nature this data contains nested elements (prop-erties).
Returns: The subscription object that was created
URI:
POST /notifications/subscriptions.<format>
FME Server REST API Specifications 93
Required Headers
n Content-Type – application/json for JSON content or appli-cation/xml for XML content
Sample Request / Response - JSON
Request
POST /notifications/subscriptions.jsonContent-Type: application/json
{"serviceRequest":{
"subscription":{"topics":[
"JOB_SUCCESS","JOB_FAILURE"
],"name":"My New Subscription","subscriberName":"ftp","properties":[
{"name":"USERNAME","value":"bob"
},{
"name":"HOST","value":"localhost"
},{
"name":"PASSWORD","value":"********"
}]
}}
}
Corresponding Response
{
REST API Documentation
94 FME Server REST API Specifications
Notifications
"serviceResponse":{"requestURI":"/fmerest/notifications/subscriptions/MyNew Subscription.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","subscription":{
"topics":["JOB_SUCCESS","JOB_FAILURE"
],"name":"My New Subscription","subscriberName":"ftp","properties":[
{"name":"TRANSFER_TYPE","value":"Auto"
},{
"name":"LOCAL_SOURCE_PATH"},{
"name":"PORT","value":"21"
},{
"name":"REMOTE_UPLOAD_DIRECTORY"},{
"name":"ZIP_SOURCE","value":"Yes"
},{
"name":"USERNAME","value":"bob"
},{
"name":"HOST","value":"localhost"
},{
"name":"ENCRYPTION","value":"None"
},
FME Server REST API Specifications 95
{"name":"PASSWORD","value":"********"
}]
}}
}
Sample Request / Response - XML
Request
POST /notifications/subscriptions.xmlContent-Type: application/xml
<?xml version="1.0"?><serviceRequest>
<subscription><topics>
<topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic>
</topics><name>My New Subscription</name><subscriberName>ftp</subscriberName><properties>
<property><name>USERNAME</name><value>bob</value>
</property><property>
<name>HOST</name><value>localhost</value>
</property><property>
<name>PASSWORD</name><value>********</value>
</property>
REST API Documentation
96 FME Server REST API Specifications
Notifications
</properties></subscription>
</serviceRequest>
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/subscriptions/My NewSubscription.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><subscription>
<topics><topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic>
</topics><name>My New Subscription</name><subscriberName>ftp</subscriberName><properties>
<property><name>TRANSFER_TYPE</name><value>Auto</value>
</property><property>
<name>LOCAL_SOURCE_PATH</name><value/>
</property><property>
<name>PORT</name><value>21</value>
</property><property>
<name>REMOTE_UPLOAD_DIRECTORY</name><value/>
</property><property>
FME Server REST API Specifications 97
<name>ZIP_SOURCE</name><value>Yes</value>
</property><property>
<name>USERNAME</name><value>bob</value>
</property><property>
<name>HOST</name><value>localhost</value>
</property><property>
<name>ENCRYPTION</name><value>None</value>
</property><property>
<name>PASSWORD</name><value>********</value>
</property></properties>
</subscription></serviceResponse>
Remove an Existing Subscription
Deletes a subscription from the server.
Returns: Nothing. Refer to the HTTP response "Notifications" on page 75 todetermine if the operation completed successfully.
URI:
DELETE /notifications/subscriptions/<name>.<format>
Calls for Subscription Properties
Retrieve Subscription Properties
Retrieves all of the properties belonging to a particular subscription.
Returns: The properties collection for a particular subscription.
REST API Documentation
98 FME Server REST API Specifications
Notifications
URI:
GET /notifications/subscriptions/<name>/properties.<format>
Sample Response - JSON
GET /notifications/subscriptions/Push%20-0-%20Subscription/properties.json
{"serviceResponse":{
"requestURI":"/fmerest/notifications/subscriptions/Push- Subscription/properties.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","properties":[
{"name":"URL","value":"http:/-/SHOCKWAVE:8080/fmejobsubmitter/Test/recvtext.fmw"
},{
"name":"CONTENT_FORMAT","value":"JSON"
}]
}}
Sample Response - XML
GET /notifications/subscriptions/Push%20-0-%20Subscription/properties.xml
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/subscriptions/Push -Subscription/properties.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><properties>
<property><name>URL</name>
FME Server REST API Specifications 99
<value>http://S-HOCKWAVE:8080/fmejobsubmitter/Test/recvtext.fmw</value>
</property><property>
<name>CONTENT_FORMAT</name><value>JSON</value>
</property></properties>
</serviceResponse>
Replace Subscription Properties
Sets (effectively replaces) the subscription properties on the server withthose in the request. Any properties not specified in the request are resetto their default values.
Returns: The complete collection of subscription properties belonging tothe subscription following the update operation.
URI:
PUT /notifications/subscriptions/<name>/properties.<format>
Parameters: The request parameters, as key/value pairs, are translateddirectly into the subscription properties.
Sample Request / Response - JSON
Request
PUT /notifications/subscriptions/Push%20-0-%20Subscription/properties.json?URL= http%3A%2F%2-FSHOCKWAVE%3A8080%2Ffmejobsubmitter%2FTest%2Frecvtext.fmw&CONTENT_FORMAT=JSON
Corresponding Response
{"serviceResponse":{
"reque-stURI":"/fmerest/notifications/subscriptions/Push -Subscription/properties.json","token":"b62a8174300f53f670bac24f9520b972fb8774af",
REST API Documentation
100 FME Server REST API Specifications
Notifications
"properties":[{
"name":"URL","value":"http:/-/SHOCKWAVE:8080/fmejobsubmitter/Test/recvtext.fmw"
},{
"name":"CONTENT_FORMAT","value":"XML"
}]
}}
Sample Request / Response - XML
Request
PUT /notifications/subscriptions/Push%20-0-%20Subscription/properties.xml?URL= http%3A%2F%2-FSHOCKWAVE%3A8080%2Ffmejobsubmitter%2FTest%2Frecvtext.fmw&CONTENT_FORMAT=XML
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/subscriptions/Push -Subscription/properties.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><properties>
<property><name>URL</name><value>http://S-
HOCKWAVE:8080/fmejobsubmitter/Test/recvtext.fmw</value></property><property>
<name>CONTENT_FORMAT</name><value>XML</value>
</property>
FME Server REST API Specifications 101
</properties></serviceResponse>
Change a Single Subscription Property
Use this operation if you intend to modify only one subscription propertywhile preserving the state of the others.
Returns: The value of the updated property.
URI:
PUT /notifications/subscriptions/<name>/properties/<name(property)>.<format>
Parameters:
l value – Specifies the new value for the property.
Sample Request / Response - JSON
Request
PUT /not-ifi-cations/subscriptions/Push%20–%20Subscription/properties/URL.json?value=
http%3A%2F%2-FSHOCKWAVE%3A8080%2Ffmejobsubmitter%2FTest%2Frecvtext.fmw
Corresponding Response
{"serviceResponse":{
"reque-stURI":"/fmerest/notifications/subscriptions/Push -Subscription/properties/URL.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","property":{
"name":"URL","value":"http:/-/SHOCKWAVE:8080/fmejobsubmitter/Test/recvtext.fmw"
}}
}
REST API Documentation
102 FME Server REST API Specifications
Notifications
Sample Request / Response - XML
Request
PUT /not-ifi-cations/subscriptions/Push%20–%20Subscription/properties/URL.xml?value=
http%3A%2F%2-FSHOCKWAVE%3A8080%2Ffmejobsubmitter%2FTest%2Frecvtext.fmw
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/subscriptions/Push -Subscription/properties/URL.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><property>
<name>URL</name><value>http://S-
HOCKWAVE:8080/fmejobsubmitter/Test/recvtext.fmw</value></property>
</serviceResponse>
Retrieve a Single Subscription Property
Retrieves the value of a specifically named subscription property.
Returns: The value of the named subscription property.
URI:
GET /notifications/subscriptions/<name>/properties/<name(property)>.<format>
Sample Response - JSON
GET /notifications/subscriptions/Push - Sub-scription/properties/CONTENT_FORMAT.json
{"serviceResponse":{
FME Server REST API Specifications 103
"reque-stURI":"/fmerest/notifications/subscriptions/Push -Subscription/properties/CONTENT_FORMAT.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","property":{
"name":"CONTENT_FORMAT","value":"XML"
}}
}
Sample Response - XML
GET /notifications/subscriptions/Push - Sub-scription/properties/CONTENT_FORMAT.xml
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/subscriptions/Push -Subscription/properties/CONTENT_FORMAT.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><property>
<name>CONTENT_FORMAT</name><value>XML</value>
</property></serviceResponse>
Calls for Assigned Topics
Retrieve the List of Topics Assigned to a Subscription
Retrieves the list of topics that a subscription is subscribed to or that a sub-scription has topics assigned to.
Returns: The topics collection, which is the set of topics assigned to thespecified subscription or the set of topics for which the specified sub-scription is subscribed to.
URI:
GET /notifications/subscriptions/<name>/topics.<format>
REST API Documentation
104 FME Server REST API Specifications
Notifications
Sample Response - JSON
GET /notifications/subscriptions/My New Sub-scription/topics.json
{"serviceResponse":{
"requestURI":"/fmerest/notifications/subscriptions/MyNew Subscription/topics.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","topics":[
"JOB_SUCCESS","JOB_FAILURE"
]}
}
Sample Response - XML
GET /notifications/subscriptions/My New Sub-scription/topics.xml
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/subscriptions/My NewSubscription/topics.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><topics>
<topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic>
</topics></serviceResponse>
Assign Topics to a Subscription
Assigns one or more topics to a subscription or subscribes a subscription toadditional topics.
Returns: The collection of topics assigned to the subscription or the topicsthat the subscription subscribes to following the operation.
URI:
FME Server REST API Specifications 105
POST /notifications/subscriptions/<name>/topics.<format>
Parameters:
l topic – Use the ‘topic’ parameter redundantly to specify a set of top-ics to assign to the subscription.
Sample Request - JSON
Request
POST /notifications/subscriptions/My New Sub-scrip-tion/topics.json?topic=MyNewTopic&topic=AnotherNewTopic
Corresponding Response
{"serviceResponse":{
"requestURI":"/fmerest/notifications/subscriptions/MyNew Subscription/topics.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","topics":[
"JOB_SUCCESS","JOB_FAILURE","MyNewTopic","AnotherNewTopic"
]}
}
Sample Request - XML
Request
POST /notifications/subscriptions/My New Sub-scription/topics.xml?topic=MyNewTopic&topic=AnotherNewTopic
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/subscriptions/My NewSubscription/topics.xml</requestURI>
REST API Documentation
106 FME Server REST API Specifications
Notifications
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><topics>
<topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic><topic>MyNewTopic</topic><topic>AnotherNewTopic</topic>
</topics></serviceResponse>
Remove a Topic Assignment from a Subscription
Removes a topic from assignment to a subscription or unsubscribes a sub-scription from a single topic.
Returns: Nothing. Refer to the HTTP response "Notifications" on page 75 todetermine if the operation completed successfully.
URI:
DELETE/notifications/subscriptions/<name>/topics/<topic>.<format>
Set Topic Assignments for a Subscription
Completely replaces all topics assigned to a subscription with the ones spec-ified or subscribes a subscription exclusively to the topics specified. Thiseffectively removes all assigned topics from the subscription and thenassigns the new ones specified in the request.
Returns: The complete list of assigned topics or topics that the subscriptionis subscribed to immediately after completing the operation.
URI:
PUT /notifications/subscriptions/<name>/topics.<format>
Parameters:
l topic – Use the ‘topic’ parameter redundantly to specify a new set oftopics to assign to the subscription.
FME Server REST API Specifications 107
Sample Request / Response - JSON
Request
PUT /not-ifi-cations/subscriptions/My%20New%20Subscription/topics.json?topic=YAFT+(Yet+Another+Funky+Topic)&topic=JOB_SUCCESS
Corresponding Response
{"serviceResponse":{
"requestURI":"/fmerest/notifications/subscriptions/MyNew Subscription/topics.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","topics":[
"YAFT (Yet Another Funky Topic)","JOB_SUCCESS"
]}
}
Sample Request / Response - XML
Request
PUT /not-ifi-cations/subscriptions/My%20New%20Subscription/topics.xml?topic=YAFT+(Yet+Another+Funky+Topic)&topic=JOB_SUCCESS
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/subscriptions/My NewSubscription/topics.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><topics>
<topic>YAFT (Yet Another Funky Topic)</topic><topic>JOB_SUCCESS</topic>
REST API Documentation
108 FME Server REST API Specifications
Notifications
</topics></serviceResponse>
Publisher Management
Properties
publishers The collection of publishers available to the user on theserver.
publisher An individual publisher object, follows beneath a pub-lishers element.
name Uniquely identifies a publisher.
displayName Reader-friendly name for the publisher, not guaranteedto be unique.
properties The properties specific to each publisher, only availablein detail mode.
name (prop-erty)
The name of a single property belonging to the prop-erties collection.
value (prop-erty)
The value of a single property.
attributes A collection of GUI attributes.
attribute Describes the visual formatting of a property, followsbeneath an attributes element.
name (attrib-ute)
Name of the attribute used for visual formatting, eithergui_label or gui_type.
value (attrib-ute)
Value of the attribute used for visual formatting.
Calls
Retrieve a List of Publishers
Returns: The publishers collection of publisher types available to the user.
URI:
FME Server REST API Specifications 109
GET /notifications/publishers.<format>
Sample Response - JSON
GET /notifications/subscriptions/publishers.json
{"serviceResponse":{
"requestURI":"/fmerest/notifications/publishers.json","token":"9f73e0988c101d1448ac1b4a54b4cdf9337191a7","publishers":[
{"name":"email","displayName":"Email"
},{
"name":"jms","displayName":"JMS"
},{
"name":"udp","displayName":"UDP"
}]
}}
Sample Response - XML
GET /notifications/subscriptions/publishers.xml
<?xml version="1.0"?><serviceResponse>
<reque-stURI>/fmerest/notifications/publishers.xml</requestURI>
<token>9f73e0988c101d1448ac1b4a54b4cdf9337191a7</token><publishers>
<publisher><name>email</name><displayName>Email</displayName>
REST API Documentation
110 FME Server REST API Specifications
Notifications
</publisher><publisher>
<name>jms</name><displayName>JMS</displayName>
</publisher><publisher>
<name>udp</name><displayName>UDP</displayName>
</publisher></publishers>
</serviceResponse>
Retrieve Detailed Information for a Particular Publisher
Returns: The publisher object for the one requested.
URI:
GET /notifications/publishers/<name>.<format>
Sample Response - JSON
GET /notifications/publishers/email.json
{"serviceResponse":{
"reque-stURI":"/fmerest/notifications/publishers/email.json","token":"9f73e0988c101d1448ac1b4a54b4cdf9337191a7","publisher":{
"name":"email","displayName":"Email","properties":[
{"name":"EMAIL_USER","attributes":[
{"name":"gui_label","value":"User:"
},{
"name":"gui_type",
FME Server REST API Specifications 111
"value":"TEXT"}
]},{
"name":"EMAIL_PASSWORD","attributes":[
{"name":"gui_label","value":"Password:"
},{
"name":"gui_type","value":"PASSWORD"
}]
}]
}}
}
Sample Response - XML
GET /notifications/publishers/email.xml
<?xml version="1.0"?><serviceResponse>
<reque-stURI>/fm-erest/notifications/publishers/email.xml</requestURI>
<token>9f73e0988c101d1448ac1b4a54b4cdf9337191a7</token><publisher>
<name>email</name><displayName>Email</displayName><properties>
<property><name>EMAIL_USER</name><value/><attributes>
REST API Documentation
112 FME Server REST API Specifications
Notifications
<attribute><name>gui_label</name><value>User:</value>
</attribute><attribute>
<name>gui_type</name><value>TEXT</value>
</attribute></attributes>
</property><property>
<name>EMAIL_PASSWORD</name><value/><attributes>
<attribute><name>gui_label</name><value>Password:</value>
</attribute><attribute>
<name>gui_type</name><value>PASSWORD</value>
</attribute></attributes>
</property></properties>
</publisher></serviceResponse>
Publication Management
Properties
publications A collection of publications.
publication A single publication object, follows beneath a pub-lications element.
FME Server REST API Specifications 113
name Uniquely identifies a publication.
topics The collection of topics assigned to a publication.
topic A topic assigned to a publication, appears beneath atopics element.
publisherName The type of publisher for a publication.
properties The collection of publisher properties applicable to aparticular publication.
property A key/value pair used for publisher configuration,appears beneath properties.
name (prop-erty)
The name of a publisher property for a publication.
value (prop-erty)
The value of a publisher property for a publication.
Top Level Calls
Retrieve the List of Publications
Retrieves a list of all the publications that each yield superficial publicationdetails. Use "Retrieve Detailed Publication Information" on page 116 forfull publication details on a particular publication.
Returns: The publications collection of all publications available to theuser.
URI:
GET /notifications/publications.<format>
Sample Response
GET /notifications/publications.json
{"serviceResponse":{
"reque-stURI":"/fmerest/notifications/publications.json",
REST API Documentation
114 FME Server REST API Specifications
Notifications
"token":"b62a8174300f53f670bac24f9520b972fb8774af","publications":[
{"topics":[
"JOB_SUCCESS","JOB_FAILURE"
],"name":"Emailer","publisherName":"email"
},{
"topics":["SAMPLE_TOPIC"
],"name":"JMS Sender","publisherName":"jms"
},{
"topics":["JOB_SUCCESS","JOB_FAILURE","SAMPLE_TOPIC"
],"name":"UDP Broadcaster","publisherName":"udp"
}]
}}
Sample Response - XML
GET /notifications/publications.xml
<?xml version="1.0"?><serviceResponse>
<reque-stURI>/fmerest/notifications/publications.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><publications>
<publication>
FME Server REST API Specifications 115
<topics><topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic>
</topics><name>Emailer</name><publisherName>email</publisherName>
</publication><publication>
<topics><topic>SAMPLE_TOPIC</topic>
</topics><name>JMS Sender</name><publisherName>jms</publisherName>
</publication><publication>
<topics><topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic><topic>SAMPLE_TOPIC</topic>
</topics><name>UDP Broadcaster</name><publisherName>udp</publisherName>
</publication></publications>
</serviceResponse>
Retrieve Detailed Publication Information
Retrieves all of the publication details, including its properties, for one pub-lication.
Returns: The full publication object requested.
URI:
GET /notifications/publication/<name>.<format>
Sample Response - JSON
GET /notifications/publication/UDP%20Broadcaster.json
REST API Documentation
116 FME Server REST API Specifications
Notifications
{"serviceResponse":{
"requestURI":"/fmerest/notifications/publications/UDPBroadcaster.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","publication":{
"topics":["JOB_SUCCESS","JOB_FAILURE","SAMPLE_TOPIC"
],"name":"UDP Broadcaster","publisherName":"udp","properties":[
{"name":"UDP_PORT","value":"8358"
}]
}}
}
Sample Response - XML
GET /notifications/publication/UDP%20Broadcaster.xml
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/publications/UDPBroadcaster.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><publication>
<topics><topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic><topic>SAMPLE_TOPIC</topic>
</topics><name>UDP Broadcaster</name>
FME Server REST API Specifications 117
<publisherName>udp</publisherName><properties>
<property><name>UDP_PORT</name><value>8358</value>
</property></properties>
</publication></serviceResponse>
Create a New Publication
Publishes a number of notifications to topics using one of the installed pub-lishers. A JSON or XML request body specifies the object data instead ofparameters because by nature this data contains nested elements (prop-erties).
Returns: The publication object that was created.
URI:
POST /notifications/publications.<format>
Required Headers
Content-Type – application/json for JSON content or appli-cation/xml for XML content.
Sample Request / Response - JSON
Request
POST /notifications/publications.jsonContent-Type: application/json
{"serviceRequest":{
"publication":{"topics":[
"SAMPLE_TOPIC","JOB_SUCCESS"
],
REST API Documentation
118 FME Server REST API Specifications
Notifications
"name":"My New JMS Sender","publisherName":"jms","properties":[
{"name":"JMS_TYPE","value":"WEBSPHERE70"
},{
"name":"JMS_URL","value":"iiop://localhost:9810"
},{
"name":"JMS_CONNECTION_FACTORY","value":"jms/testqcf"
},{
"name":"JMS_DESTINATIONS","value":"jms/testqcf/queue/MyNewDestination"
}]
}}
}
Corresponding Response
{"serviceResponse":{
"requestURI":"/fmerest/notifications/publications/MyNew JMS Sender.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","publication":{
"topics":["SAMPLE_TOPIC","JOB_SUCCESS"
],"name":"My New JMS Sender","publisherName":"jms","properties":[
{"name":"JMS_TYPE","value":"WEBSPHERE70"
},
FME Server REST API Specifications 119
{"name":"JMS_URL","value":"iiop://localhost:9810"
},{
"name":"JMS_PROPERTIES"},{
"name":"JMS_CONNECTION_FACTORY","value":"jms/testqcf"
},{
"name":"JMS_USERNAME"},{
"name":"JMS_PASSWORD"},{
"name":"JMS_DESTINATIONS","value":"jms/testqcf/queue/MyNewDestination"
}]
}}
}
Sample Request / Response - XML
Request
POST /notifications/publications.xmlContent-Type: application/xml
<?xml version="1.0"?><serviceRequest>
<publication><topics>
<topic>SAMPLE_TOPIC</topic><topic>JOB_SUCCESS</topic>
</topics><name>My New JMS Sender</name>
REST API Documentation
120 FME Server REST API Specifications
Notifications
<publisherName>jms</publisherName><properties>
<property><name>JMS_TYPE</name><value>WEBSPHERE70</value>
</property><property>
<name>JMS_URL</name><value>iiop://localhost:9810</value>
</property><property>
<name>JMS_CONNECTION_FACTORY</name><value>jms/testqcf</value>
</property><property>
<name>JMS_DESTINATIONS</name><value>jms/testqcf/queue/M-
yNewDestination</value></property>
</properties></publication>
</serviceRequest>
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/publications/My NewJMS Sender.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><publication>
<topics><topic>SAMPLE_TOPIC</topic><topic>JOB_SUCCESS</topic>
</topics><name>My New JMS Sender</name>
FME Server REST API Specifications 121
<publisherName>jms</publisherName><properties>
<property><name>JMS_TYPE</name><value>WEBSPHERE70</value>
</property><property>
<name>JMS_URL</name><value>iiop://localhost:9810</value>
</property><property>
<name>JMS_PROPERTIES</name><value />
</property><property>
<name>JMS_CONNECTION_FACTORY</name><value>jms/testqcf</value>
</property><property>
<name>JMS_USERNAME</name><value />
</property><property>
<name>JMS_PASSWORD</name><value />
</property><property>
<name>JMS_DESTINATIONS</name><value>jms/testqcf/queue/M-
yNewDestination</value></property>
</properties></publication>
</serviceResponse>
REST API Documentation
122 FME Server REST API Specifications
Notifications
Remove an Existing Publication
Deletes a publication from the server.
Returns: Nothing. Refer to the HTTP response "Notifications" on page 75 todetermine if the operation completed successfully.
URI:
DELETE /notifications/publications/<name>.<format>
Calls for Publication Properties
Retrieve Publication Properties
Retrieves all of the properties belonging to a particular publication.
Returns: The properties collection for a particular publication.
URI:
GET /notifications/publications/<name>/properties.<format>
Sample Response - JSON
GET /notifications/publications/Emailer/properties.json
{"serviceResponse":{
"reque-stURI":"/-fmerest/notifications/publications/Emailer/properties.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","properties":[
{"name":"EMAIL_USER","value":"[email protected]"
},{
"name":"EMAIL_PASSWORD","value":"******"
}]
}}
FME Server REST API Specifications 123
Sample Response - XML
GET /notifications/publications/Emailer/properties.xml
<?xml version="1.0"?><serviceResponse>
<reque-stURI>/fm-erest/notifications/publications/Emailer/properties.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><properties>
<property><name>EMAIL_USER</name><value>[email protected]</value>
</property><property>
<name>EMAIL_PASSWORD</name><value>******</value>
</property></properties>
</serviceResponse>
Replace Publication Properties
Sets (effectively replaces) the publication properties on the server withthose in the request. Any properties not specified in the request are resetto their default values.
Returns: The complete collection of publication properties belonging to thepublication following the update operation.
URI:
PUT /notifications/publications/<name>/properties.<format>
Parameters: The request parameters, as key/value pairs, are translateddirectly into the publication properties.
REST API Documentation
124 FME Server REST API Specifications
Notifications
Sample Request / Response - JSON
Request
PUT /not-ifications/publications/Emailer/properties.json?EMAIL_USER=bob.james%40xyzwidgets.com&EMAIL_PASSWORD=******
Corresponding Response
{"serviceResponse":{
"reque-stURI":"/-fmerest/notifications/publications/Emailer/properties.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","properties":[
{"name":"EMAIL_USER","value":"[email protected]"
},{
"name":"EMAIL_PASSWORD","value":"******"
}]
}}
Sample Request / Response - XML
Request
PUT /not-ifications/publications/Emailer/properties.xml?EMAIL_USER=bob.james%40xyzwidgets.com&EMAIL_PASSWORD=******
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<reque-
FME Server REST API Specifications 125
stURI>/fm-erest/no-tifications/publications/Emailer/properties.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><properties>
<property><name>EMAIL_USER</name><value>[email protected]</value>
</property><property>
<name>EMAIL_PASSWORD</name><value>******</value>
</property></properties>
</serviceResponse>
Change a Single Publication Property
Use this operation if you intend to modify only one publication propertywhile preserving the state of the others.
Returns: The value of the updated property.
URI:
PUT /notifications/publications/<name>/properties/<name(property)>.<format>
Parameters:
l value – Specifies the new value for the property.
Sample Request / Response - JSON
Request
PUT /notifications/publications/JMS Sender/properties/JMS_CONNECTION_FACTORY.json?value=jms%2Flivecf
Corresponding Response
{"serviceResponse":{
REST API Documentation
126 FME Server REST API Specifications
Notifications
"requestURI":"/fmerest/notifications/publications/JMSSender/properties/JMS_CONNECTION_FACTORY.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","property":{
"name":"JMS_CONNECTION_FACTORY","value":"jms/livecf"
}}
}
Sample Request / Response - XML
Request
PUT /notifications/publications/JMS Sender/properties/JMS_CONNECTION_FACTORY.xml?value=jms%2Flivecf
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/publications/JMSSender/properties/JMS_CONNECTION_FACTORY.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><property>
<name>JMS_CONNECTION_FACTORY</name><value>jms/livecf</value>
</property></serviceResponse>
Retrieve a Single Publication Property
Retrieves the value of a specifically named publication property.
Returns: The value of the named publication property.
URI:
GET /notifications/publications/<name>/properties/<name(property)>.<format>
FME Server REST API Specifications 127
Sample Response - JSON
GET /notifications/publications/JMS Sender/properties/JMS_DESTINATIONS.json
{"serviceResponse":{
"requestURI":"/fmerest/notifications/publications/JMSSender/properties/JMS_DESTINATIONS.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","property":{
"name":"JMS_DESTINATIONS","value":"jms/testqcf/queue/MyDestination"
}}
}
Sample Response - XML
GET /notifications/publications/JMS Sender/properties/JMS_DESTINATIONS.xml
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/publications/JMSSender/properties/JMS_DESTINATIONS.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><property>
<name>JMS_DESTINATIONS</name><value>jms/testqcf/queue/MyDestination</value>
</property></serviceResponse>
Calls for Assigned Topics
Retrieve the List of Topics Assigned to a Publication
Retrieves the list of topics that a publication is subscribed to or that a pub-lication has topics assigned to.
REST API Documentation
128 FME Server REST API Specifications
Notifications
Returns: The topics collection, which is the set of topics assigned to thespecified publication or the set of topics for which the specified publication issubscribed to.
URI:
GET /notifications/publications/<name>/topics.<format>
Sample Response - JSON
GET /not-ifications/publications/My%20New%20Publication/topics.json
{"serviceResponse":{
"requestURI":"/fmerest/notifications/publications/MyNew Publication/topics.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","topics":[
"JOB_SUCCESS","JOB_FAILURE"
]}
}
Sample Response - XML
GET /not-ifications/publications/My%20New%20Publication/topics.xml
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/publications/My NewPublication/topics.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><topics>
<topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic>
</topics></serviceResponse>
FME Server REST API Specifications 129
Assign Topics to a Publication
Assigns one or more topics to a publication or subscribes a publication toadditional topics.
Returns: The collection of topics assigned to the publication or the topicsthat the publication subscribes to following the operation.
URI:
POST /notifications/publications/<name>/topics.<format>
Parameters:
l topic – Use the ‘topic’ parameter redundantly to specify a set of top-ics to assign to the publication.
Sample Request - JSON
Request
POST /not-ifi-cations/publications/My%20New%20Publication/topics.json?topic=MyNewTopic&topic=AnotherNewTopic
Corresponding Response
{"serviceResponse":{
"requestURI":"/fmerest/notifications/publications/MyNew Publication/topics.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","topics":[
"JOB_SUCCESS","JOB_FAILURE","MyNewTopic","AnotherNewTopic"
]}
}
REST API Documentation
130 FME Server REST API Specifications
Notifications
Sample Request - XML
Request
POST /not-ifi-cations/publications/My%20New%20Publication/topics.xml?topic=MyNewTopic&topic=AnotherNewTopic
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/publications/My NewPublication/topics.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><topics>
<topic>JOB_SUCCESS</topic><topic>JOB_FAILURE</topic><topic>MyNewTopic</topic><topic>AnotherNewTopic</topic>
</topics></serviceResponse>
Remove a Topic Assignment from a Publication
Removes a topic from assignment to a publication or unsubscribes a pub-lication from a single topic.
Returns: Nothing. Refer to the HTTP response "Notifications" on page 75 todetermine if the operation completed successfully.
URI:
DELETE/notifications/publications/<name>/topics/<topic>.<format>
Set Topic Assignments for a Publication
Completely replaces all topics assigned to a publication with the ones spec-ified or subscribes a publication exclusively to the topics specified. Thiseffectively removes all assigned topics from the publication and then assignsthe new ones specified in the request.
FME Server REST API Specifications 131
Returns: The complete list of assigned topics or topics that the publicationis subscribed to immediately after completing the operation.
URI:
PUT /notifications/publications/<name>/topics.<format>
Parameters:
l topic – Use the ‘topic’ parameter redundantly to specify a new setof topics to assign to the subscription.
Sample Request / Response - JSON
Request
PUT /not-ifi-cations/publications/My%20New%20Publication/topics.json?topic=YAFT+(Yet+Another+Funky+Topic)&topic=JOB_SUCCESS
Corresponding Response
{"serviceResponse":{
"requestURI":"/fmerest/notifications/publications/MyNew Publication/topics.json","token":"b62a8174300f53f670bac24f9520b972fb8774af","topics":[
"YAFT (Yet Another Funky Topic)","JOB_SUCCESS"
]}
}
Sample Request / Response - XML
Request
PUT /not-ifi-cations/publications/My%20New%20Publication/topics.xml?topic=YAFT+(Yet+Another+Funky+Topic)&topic=JOB_SUCCESS
REST API Documentation
132 FME Server REST API Specifications
Notifications
Corresponding Response
<?xml version="1.0"?><serviceResponse>
<requestURI>/fmerest/notifications/publications/My NewPublication/topics.xml</requestURI>
<token>b62a8174300f53f670bac24f9520b972fb8774af</token><topics>
<topic>YAFT (Yet Another Funky Topic)</topic><topic>JOB_SUCCESS</topic>
</topics></serviceResponse>
Publishing
Properties
topic The name of the topic to publish to.
Publish a Notification to a Topic
Triggers a topic with a message specified by the request body. The requestbody can be XML, JSON or plain text. The body is interpreted based on boththe Content-Type header (For example, Content-Type: application/xml)and the URI extension (for example, /some/request/uri.xml). In the caseof an XML or JSON payload, it is parsed into a map up to one level deep andthe notification is published with this map. Additionally, the notificationparameters can be specified as request parameters, but only when there isno request body specified. Subscriptions that subscribe to this topic are, inturn, triggered and receive the notification and notification message.
The following table describes how the request body content is processeddepending on the Content-Type header and the URI extension:
FME Server REST API Specifications 133
URIExtension
Content-Type Action Taken
None Not specified Detect the content-type from the body. First,the request body is parsed as JSON. If thisfails, it attempts to parse it as XML. If XMLparsing fails, it is treated as plain text.
Note: Errors are silent; you are notnotified of any XML or JSONsyntax or parsing errors thatoccur.
*.xml application/xml Parse as XML. Return HTTP status code 400if the content is not well-formed XML.*.xml Not specified
None application/xml
*.json application/json Parse as JSON. Return HTTP status code 400if the content is not well-formed JSON.*.json Not specified
None application/json
None text/plain Do not parse. Treat as plain text.
*.xml application/json Return HTTP status code 415
*.json application/xml
*.xml text/plain
*.json text/plain
Note: If you know the content type to post (that is, query string,XML, JSON, or plain) it is recommended that you specifyeither the appropriate content-type or URI extension toreduce processing time. Auto-detection of request content isresource-intensive and, depending on the size of the requestcontent, may significantly impact pipeline performance.
Returns: HTTP Status 202
REST API Documentation
134 FME Server REST API Specifications
Notifications
URI:
POST /notifications/notification/<topic>.<format>
Sample Request—Plain Text
POST /notifications/notification/JOB_SUCCESS
This is the published notification text, alert!
Sample Request—JSON Payload
POST /notifications/notification/JOB_SUCCESS.json
{"id":"2","requestKeyword":"FILE_DOWNLOAD_SERVICE","timeFinished":"Mon-15-Aug-2011 02:01:46 PM","timeRequested":"Mon-15-Aug-2011 02:01:45 PM","timeStarted":"Mon-15-Aug-2011 02:01:45 PM","Log-File-Location":"\\\\Server\\FMEServer\\Logs\\datadownload\\FME_7D150E1F_1313442105798_4244.log","LogFileName":"datadownload\\FME_7D150E1F_1313442105798_4244.log","NumFeaturesOutput":"49","Out-putLocation":"\\\\Server\\FMEServer\\DefaultResults\\FME_7D150E1F_1313442105798_4244","ResultRootDir":"\\fmedatadownload\\results","StatusMessage":"Translation Successful","StatusNumber":"0"
}
Sample Request – XML Payload
POST /notifications/notification/JOB_SUCCESS.xml
<?xml version="1.0" encoding="UTF-8"?><xml>
<id>2</id><requestKeyword>FILE_DOWNLOAD_SERVICE</requestKeyword>
FME Server REST API Specifications 135
<timeFinished>Mon-15-Aug-2011 02:01:46 PM</timeFinished><timeRequested>Mon-15-Aug-2011 02:01:45 PM</t-imeRequested><timeStarted>Mon-15-Aug-2011 02:01:45 PM</timeStarted>
<LogFileLocation>\\Server\FMEServer\...\FME_7D150E1F_1313442105798_4244.log</LogFileLocation>
<LogFileName>datadownload\FME_7D150E1F_1313442105798_4244.log</LogFileName><NumFeaturesOutput>49</NumFeaturesOutput>
<OutputLocation>\\Server\FMEServer\DefaultResults\FME_7D150E1F_1313442105798_4244</OutputLocation>
<ResultRootDir>\fmedatadownload\results</ResultRootDir><StatusMessage>Translation Successful</StatusMessage><StatusNumber>0</StatusNumber>
</xml>
Sample Request – HTTP Request Parameters
POST /notifications/notification/JOB_SUC-CESS.json?id=2&requestKeyword=FILE_DOWNLOAD_SERV-ICE&timeFinished=Mon-15-Aug-2011+02:01:46+PM&timeRequested=Mon-15-Aug-2011+0-2:01:45+PM&timeStarted=Mon-15-Aug-2011+-02:01:45+PM&LogFileLocation=\\Server\FMEServer\Logs\datadownload\FME_7D150E1F_1313442105798_4244.log&LogFileName=datadownload\FME_7D150E1F_1313442105798_4244.l-og&OutputLocation=\\Server\FMEServer\DefaultResults\FME_7D150E1F_1313442105798_4244&-Resul-tRootDir=\fmedatadownload\results&StatusMessage=Translation+Successful&StatusNumber=0
Log File ManagementGET/logs
Returns the list of logs
URI:
/fmerest/logs.<format>
REST API Documentation
136 FME Server REST API Specifications
Log File Management
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n logs: the list of logs
Sample request URL:
http://localhost/fmerest/logs.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fmerest/logs</requestURI><token>8dd00f82d4dc45677cfc782d7f4eb3e0deb02edc</token><logs>
<log><uri>/fmerest/logs/419</uri><name>419</name>
</log><log>
<uri>/fmerest/logs/418</uri><name>418</name>
</log><log>
<uri>/fmerest/logs/415</uri><name>415</name>
</log></logs>
</serviceResponse>
GET/logs/<log>
Returns the specified log
FME Server REST API Specifications 137
URI:
/fmerest/logs/<log>.<format>
Formats:
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
n name: the name of the log
n jobid: the job id
n size: the size in bytes
Sample request URL:
http://localhost/fmerest/logs/419.xml
Sample response (XML):
<?xml version="1.0" encoding="UTF-8"?><serviceResponse>
<requestURI>/fmerest/logs/419</requestURI><token>8dd00f82d4dc45677cfc782d7f4eb3e0deb02edc</token><log>
<name>FME_7D150E1F_1345744538639_6440.log</name><jobid>419</jobid><size>41312</size><download>
<uri>/fmerest/logs/419/download</uri><name>download</name>
</download><view>
<uri>/fmerest/logs/419/view</uri><name>view</name>
REST API Documentation
138 FME Server REST API Specifications
Log File Management
</view></log>
</serviceResponse>
GET/logs/<log>/view
Displays the contents of the log.
URI:
/fmerest/logs/<log>/view
Formats:
text/plain
xml, json, html
HTTP Method(s):
GET
Parameters:
n none
Response elements:
The log file contents is returned as an HTTP stream if the operation is suc-cessful, otherwise error code and message will be returned
Sample request URL:
http://localhost/fmerest/logs/419/view
GET/logs/<log>/download
Downloads the log.
URI:
/fmerest/logs/<log>/download
Formats:
application/octet-stream
HTTP Method(s):
GET
FME Server REST API Specifications 139
Parameters:
n none
Response elements:
The log file is returned as an HTTP stream if operation is successful, other-wise error code and message will be returned
Sample request URL:
http://localhost/fmerest/logs/419/download
DELETE/logs
Deletes log files
URI:
/fmerest/logs.<format>
Formats:
xml, json, html
HTTP Method(s):
DELETE
Parameters:
n maxage: optional. The max age (in days) of log files. Any logs olderwill be deleted.
Response elements:
n HTTP 200 is returned if the operation is successful, otherwise errorcode and message in the requested format will be returned.
Sample request URL:
http://localhost/fmerest/logs
(Delete all log files)
http://localhost/fmerest/logs?maxage=5
(Delete all log files that are more than 5 days old)
REST API Documentation
140 FME Server REST API Specifications