Publication Events

Get Publication Events

Required scope: public-api:read

Description

This endpoint returns publication events (publish, unpublish, update) for a project.

Use Cases
  • Reliably fetch documents publication state changes to sync with another system
  • Cache invalidation management
Curl Example
ACCESS_TOKEN=ey1234
curl -k -X GET "https://server.livingdocs.io/api/v1/publicationEvents" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Endpoint

GET api/v1/publicationEvents
GET api/v1/publicationEvents/:channelHandle

Parameters

NameTypeNotes
:channelHandlestringThe handle of the channel for which you want to get the events.
?limitintegerNumber of events to return. Default: 100. Highest limit: 1000.
?reversebooleanReturns the events in reverse order, starting at the biggest id.
?contentTypesstringComma separated list of content types to use as filter.
?documentTypesstringComma separated list of document types to use as filter.
Can be one of article, page, data-record.
?afterintegerDeprecated: Please use id.gte instead.
Return matching events after this event id.
?id.gtestringFilter by event id range.
Supported filters: id.gte, id.gt, id.lte, id.lt.
Example: To retrieve all events since you’ve fetched the last entry, use ?limit=1000&id.gt=40000
?createdAt.gtestringFilter by event date range.
Supported filters: createdAt.gte, createdAt.gt, createdAt.lte, createdAt.lt.
Example: To retrieve all events since a specific timestamp, use ?limit=1000&createdAt.gte=2021-05-01T00:00:00.000Z

Response

200
OK
api/v1/publicationEvents
[
  {
    "id": 910,
    "createdAt": "2016-12-27T09:19:00.928Z",
    "projectId": 30,
    "channelId": 53,
    "documentId": 7892,
    "documentType": "article",
    "eventType": "publish",
    "publicationId": 1066
  },
  {
    "id": 988,
    "createdAt": "2016-12-27T09:32:10.898Z",
    "projectId": 30,
    "channelId": 53,
    "documentId": 7892,
    "documentType": "article",
    "eventType": "unpublish",
    "publicationId": 1100
  },
  {
    "id": 990,
    "createdAt": "2016-12-27T09:33:05.010Z",
    "projectId": 30,
    "channelId": 53,
    "documentId": 8005,
    "documentType": "article",
    "eventType": "publish",
    "publicationId": 1131
  },
  {
    "id": 1011,
    "createdAt": "2016-12-27T09:33:31.517Z",
    "projectId": 30,
    "channelId": 53,
    "documentId": 7892,
    "documentType": "article",
    "eventType": "update",
    "publicationId": 1394
  }
]
200
OK
api/v1/publicationEvents?reverse&limit=2
[
  {
    "id": 1011,
    "createdAt": "2016-12-27T09:33:31.517Z",
    "projectId": 30,
    "channelId": 53,
    "documentId": 7892,
    "documentType": "article",
    "eventType": "update",
    "publicationId": 1394
  },
  {
    "id": 990,
    "createdAt": "2016-12-27T09:33:05.010Z",
    "projectId": 30,
    "channelId": 53,
    "documentId": 8005,
    "documentType": "article",
    "eventType": "publish",
    "publicationId": 1131
  }
]