cluetec header

 

 

 

cluetec logo

 

 

 

Documentation

mQuest HTTP webhook


Author: Christian Herrmann, cluetec GmbH, Germany
Version: 2.0
Date: 2022-08-01


Introduction and detailed documentation about the mQuest HTTP webhook.


Inhalt


History

VersionDateDescription
0.12021-07-20First draft by Christian Herrmann
1.02022-01-01Peer reviewed by Kristian Ferkic
2.02022-08-01Major update to the JSON payloads: result, media & result-with-media
Added section 1.7 Compatibility

 

1.0 Introduction

mQuest webhook is part of an inter-system communication between three components. One being the customer's system (providing an http-endpoint), the mQuest API (and the mQuest webhook).

webhook

The mQuest webhook delivers lightweight notifications proactively to the customer's system. Notifications contain information (meta data) about events on the mQuest platform. Notifications are sent to an http-endpoint of the customer's system and deliver a JSON payload. After receiving a notification the customer's system can use the mQuest API to process the information for its individual use-case.

 

1.1 About events

On the mQuest platform there are a lot of events, that can be interesting, useful or even crucial for an external system (of a customer). E.g.

The entire list of available events that can trigger notifications can be found on the following pages.

 

1.2 About notifications

Notifications contain very little data in order to remain lightweight. Their purpose is to inform the customer's system.

The JSON payload for an event indicating a new data set is available looks like this: Text behind the double-slash serves as explanation and is not part of the payload

 

Most of the times, receiving a notification is only the first step in the process. E.g. after being informed about a new data-set (result-with-media), you probably want to load the actual data-set (and all its media-files).

You do this using the the mQuest API: https://api.mquest.de/

Now the_links attribute in the payload already contains the most commonly used endpoints for the corresponding resource and serves as a suggestion on how to proceed. However, depending on you use-case and process, feel free to use any endpoints that serves you.

 

1.4 Configuration

It is important to know, that you are free to choose, about which events you want to be notified. Not only can you "subscribe" to notifications about certain resources, you can also combine the configuration with the operation that is relevant for you.

Available combinations are:

resourceCREATEUPDATEDELETE
resultxxx
result-with-mediax  
mediax  
taskxxx
questionnairexxx
ridex  
groupxxx
userxxx

 

1.5 Authentication

This is about supported authentication on the endpoint that is exposed in the customer's system. The configuration of the webhook is capable of applying any http-header. I.e. we can send BasicAuth or an API-key with the notification requests. Certificate based authentication (mutual TLS) is not supported yet.

 

1.6 Error handling

If a notification for any event couldn't be sent to the endpoint of the customer's system (e.g. there has been a connection timeout or the http-response-code was not in the allowed 2xx-range), mQuest webhook will retry after 15 minutes. Failing attempts will be retried 1500 times, every 15 minutes (which is aprox. 15 days). If the event couldn't be delivered after 1500 retries, the event will be discarded.

 

1.7 Compatibility

Additional attributes in the payload are not considered a breaking change. I.e. when serializing the JSON payload, use a configuration that ignores unknown attributes. Existing attributes will neither be changed nor removed.

 

2.0 Documentation

On the following pages, you'll find example payloads for every resource including a detailed description for each attribute.

2.1 result

This event is about the data set and only the data set, i.e. if the data set contains media file (e.g. photos) - for the CREATE operation - you will receive a notification even before all the corresponding media-files are available. Regardless of media-files you will receive notifications, once the result has been updated (UPDATE operation) or deleted (DELETE operation). The event for a DELETE operation will only be published once a single data set has been deleted. If the project has been deleted, which implies deleting all data set. There will be only an event for questionnaire.

 

2.2 result-with-media

This event is about the data set and all the media-files (e.g. photos) that belong to the data set. This event occurs only once the data set and all the media-files are available, i.e. have been successfully transferred from the mobile device. I.e. this event occurs only in combination with the CREATE operation.

 

2.3 media

This event is about a single media file. This resource only supports the CREATE operation, once the file has been successfully transfered from the mobile device.

 

2.4 task (documentation update coming soon)

This event is about the task. Task are context "around" the questionnaire (project). Typically all operations are releveant, i.e. CREATE, UPDATE and DELETE.

 

2.5 questionnaire (documentation update coming soon)

This event is about the questionnaire (form) of the project (sometimes refered to as the project itself). Typically all operations are releveant, i.e. CREATE, UPDATE and DELETE.

 

2.6 ride (documentation update coming soon)

This event is about a single ride. A ride is a special kind of data set, conducted by the mQuest traffic app, for traffic projects. It contains multiple counts. After the mobile app has successfully transferred, a ride event will be published using the CREATE operation.

 

2.7 group (documentation update coming soon)

This event is about a single group. User can be organized in groups. Typically all operations are releveant, i.e. CREATE, UPDATE and DELETE.

 

2.8 user (documentation update coming soon)

This event is about a single user. Typically all operations are releveant, i.e. CREATE, UPDATE and DELETE.