Skip to main content

 Element reference

Service API elements from <alias> to <workflow>

<webevent>

Summary

This element describes a single event included in the payload sent to the client for a configured Webhook.

Multiple events can happen within a short period of time and event notification are posted asynchronously, that is why PageSeeder sends a payload that includes multiple events to the client app:

<webevents>
  <webhook id="[id]" [name="[name]"] />
  <!-- Web events are listed here -->
</webevents>

Usage context

Permitted content<comment>
<group>
<groupfolder>
<properties>
<member>
<membership>
<project>
<publication>
<task>
<uri>
<webhook>
<workflow>
Permitted parent<webevents> 

Minimal

When the object type of a webhook is set to minimal, only the identifiers are included in the object elements. Otherwise, the entire object element is included. The minimal representation of the each object is as follows:

<comment     id="" />
<group       id="" name="" />
<groupfolder id="" path="" />
<properties />
<member      id="" username="" [email=""] />
<membership  id="" />
<project     id="" name="" />
<publication id="" />
<task        id="" />
<uri         id="" path="" [docid=""] />
<webhook     id="" [name=""] />
<workflow    id="" />

All the @id attributes have type xs:long except for publication/@id which has the pattern [a-zA-Z0-9-_]+ and properties which has no @id attribute.

Attributes

NameTypeRequiredDescription
datetimexs:datetimeyesDate time of event occurring
idxs:string yesGenerated from object ID and followed by the nano time 
typeenumyesType of object and action

@datetime

The date and time of event occurring in ISO 8601 format, precision is second.

@id

The ID of the Web event is constructed as [object id].[nano time]. For example, when an event affects member ID 123, the returned id might be 123.1098767567452.

@type

The type of event is constructed as [object].[action]. For example, when a URI is edited, the returned type is uri.modified.

Objects / action table

archivedcreateddeletedmodifiedunarchivedpingstartedupdated
comment
group
groupfolder
groupproperties
member
membership
project
publication
server
task
uri
webhook
workflow

A uri/comment/task/workflow move between groups and a group/project rename produce a deleted and possible created (and modified for uri or updated for task/workflow) event with the relevant groups for each.

A task/workflow deleted will produce an updated event with an empty <task>/<workflow> element.

Legend
  • — admin event
  • — group or project events
  • — project events
  • — server events

Examples

The general format for a single Web event is as follows:

<webevent id="[object id].[nano time]"
          datetime="[datetime]"
          type="[object].[action]">
    <event>
      <group id="" name="">
      [<group .../> ...]
    </event>
    <webhook|uri|comment|task|workflow|membership|member|...
             id=""
             [name="[group name]"]
             [docid=""] [path=""]
             [username=""]
             [email=""]
             [...]>
        [...]
    </...>
  </webevent>

The object representation depends on the webhook configuration. When minimal is chosen, only the identifiers are included. Otherwise, the entire object is included.

The group and project elements are only included when the event is related to a group or project.

Server started

The following is sent when the server starts, if the webhook is configured to receive server events. The minimal and basic formats are identical in this case and there is no object element.

XML

<webevent id="0.3082697494261400"
          datetime="2022-10-12T11:35:15+11:00"
          type="server.started" />

JSON

{
  "id":"0.3082697494261400",
  "datetime":"2022-10-12T11:35:15+11:00",
  "type":"server.started"
}

Ping

The following is sent when the webhook is created or when the ping service is used. The following shows minimal format. If the webhook is configured to receive the basic object type, the complete <webhook> element is included.

XML

<webevent id="123.3082710362553300"
          datetime="2022-10-12T11:35:15+11:00"
          type="webhook.ping">
  <webhook id="123" name="Webhook Demo"/>
</webevent>

JSON

{
  "id":"123.3082710362553300",
  "datetime":"2022-10-12T11:35:27+11:00",
  "type":"webhook.ping",
  "webhook":{"id":123,"name":"Webhook Demo"}
}

Comment modified

The following is sent when a comment is modified. The following shows minimal format. If the webhook is configured to receive the basic object type, the complete <comment> element is included.

XML

<webevent id="676267.3082850428909000"
          datetime="2022-10-12T11:37:48+11:00"
          type="comment.modified">
  <event>
    <group id="4" name="sample-demo"/>
  </event>
  <comment id="676267"/>
