My Products
Help
Snuffsis
CONTRIBUTOR ***

Question about webhook body

by Snuffsis (Updated ‎25-08-2022 09:58 by Snuffsis )

When we receive the webhook notification from visma.net, it arrives as a json array of json objects, but so far only with one object in the array.

example: 

 

[
  {
    "notificationId": "xxxx-xx-xx-xx-xxxx",
    "contextId": "xxxx",
    "event": "salesorder_changed",
    "relativeResourceUri": "api/v1/salesorder/SO/xxxx",
    "resourceUri": "https://integration.visma.net/API/controller/api/v1/salesorder/SO/xxxx",
    "status": "Completed",
    "timeStamp": 637969430208130000
  }
]

 

 

But in the article in the knowledge base, it is written as only being a single object sent, not an array.

Snuffsis_0-1661414187166.png

 

So, my question is, is there a possibility that there will be multiple notifications sent in one notification from visma.net, or is it always just one, as in the example in your article, just that it arrives as an array? 

2 REPLIES 2
Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

The payload that is sent is a JSON array. This is because under load, Visma.net Integrations will group the notifications together and send them only once instead of sending each one individually. For instance if there were 5 "customerinvoice_changed" events that happen in a short period of time, Visma.net Integrations will group these and invoke the "hookUri" only once, instead of making 5 http requests.

Snuffsis
CONTRIBUTOR ***

by Snuffsis

Thank you,

 

That is as I figured it was then.