Changes between Initial Version and Version 1 of Public/Docs/CinnamonApiConceptualDescription


Ignore:
Timestamp:
Sep 11, 2019, 10:13:29 AM (5 years ago)
Author:
Administrator
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Public/Docs/CinnamonApiConceptualDescription

    v1 v1  
     1= Cinnamon API Conceptual Description
     2== Accessing the Cinnamon API
     3All Cinnamon functions that are part of user interaction, e. g. using [wiki:Docs/CinnamonDesktopClient Cinnamon Desktop Client (CDCplus)], are exposed by Cinnamon Server through an [https://www.w3schools.com/whatis/whatis_http.asp HTTP] based API (Application Programming Interface).
     4
     5Cinnamon API sessions begin with a {{{connect}}} command which returns a {{{ticket}}} value if successful. Further API commands require the returned {{{ticket}}} as a parameter to associate the command with an existing session. A session ends with the {{{disconnect}}} command.
     6
     7Cinnamon Server runs in Apache Tomcat which, by default, listens on port 8080. This can be changed in the Apache Tomcat configuration, if desired.
     8
     9The Cinnamon API used in current applications is the so-called //legacy// API. The term //legacy// had been introduced in the past to distinguish it from another API the server, at that time, exposed. In fact, in current Cinnamon releases, the //legacy// API is the actual API of the system. The path to the legacy API is /cinnamon/cinnamon/legacy.
     10
     11Thus, the API URL of a Cinnamon Server is typically:
     12{{{
     13http://<ip-address>:8080/cinnamon/cinnamon/legacy
     14}}}
     15
     16> **NOTE:** The Cinnamon Server in default configuration is exposed through an unencrypted http address. In real-life scenarios, Cinnamon Server is either inside a VPN (but even in this case, using https often makes sense), or it is behind a proxy using a certificate and pointing to port 8080 of the target system. In such cases, Cinnamon Server addresses look like this:
     17{{{
     18https://mycompany.cinnamon-hosting.de/cinnamon/cinnamon/legacy
     19}}}
     20
     21== Request types
     22See reference (2) for sample code (in C#).
     23
     24=== GET requests
     25A GET request to the Cinnamon Server returns some basic information on the system:
     26{{{#!xml
     27<repositories>
     28  <repository>
     29    <name>content</name>
     30    <categories>
     31      <category>production</category>
     32    </categories>
     33  </repository>
     34  <version>3.8.0</version>
     35  <build>77</build>
     36</repositories>
     37}}}
     38
     39The category settings can be configured on the server as required. Clients can use this information to distinguish their behaviour.
     40
     41=== POST without content operation
     42Most API commands are of this category: they read or write information, but do not access the content.
     43
     44=== POST with file upload
     45Some API commands create or change content in the system. In this case, the content must be uploaded as part of the POST request.
     46
     47=== POST with file download
     48The {{{getcontent}}} command is the only API command that retrieves content from the repository. The response of {{{getcontent}}} is therefore the content file requested instead of an XML response.
     49
     50== References
     51* (1) [wiki:Docs/CinnamonApi Cinnamon API Command Reference]
     52* (2) [https://sourceforge.net/p/cinnamon/code/HEAD/tree/Client/trunk/NativeApiServerConnector/ServerCommandInterface.cs Source code of ServerCommandInterface.cs]