Skip to content

Webhook mechanism

Alexandre Bouquet edited this page Dec 3, 2024 · 6 revisions

Webhook mechanism

A webhook mechanism is available to avoid query the API to see if there's new data

Capture d’écran 2024-12-03 à 16 03 51

You can setup the URLs where to receive the events in the Nolio API admin.

There are currently 2 webhooks

  • One of for events in the achieved Calendar (Training, Note, Competition)
  • One for new metrics

If you leave it blank, no webhook will be triggered.

Here's example event you will receive

For events:

{
  "notif_type": "new_event",
  "object_type": "Training",
  "object_id": 32263,
  "user_id": 10,
  "date_object": "2024-12-02"
}

For metrics:

{
  "notif_type": "updated_metric",
  "object_type": "Metrics",
  "object_id": 10499,
  "user_id": 100,
  "date_object": "2024-12-03",
  "metric_type": "nombredepas"
}

Notif type can be

  • new_event
  • updated_event
  • new_metric
  • updated_metric

There is a webhook code on the app that is generated by default, and you can change it in the admin. Capture d’écran 2024-12-03 à 16 10 47

This code in set up as a HTTP Header in the request we will send, to verify it's coming from Nolio.

The code is set up in http-x-nolio-key header. Use it to discard calls you receive that do not contains the good code.

Clone this wiki locally