WebAPI Example

In this example, a content item is updated based on an json payload which is converted into xml.

Smartsite SXML CopyCode image Copy Code
<se:webapi method="savecmsitem" save="result">
  <se:parameters>
    <se:parameter name="payload">{string.xmldecode(getitemxmlfromjson(request.body()))}</se:parameter>
    <se:parameter name="url">{channel.hostheaders.getdefault(channel.defaultchannel())}mgr/webapi.net</se:parameter>
  </se:parameters>
</se:webapi>