---
title: "Drupal 8 - Sending Faxes with Twilio"
url: "https://michalak.world/posts/drupal-8-sending-faxes-with-twilio/"
description: "Drupal 8 - Sending Faxes with Twilio"
summary: "Yep, you read the title correctly and it says “fax.”  Faxes are still used, and Twilio has an API to send and receive faxes that is quite easy to use."
date: 2020-12-06
lastmod: 2026-08-19
tags: ["Drupal","Drupal 8","Drupal 7","Drupal Commerce","Integration","REST API"]
section: "posts"
author: "Michael Michalak"
site: "https://michalak.world/"
---

# Drupal 8 - Sending Faxes with Twilio

Drupal 8 - Sending Faxes with Twilio

Yep, you read the title correctly and it says “fax.”  Faxes are still used more than I thought, and it is really cool that Twilio has an API to send and receive faxes that is quite easy to use.

Today in this post I will be talking about sending faxes from your Drupal website.  Which is quite easy and doesn’t take much code to achieve.

I have pulled together a code example from the Twilio API documents and as you can see below there isn’t much there.

```
use Twilio\Rest\Client;
$twilio = new Client($sid, $token);
$to = “+1234567890”;
$from = “+0987654321”;
$document = “https://example.com/document.pdf”;

$response = twilio->fax->v1->faxes->create($to, $document,["from" => $from]);
```
A couple of notes on the Twilio fax API:
- There isn’t much of a response back which can make error handling or logging a little difficult.
- The document being faxed must be a PDF.

## Resources:
- Twilio: https://www.twilio.com/fax

