Retrieving your webhooks

To receive an overview of your webhooks, you can send a GET request to https://webhook.api.printdeal.com/webhooks. Your response will look something like:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[
  {
      "uuid": "bb9c54d6-f986-4cb5-a8c2-1116fc4dc911",
      "type": "webhook",
      "status": "Active",
      "description": "Subscription for order events",
      "configuration": {
          "url": "https://mywebsite.com/events",
          "events": [
            "order.created",
            "order.failed"
          ]
      },
      "createdAt": "2021-09-09T05:59:10.000Z",
      "updatedAt": "2021-09-09T05:59:10.000Z"
  },
  {
      "uuid": "477cca78-7403-4854-b681-d1c064070ac8",
      "type": "webhook",
      "status": "Active",
      "description": "Subscription for orderline events",
      "configuration": {
          "url": "https://mywebsite.com/events",
          "events": [
              "orderline.status.updated"
          ]
      },
      "createdAt": "2021-10-25T08:46:39.000Z",
      "updatedAt": "2021-10-25T08:46:39.000Z"
  }
]

The uuid field can be used to retrieve more information about a webhook. You can do this by sending a GET request to https://webhook.api.printdeal.com/webhooks/{uuid}.

Example request for retrieving webhooks

The following PHP code can be used for retrieve webhook information. Make sure you replace the values YOUR_USER_ID_HERE and YOUR_SECRET_HERE with the User-ID and secret you received on the API-credentials page.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://webhook.api.printdeal.com/webhooks",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array(
        "User-ID: YOUR_USER_ID_HERE",
        "API-Secret: YOUR_SECRET_HERE",
    )
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}