MGR’s notification Webhook will notify a URL of your choice via HTTP/HTTPS POST with information about events that occur as MGR processes your data. Notifications can be configured to send webhooks to your server when important events occur within the MGR system. These webhooks allow you to trigger different behaviours in your server depending on the status of the notifications you send.

Webhooks are sent as POST requests with a JSON body. You configure the request body payload in the content section.

So how do you set up webhooks in the notifications?

  1. Please go to the Notifications section in the shop settings.
  2. Click on the EDIT icon next to the notification you want to send it to your server.
  3. From the popup please provide the following 4 information.
    1. Webhook URL – URL of the endpoint
    2. Username – If applicable
    3. Password – If applicable
    4. Payload – JSON Required
  4. The payload is where you define what format the data should be in. Please note that you can change everything to suit your needs, you can use the TAGS for the values where needed. Your data will look like the following example. Please note that the following example is only for illustration purpose.
    {
    "customer_account_url": "{customer_account_url}",
    "ticket_ref": "{ticket_ref}",
    "device_id": "{cf_34977}",
    "model": "{ticket_model}"
    }
Headers
  KEY   VALUE
  Authorization   Basic: username: password
  User-Agent   always mygadgetrepairs
  Content-Type   always application/json
  mgr-event-id   the type of event that triggered the webhook.


Expected response

We expect your server to respond to webhook requests with a 2XX status code within ten seconds. Non-2XX responses, or responses that take more than ten seconds, will be considered failures.

Retry strategy

If your server fails to reply with the expected response, we will retry the webhook request up to five times – every 300 seconds. Please note that you can always retry the failed ones from the webhook queue.

 

Was this article helpful to you?

mm

John Smith

Leave a Reply

You must be logged in to post a comment.