# Send the PDF report to Google Drive

> With this recipe, every case closed in Certificall automatically uploads its **signed PDF report** to the Google Drive folder of your choice. No code is required: everything is configured in Zapier, in three steps.

# Automatically send the PDF report to Google Drive with Zapier

It is intended for account managers and administrators who know how to create a Zap. It is the fastest recipe to set up, with nothing to host. To compare with n8n, see [Zapier or n8n?](../introduction.md#zapier-or-n8n)

:::info Before you start
How it works, the common prerequisites (including **case sharing**), the webhook content and the common limitations are described in [Automate without coding](../introduction.md). Read it first.
:::

## Zapier-specific prerequisites

| Prerequisite | Details |
|---|---|
| **A Zapier account** | With a plan that allows using **Webhooks by Zapier**. |
| **A Google Drive account** | And the folder in which to store the reports. |

## Go faster: let the AI build the Zap

Zapier can build the Zap for you from a description. Copy this prompt, paste it into the Zap editor's AI assistant, then check the result.

{`Create a 3-step Zap:

1. Trigger: "Webhooks by Zapier", event "Catch Hook".

2. Action: "Webhooks by Zapier", event "GET".
   - URL: the "caseUrl" field received in step 1.
   - As JSON: No.
   - Unflatten: Yes.
   - No headers, no authentication.

3. Action: "Google Drive", event "Upload File".
   - File: the "file" field from step 2.
   - Convert to Document?: No.
   - File Name: "Certificall_" followed by the "cfRef" field from step 1.
   - I will choose the Google account and the destination folder myself.`}

Once the Zap is created, you still need to:

1. **Check each step** against the settings described below: the AI may deviate slightly from the request.
2. **Connect your Google account** and choose the destination folder (step 3).
3. **Have the Catch Hook address registered** with Certificall (step 1, item 4).
4. **Test**, then **publish** the Zap.

:::info No AI assistant in your plan?
The availability of the AI assistant depends on your Zapier plan. If you do not have access to it, follow the steps below.
:::

## Step 1 — Receive the Certificall webhook

1. In Zapier, create a new Zap.
2. As the *Trigger*, choose **Webhooks by Zapier**, then the **Catch Hook** event.
3. Zapier displays an address of the form `https://hooks.zapier.com/hooks/catch/...`. Copy it.

4. Have this address registered as your company's case-closed webhook:
   - **by your technical team**, through the API: see [Webhook configuration](../../api/webhook.md#configuration). The API requires a token (`authToken`): Zapier does not check it, so use a random value;
   - **or by your Certificall contact**, to whom you send the address.
5. Close a test case, then click **Test trigger** in Zapier: the received webhook is displayed, with its fields.

:::warning Keep the address secret
With Zapier, the Catch Hook address is the webhook's only protection: anyone who knows it can send data to your Zap. Only share it with the people in charge of the setup.
:::

## Step 2 — Download the PDF report

1. Add a **Webhooks by Zapier** action, with the **GET** event.
2. Configure it as follows:

| Setting | Value |
|---|---|
| **URL** | The **caseUrl** field from step 1 |
| **As JSON** | *No* |
| **Unflatten** | *Yes* |
| **Headers, authentication** | None |

3. Test the action: the signed PDF report appears in the **file** field of the result.

## Step 3 — Upload the PDF to Google Drive

1. Add a **Google Drive** action, with the **Upload File** event.
2. Connect your Google account, then configure the action:

| Setting | Value |
|---|---|
| **Drive** and **Folder** | The folder in which to store the reports |
| **File** | The **file** field from step 2 |
| **Convert to Document?** | *No* |
| **File Name** | `Certificall_` followed by the **cfRef** field from step 1 |

3. Test the action, check that the PDF has arrived in your Drive, then **publish the Zap**.

The `.pdf` extension is added to the file name automatically.

### Optional: organize your reports better

- **Name the file with your own reference**: use the **reportId** field, the reference you gave the case when creating it, instead of or in addition to **cfRef**.
- **Include the template in the name**: add the **frame** field, which contains the template name.
- **Sort reports by template**: in **Folder**, use the **frame** field to upload each PDF into a subfolder named after its template.

## Zapier-specific limitations

In addition to the [common limitations](../introduction.md#common-limitations):

| Limitation | Details |
|---|---|
| **Zapier task usage** | Each closed case triggers the Zap and uses Zapier tasks: one per successful action, so two per case with this recipe. Depending on your volume, a paid plan may be required. |
| **Hosting outside the European Union** | The report, its photos and its GPS positions pass through Zapier, a service hosted outside the European Union. |

## Troubleshooting

| Symptom | Likely cause | What to do |
|---|---|---|
| The **caseUrl** field is empty | Sharing is not enabled for the case | Contact your Certificall contact to enable case sharing. |
| Step 2 fails with a **403** error | The case cannot be shared, or its sharing has expired | Check the case sharing with your Certificall contact. |
| Step 2 fails with a **404** error | The link is invalid or the report cannot be found | Check that the step 2 URL is mapped to the **caseUrl** field from step 1, with no added text. |
| The file uploaded to Drive is unreadable | Google tried to convert it into a document | In step 3, set **Convert to Document?** to No. |
| The Zap never triggers | The Catch Hook address is not registered with Certificall, or the Zap is not published | Check the address registration (step 1), then that the Zap is published. |
