Reference : JSON REST API reference
  
JSON REST API reference
The Representational State Transfer (REST) API for Focal Point is a RESTful interface through which you can access, create and update Focal Point resources by using JSON data format.
This information is also available in PDF format, see:
Focal Point JSON REST API Reference Manual
Setup
To specify the server name for the resource URI, in Focal Point, click Application > Login Page > Login or Balancer URL and specify the appropriate value for the host name.
Note Make sure that the host name or the server name does not change. A change in the host name can lead to broken links in Focal Point integrated systems that link to the Focal Point resources.
Authentication
The requests to the RESTful API must be authenticated by using HTTP basic authentication. Unless you use HTTPS authentication, the user name and password are sent without encryption.
In HTTP basic authentication, character encoding is not specified for user names and passwords. User names and passwords can include only ASCII characters. You might be able to use ISO-8859-1 characters if the characters are correctly encoded by the client.
Character encoding
The JSON information that is retrieved from Focal Point uses UTF-8 character encoding.
For JSON data that is sent to Focal Point, the charset of the Content-Type HTTP header is used (if present). Otherwise, the encoding that is specified in the JSON prolog is used. If no prolog is present, the default for the JSON data is used. The encoding that is used must match any declared encoding. You can use UTF-8 encoding when you communicate with Focal Point and specify UTF-8 encoding in the HTTP header and JSON prolog.
Accessing JSON REST APIs in a multi threaded environment
In Focal Point version 6.5 and later, for client applications to access the REST API in a multi-threaded environment, you must follow these steps:
1 Use the MultiThreadedHttpConnectionManager object to create the HTTP connection object. For example:
...
MultiThreadedHttpConnectionManager connectionManager = new
MultiThreadedHttpConnectionManager();
client = new HttpClient(connectionManager );
...
2 Reuse the HttpClient object from each thread to make REST API requests instead of creating a new HttpClient object for each thread.
Examples
You can refer to the REST API examples to learn how to use the Focal Point APIs. The examples are in Java source files that can be compiled and run.
Prerequisite
Knowledge of Java and REST.
Resources overview
The REST JSON resources in Focal Point are service, element collections, element, and attributes. The following table summarizes the resource types and example REST API URIs for the resources:
 
Resource type
Example REST API URI
Description
Supported REST operations
Service document
https://fpserver.com:9443/fp/resources/
The service document has the high level resources for the workspace, module, views that a user has access to.
GET
Element collection
https://fpserver.com:9443/fp/resources/workspaces/1/modules/1/elements
An element collection has the contents of a view or module.
GET
POST
PUT
Element
https://fpserver.com:9443/fp/resources/workspaces/1/modules/1/elements/1
Element has contents of attributes.
GET
Attribute
https://fpserver.com:9443/fp/resources/workspaces/1/modules/1/elements/1/attributes/1
Attribute.
GET
POST
PUT
DELETE
Links
The JSON representations of Focal Point resources can link to other resources by using the JSON element link. The link is similar to the link in the Atom format.
For more information, see http://www.atomenabled.org/developers/syndication/atom-format-spec.php#element.link.
 
Link attribute
Description
href
(mandatory) The URI of the referenced resource.
rel
(optional) The rel attribute can have one of the following values:
alternate: An alternate representation of the resource. For example, a HTML page.
enclosure: A related resource that might be large and require special handling. For example, a binary file.
related: A related resource.
self: The resource representing itself.
edit: A reference to a resource that can be edited, and might also be the resource.
title
(optional) A title for the link.
type
(optional) The media (MIME) type of the resource.
hreflang
(optional) The language of the resource.
length
(optional) The size of the referenced resource in bytes.
See
Service documents
Element collection
Elements
Attributes
Go up to
Reference