Webhooks / Callbacks?

Deals with generic topics such as logging, framework and so on. If you are not sure where to place your topic just put it here.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2763
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Webhooks / Callbacks?

Post by Bernd Welter »

Hi there,

here comes a generic question I'd like to answer in the context of different API versions:
Does PTV API have webhooks support?
Case: if we want to send a lot of request that we need to wait to be processed it would be good to receive responses when they are completed back to our system (our API)?
Currently we could achieve that by sending asynchronous requests to PTV and then periodically check if response is ready to be fetched.
But it would require lots of redundant requests to check, when we don't know if request is done yet or not.
It would be more convenient to get response via webhook.
I did some research and here's my anser - let's start with some theory besides PTV:
FeatureWebhookCallback
DefinitionA webhook is an HTTP-based mechanism that allows one application to automatically send a notification (usually via an HTTP POST request) to another application when a specific event occurs. A callback is a function that is passed as an argument to another function and executed once a specific task is completed.
TriggerEvent in an external applicationA function within a program
CommunicationOver HTTP (REST API)Within a code or application
Execution TypeAsynchronous, over the internetUsually synchronous or within a code
ExampleA payment service sends a notification about a successful paymentJavaScript setTimeout(() => console.log("Done!"), 1000);
Wikipedia (en)Wikipedia: WebhookWikipedia: Callback
Shame on me - I didn't care much about these in the past, probably because we simply do not support webhooks (except for Drive & Arrive!) in xServer1, xServer2 and Developer.

From my understanding
  • the support of webhooks would require dedicated features on "server side" - which we did not implement so far in our APIs.
  • Callbacks should be possible but they rely on the client programming approach
Now let me get back to the customers requirement: an optimal consumption of dta which requires several seconds, minutes or even hours...

Some of our API calls support asynchronous methods (start... watchprogress... fetch) as alternatives to (start..........remain blindfolded for an unknown period.... tadaaa: first feedback ever is the result). Check this article about Bulk Operations

Important to know: If you need more info get back to me 1:1 or respond to this post.
Attachments
xDima2:  "Job" tells you a percentage progress
xDima2: "Job" tells you a percentage progress
Optiflow APOI within Developer does even provide the full result structure with each and every status request. Each column in the chart reflects a tour plan... supersexy!
Optiflow APOI within Developer does even provide the full result structure with each and every status request. Each column in the chart reflects a tour plan... supersexy!
In this example I visualize the progress of a 10-addresses batch geocoding
In this example I visualize the progress of a 10-addresses batch geocoding
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply