Use the GET /notifications Endpoint

Webhooks allow admins to provide a secure destination URL, of their choosing, where received or sent fax notifications are auto-posted by the API. The advantage of this approach is that this allows you to configure your applications to pick up this information and route through your workflows as needed.

The GET /notifications endpoint allows eFax Enterprise users to determine the operational status (SUCCESS, FAILED, or QUEUED) of their inbound or outbound webhook notifications.

There are two usage options for the GET /notifications endpoint, calling an empty endpoint to return a record of all notifications, regardless of status, or setting parameters to customize and narrow your search.

Calling the GET /notifications Endpoint Without Parameters

Using this endpoint without request parameters (empty) returns a list of ALL successful, failed, and queued webhook notifications for both inbound and outbound faxes. For inbound faxes, these webhooks allow you to download the actual fax, whereas for outbound faxes, each notification contains fax metadata for each sent fax.

Calling the GET /notifications Endpoint With Parameters

To avoid large responses containing data that must be sifted though, you can use request parameter filters to customize the search based on fax direction, sent status, and time stamps. For example, to find all failed outbound webhook notifications for a given date range, you would call (GET https://api.securedocex.com/notifications) with the following fields set:

Note: pagination-limit is an integer that shows the number of responses to include, defaulted to 500. pagination-offset-id is a string that contains the notification_id (UUID) of the last processed element; the response will include all records after that notification_id.


curl --request GET \
--url https://api.securedocex.com/notifications \
--header 'Accept: application/json' \
--header 'Authorization: ' \
--header 'pagination-limit: ' \ 
--header 'pagination-offset-id: ' \
--header 'transaction-id: '
{
  "before": "2024-05-09T19:07:38.320Z"
  "after": "2024-05-12T13:35:40.120Z"
  "fax_direction": "OUTBOUND”
  "sent_status": "FAILED"

}

This returns:

[
  { 
    "app_id": "12345",
    "user_id": "12345678-87654321",  
    "fax_id": "3f3123e2c-ff29-8ca3-02e5-8f0f87cb8ebb",
    "notify_id": "ed43b4e5-cdc5-bf9e-90cb-7945af0aa135",
    "fax_direction": "OUTBOUND",
    "fax_completed_timestamp": "2024-05-10T15:07:01.000Z",
    "notify_type": "WEBHOOK",
    "notify_destination": "https://some.host.url",
    "sent_status": "FAILED"
  },
  {
    "app_id": "12345",
    "user_id": "87654321-12345678",
    "fax_id": "746325a7-0470-4f49-2780-9e3a167b8611",
    "notify_id": "fd093799-128c-afbc-2e5d-b8d6638880b3",
    "fax_direction": "OUTBOUND",
    "fax_completed_timestamp": "2024-05-10T17:08:02.000Z",
    "notify_type": "WEBHOOK",
    "notify_destination": "https://some.host.url",
    "sent_status": "FAILED"
  }
]
....

Webhook Best Practices

The eAPI webhooks serve as notification alerts to the user that faxes/information is available.

For each notification, the customer application has 10 seconds to respond (meaning we wait 10 seconds per webhook attempt). If we get no response from the customer side after 10 seconds, the webhook will timeout. To avoid duplications of fax notifications, it is important that users acknowledge the notification on their side as soon as possible and asynchronously download the fax/metadata.

Outbound and inbound webhooks are handled the in the same manner — each have 4 attempts in total: 1 initial attempt by the primary service and if there is a failure, it goes to a “retry” service which immediately tries again (retry 1, attempt 2), then waits 5 minutes before a second retry (attempt 3), then waits 5 minutes before the final attempt (retry 3, attempt 4).

Keep in mind that Consensus is only responsible for posting the notification saying that a new inbound fax is available or what the status is of an outbound fax; webhook failures should be handled on the customer side, as well as any retry attempts. Customers should monitor webhook status via the GET /notifications endpoint. We recommend running query /notifications for FAILED only after all retry attempts are exhausted; if run before that time is up then it is possible to get duplicate notifications. Ideally, your workflows should only mark notifications as FAILED after all retry attempts are completed from our side.

Actions to Take If You See Failed Webhooks

If the GET /notifications endpoint does webhooks with a “sent_status” of “FAILED”, you have two ways to recover:

 

Return to the top of this page.