# See if a zip is ready

`GET https://api.mailmasker.org/api/v1/drive/zip-jobs/:id`

Whether a zip has been built and saved, and where it is.

- Who can use it: Any signed-in account
- Area: Drive
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/drive-zip-status

`state` is `queued`, then `building` (with `progress_current` of `progress_total` files done), then `delivering` while it is saved into Archives. It ends as `completed`, with the new file's `file_id`, or `failed`, with the reason in `error`.

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `id` | path | yes | The job id from Zip files and folders. | `318` |

## Good to know

- A job that isn't yours, or doesn't exist, answers 404.

## Examples

cURL:

```bash
curl -s 'https://api.mailmasker.org/api/v1/drive/zip-jobs/318' \
  -H "Authorization: Bearer $TOKEN"
```

Perl:

```perl
use Mojo::Base -strict;
use Mojo::UserAgent;

my $ua  = Mojo::UserAgent->new;
my $res = $ua->get('https://api.mailmasker.org/api/v1/drive/zip-jobs/318',
    { Authorization => "Bearer $ENV{TOKEN}" })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
```

homelab-cli:

There is no homelab-cli command for this yet.

## Response

200 OK:

```json
{
  "id": 318,
  "state": "completed",
  "output_name": "drive-export-you-example-com-1793763730.zip",
  "dest_path": "Archives/drive-export-you-example-com-1793763730.zip",
  "file_id": 57
}
```