</webevent>

JSON

{
  "id":"676267.3082850428909000",
  "datetime":"2022-10-12T11:37:48+11:00",
  "type":"comment.modified",
  "event":[{"id":4,"name":"sample-demo"}],
  "comment":{"id":676267}
}

PSML document modified

The following is sent when a PSML document is modified. The following shows minimal format. If the webhook is configured to receive the basic object type, the complete <uri> element is included.

XML

<webevent id="4.3092366211880300" 
          datetime="2022-10-12T14:16:23+11:00" 
          type="uri.modified">
  <event>
    <group id="4" name="sample-demo"/>
  </event>
  <uri id="4" path="/ps/sample/demo/index2.psml" />
</webevent>

JSON

{
  "id":"4.3092366211880300",
  "datetime":"2022-10-12T14:16:23+11:00",
  "type":"uri.modified",
  "event":[{"id":4,"name":"sample-demo"}],
  "uri":{"id":4,"path":"/ps/sample/demo/index2.psml"}
}

Publication modified

The following is sent when a PSML document within a publication is modified. The following shows the basic format. Lists of URIs can be included under the following elements depending on the change to the publication <added>, <modified>, <removed>, <deleted>.

XML

<webevent id="4693949.1533067556515800"
          datetime="2022-11-01T12:17:35+11:00"
          type="publication.modified">
    <event>
      <group id="4" name="sample-demos"/>
    </event>
    <publication id="sample-colour"
                 hostid="1"
                 rooturiid="897830"
                 title="Colour"
                 defaultgroupid="4"
                 type="default">
      <added>
        <uri id="897831" scheme="http" ...>
          <displaytitle>Yellow</displaytitle>
        </uri>
        <uri id="897832" scheme="http" ...>
          <displaytitle>Green</displaytitle>
        </uri>
      </added>
      <modified>
        <uri id="897830" scheme="http" ...>
          <displaytitle>Colour</displaytitle>
        </uri>
      </modified>
    </publication>
  </webevent>

JSON

{
  "id": "4693949.1533067556515800",
  "datetime": "2022-11-01T12:17:35+11:00",
  "type": "publication.modified",
  "event": [{"id": 4, "name": "sample-demos"}],
  "publication": {
    "id": "sample-colour",
    "hostid": 1,
    "rooturiid": 897830,
    "title": "Colour",
    "defaultgroupid": 4,
    "type": "default",
    "added": [
      {
        "id": 897831,
        "scheme": "http",
        "displaytitle": "Yellow",
        ...
      },
      {
        "id": 897832,
        "scheme": "http",
        "displaytitle": "Green",
        ...
      }
    ],
    "modified": [
      {
        "id": 897830,
        "scheme": "http",
        "displaytitle": "Colour",
        ...
      }
    ]
  }
}

The same URI might appear to be added more than once to the same publication depending on the state of the internal publication cache.

Schema

XML Schema

<xs:element name="webevent">
  <xs:sequence>
    <xs:element ref="event" />
    <xs:choice minOccurs="1" maxOccurs="1">
      <xs:element ref="comment"/>
      <xs:element ref="group"/>
      <xs:element ref="groupfolder"/>
      <xs:element ref="properties"/>
      <xs:element ref="member"/>
      <xs:element ref="membership"/>
      <xs:element ref="project"/>
      <xs:element ref="publication"/>
      <xs:element ref="task"/>
      <xs:element ref="uri"/>
      <xs:element ref="webhook"/>
      <xs:element ref="workflow"/>
    </xs:choice>
  </xs:sequence>
  <xs:attribute name="datetime" type="xs:dateTime" />
  <xs:attribute name="id" type="xs:string" />
  <xs:attribute name="type" type="xs:string" />
</xs:element>

Relax Schema

element webevent {
  attribute datetime { xs:dateTime },
  attribute id { xs:string },
  attribute type { xs:string },
  element event,
  (comment | group | groupfolder | properties |
   member | membership | project | publication |
   task | uri | webhook | workflow)
}

Compatibility

Webhooks were introduced in version 5.9500.

Events added in subsequent versions:

  • publication.* events introduced in version 5.9800 
  • server.started event introduced in version 5.9900
Created on , last edited on