New document webhook events are now available in beta

Hello devs!

We have recently released three new webhook events you can subscribe to, these are:

  • archiverelation.create
  • archiverelation.update
  • archiverelation.delete

The intention behind these is to give integrations that require a sync of documents between their system and Tripletex a way to avoid polling documentArchive for changes. These events will trigger for any file uploaded with relation to an invoice, order or project. The events will not trigger for files uploaded via for example Document -> Archive in the main menu in GUI.

The payload that you will get will contain the document, as well as the archive object type (like PROJECT) and the archive object id.

If you want to use these events we recommend you set the following fields to the subscription to also fetch the document data:

"fields": "*, document()"

The payloads will look like the following example:

{
  "value" : {
    "id" : 1,
    "version" : 0,
    "url" : null,
    "document" : {
      "id" : 4,
      "version" : 5,
      "url" : "tripletex.no/v2/documentArchive/4",
      "fileName" : "file.png",
      "size" : 136955,
      "archiveDate" : "2022-08-02",
      "mimeType" : "image/png"
    },
    "archiveObjectId" : 8,
    "archiveObjectType" : "PROJECT"
  },
  "event" : "archiverelation.update",
  "subscriptionId" : 3,
  "id" : 1
}

These events are as mentioned currently in beta, so we’d love your feedback on this. Also, if you have an event that you would like us to add please let us know! You can reach us via our contact form.