The signature shall be composed as a HMAC (SHA-256) value from the user identifier and the full request payload using the *client secret* which is never transmitted through this API.
Generating Request Signatures
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#. Compose the JSON string for the RPC call
#. Concatenate the user identifier and the JSON string:
``data = user-identifier ":" json-string``
#. Generate the hash value with the HMAC method using the SHA-256 algorithm and the ``client-secret`` value.
#. Send the hash value in the HTTP header ``X-Request-Sign`` together with the ``X-Request-User`` header before the actual JSON-RPC payload.
Before processing the RPC command, the web service provider shall verify the
request signature and in case the signature doesn't match the payload, reject
the request with a JSON-RPC error code ``-32600`` indicating an *invalid
request*.
Retrieving Object Changes
=========================
The API exposes methods for every object type to get particular information about the history of a given groupware object. Method names have the following syntax:
Generating and applying diffs in XML documents is not a trivial topic and if we'd decide to go down the full diff route, we should use existing tools to generate those diffs. But the benefit of a real XML diff is limited in terms of displaying changes to groupware objects because in order to generate a meaningful diff view, the semantics of the individual XML nodes within a certain groupware object are important and pure xml-level differences don't simplify the work of a client.
Thus loading full version of different revisions is likely simpler for clients to derive changes than looking at a XML diff. But in order to optimize the exchanged payload, the API could provide a diff on interpreted "properties" of a groupware object:
Properties are top-level nodes from the Kolab XML Format 3.0 and property names used in the diff data match the ``property-*`` identifiers as described in the XML Format Specification [#]_.
If a property is a struct, the ``new`` parameter only denotes the attributes which differ from the ``old`` value. If an attribute was removed, it shall be represented as an empty string.