WebAPI Example - Savecmsitem using payload

In this example, a content item is updated based on the specified payload, which must be in a specific xml format.

Smartsite SXML CopyCode image Copy Code
<se:if expression="!request.isaimrequest()">
  <se:webapi username="admin" method="savecmsitem" save="result">
    <se:parameters>
      <se:parameter name="payload">
        <data xmlns="http://smartsite.nl/namespaces/metadocument/2.0">
          <entry>
            <nr>102320</nr>
            <title>Item updated using WebApi macro {datetime.now()}</title>
            <body>
              Item updated using WebApi macro {datetime.now()}
            </body>
          </entry>
        </data>
      </se:parameter>
    </se:parameters>
  </se:webapi>
</se:if>