Difference between revisions of "Integration/REST"
Jump to navigation
Jump to search
old>Admin |
Tags: Visual edit: Switched Manual revert |
||
(22 intermediate revisions by 3 users not shown) | |||
Line 10: | Line 10: | ||
# Add Webservice to ide (wadl import) | # Add Webservice to ide (wadl import) | ||
#* URL: [ServerName]/[ApplicationName]/rest/[SolutionSystemName].wadl | #* URL: [ServerName]/[ApplicationName]/rest/[SolutionSystemName].wadl | ||
#* If import causes trouble: Download the wadl file | |||
# Create a new project | # Create a new project | ||
## Add REST Client to project | ## Add REST Client to project | ||
Line 15: | Line 16: | ||
## Add JAXB bindings to project (use XSD schema) | ## Add JAXB bindings to project (use XSD schema) | ||
##* URL: [ServerName]/[ApplicationName]/rest/[SolutionSystemName].xsd | ##* URL: [ServerName]/[ApplicationName]/rest/[SolutionSystemName].xsd | ||
##* If import causes trouble: Download the xsd file | |||
==== Sample code for list view (BASIC athentication) ==== | ==== Sample code for list view (BASIC athentication) ==== | ||
<syntaxhighlight lang="java"> | |||
//Create session | |||
FirmabilerClient session = new FirmabilerClient(); | |||
session.setUsernamePassword("admin", "password1223"); | |||
//Set search parameters (first parameter is a dummy) | |||
FirmabilerList result = session.getList(FirmabilerList.class, "", "TITEL=Kasper" ); | |||
//Retrieve data and print | |||
List <FirmabilerListItem> list = result.getFirmabilerListItem(); | |||
for(int i=0; i<list.size(); i++) { | |||
//Handle single item | |||
FirmabilerListItem item = list.get(i); | |||
System.out.println( item.getDataID() + "\t" + item.getNUMMERPLADE() ); | |||
} | |||
//Close connection | |||
session.close(); | |||
</syntaxhighlight> | |||
==== Sample code for list view (parameter credentials) ==== | ==== Sample code for list view (parameter credentials) ==== | ||
<syntaxhighlight lang="java"> | |||
//Create session | |||
FirmabilerClient session = new FirmabilerClient(); | |||
//Login and set search parameters | |||
FirmabilerList result = session.getList(FirmabilerList.class, "admin", "password1223", "TITEL=Kasper" ); | |||
//Retrieve data and print | |||
List <FirmabilerListItem> list = result.getFirmabilerListItem(); | |||
for(int i=0; i<list.size(); i++) { | |||
//Handle single item | |||
FirmabilerListItem item = list.get(i); | |||
System.out.println( item.getDataID() + "\t" + item.getNUMMERPLADE() ); | |||
} | |||
//Close connection | |||
session.close(); | |||
</syntaxhighlight> | |||
== URL structure == | |||
When logged in the following URLs are available without further authentication | |||
Data list operations: GET, PUT | |||
<syntaxhighlight lang="ini"> | |||
https://<server>/<application>/rest/<solution> | |||
</syntaxhighlight> | |||
Data item operations: GET, POST | |||
<syntaxhighlight lang="ini"> | |||
https://<server>/<application>/rest/<solution>/<DataID> | |||
</syntaxhighlight> | |||
'''Note: The fowllowing file handling endpoints are scheduled for Q2 2020''' | |||
File list operations: GET, PUT | |||
<syntaxhighlight lang="ini"> | |||
https://<server>/<application>/rest/<solution>/<DataID>/<FieldName>/ | |||
</syntaxhighlight> | |||
File item operations: GET | |||
<syntaxhighlight lang="ini"> | |||
https://<server>/<application>/rest/<solution>/<DataID>/<FieldName>/<ID> | |||
</syntaxhighlight> | |||
=== Query parameters === | |||
The REST API supports the same filtering and search parameters, as the list-command [[Integration/Content_source]]. | |||
Latest revision as of 11:15, 22 April 2024
Introduction to the REST interface
This article has not yet been fully converted to Wiki format.
Please download the original article: Tempus Serva REST interface.pdf
Netbeans quick start guide
Steps to create a simple interaction
- Add Webservice to ide (wadl import)
- URL: [ServerName]/[ApplicationName]/rest/[SolutionSystemName].wadl
- If import causes trouble: Download the wadl file
- Create a new project
- Add REST Client to project
- Point to newly created webservice: [SolutionSystemName]
- Add JAXB bindings to project (use XSD schema)
- URL: [ServerName]/[ApplicationName]/rest/[SolutionSystemName].xsd
- If import causes trouble: Download the xsd file
- Add REST Client to project
Sample code for list view (BASIC athentication)
//Create session
FirmabilerClient session = new FirmabilerClient();
session.setUsernamePassword("admin", "password1223");
//Set search parameters (first parameter is a dummy)
FirmabilerList result = session.getList(FirmabilerList.class, "", "TITEL=Kasper" );
//Retrieve data and print
List <FirmabilerListItem> list = result.getFirmabilerListItem();
for(int i=0; i<list.size(); i++) {
//Handle single item
FirmabilerListItem item = list.get(i);
System.out.println( item.getDataID() + "\t" + item.getNUMMERPLADE() );
}
//Close connection
session.close();
Sample code for list view (parameter credentials)
//Create session
FirmabilerClient session = new FirmabilerClient();
//Login and set search parameters
FirmabilerList result = session.getList(FirmabilerList.class, "admin", "password1223", "TITEL=Kasper" );
//Retrieve data and print
List <FirmabilerListItem> list = result.getFirmabilerListItem();
for(int i=0; i<list.size(); i++) {
//Handle single item
FirmabilerListItem item = list.get(i);
System.out.println( item.getDataID() + "\t" + item.getNUMMERPLADE() );
}
//Close connection
session.close();
URL structure
When logged in the following URLs are available without further authentication
Data list operations: GET, PUT
https://<server>/<application>/rest/<solution>
Data item operations: GET, POST
https://<server>/<application>/rest/<solution>/<DataID>
Note: The fowllowing file handling endpoints are scheduled for Q2 2020
File list operations: GET, PUT
https://<server>/<application>/rest/<solution>/<DataID>/<FieldName>/
File item operations: GET
https://<server>/<application>/rest/<solution>/<DataID>/<FieldName>/<ID>
Query parameters
The REST API supports the same filtering and search parameters, as the list-command Integration/Content_source.