We manage a catalogue website that displays objects the client manages in a 3th party application. The objects in the catalog are a CPT, created and updated via the API from the 3th party application. Currently, the API is called every 30 mins, collecting information of the objects with a 'last change' timestamp of the last 30 minutes. (+ a manual update button) Far from great, and we had issues with certain actions not triggering the last change timestamp or taking them out of the API, so no update (remove the object) could be made.
The 3th party application had an update to their API and introduced Webhooks. Now we can create webhooks in their portal and send a signal if an object is updated or has a specific status change.
We need to make a couple of changes to the existing plugin to start to make use of the new webhooks.
The webhook posts a JSON object, containing a signature, an object URL, and an eventtype. We can store the signature in the plugin settings, like the API key. And use the object URL to call the API and use the existing code to process the updated information to take the object offline.
We need to create a URL where the webhook can post to, and from there, use the plugin functions and check against the signature.
How can we create this URL with the plugin?