# Create Outbound Fax

## GET or POST Request <a href="#get-or-post-request" id="get-or-post-request"></a>

{% hint style="info" %}
<https://v1.api19.com/fax/create>
{% endhint %}

Send us a GET or POST request with your key and the source, destination and files.

We we will deliver your fax and get back to you. We support 3 methods to send fax files to us. You can choose whichever you would prefer.

## Method 1 - HTTP Post of file1=url, file2=url

This method is pretty straight forward, send file1=, file2= with urls and get is supported

```
curl -X POST https://v1.api19.com/fax/create \
 -d "destination=3035551212" \
 -d "file1=http://x.com/file1.jpg" \
 -d "file2=http://x.com/file2.jpg" \
 -d 'key=your-key'
```

## Method 2 - JSON Post of URLs

Send a JSON post to our server with the URLs in an array called files

Example JSON post:

```json
{
    "key": "hfg29hg23fh23",
    "source": 3038883333,
    "destination": 8823321111,
    "files": [
        "http:\/\/example.com\/test1.jpg",
        "http:\/\/example.com\/fax2.jpg"
    ]
}
```

## Method 3 - HTTP Multipart File Post

Send an HTTP Multipart post or use CURL @file to include the file in the multipart. You don't have to name them file1=, we will look for any multipart file attached.

```javascript
curl -X POST https://v1.api19.com/fax/create \
 -F "source=3038821111" \
 -F "destination=3035551212" \
 -F "file1=@/path/to/local/file1.jpg" \
 -F "file2=@/path/to/local/file2.jpg" \
 -F 'key=your-key'
```

## HTTP Post Variables Supported

<table data-header-hidden><thead><tr><th width="152.09088134765625"></th><th width="136.72723388671875"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Required</td><td>Type</td></tr><tr><td>key</td><td>yes</td><td>api key</td></tr><tr><td>source</td><td>yes</td><td>fax number with us</td></tr><tr><td>destination</td><td>yes</td><td>destination fax number</td></tr><tr><td>file1</td><td>yes</td><td>URL with supported file type</td></tr><tr><td>file2-10</td><td>no</td><td>add up to 20 files</td></tr><tr><td>ignore_bad_files</td><td>no</td><td><p>yes</p><p>ignore all files you send that are bad and continue sending the rest</p></td></tr><tr><td>@file</td><td>no</td><td>use CURL or http multi post to attach files to your web request</td></tr><tr><td>call_back_url</td><td>no</td><td>URL to call you back when done</td></tr></tbody></table>

{% tabs %}
{% tab title="Curl Post" %}

```php
curl -X POST https://v1.api19.com/fax/create \
 -d "source=3038821111" \
 -d "destination=3035551212" \
 -d "file1=http://x.com/file1.jpg" \
 -d "file2=http://x.com/file2.jpg" \
 -d 'key=your-key'
```

{% endtab %}

{% tab title="JSON Response" %}

```php
{
  "status": "error",
  "error": "invalid fax number"
}

OR

  "status": "error",
  "error": "invalid destination number"
}

OR

{
  "status": "error",
  "error": "invalid file format",
  "file: "http://x.com/file.wav"
}

OR

{
  "status": "ok",
  "fax_id": 32273421
}

OR

{
    "status": "error",
    "error": "no files",
    "not_supported_files": {
        "moo.mov": "unsupported file extension"
    }
}
```

{% endtab %}
{% endtabs %}

## HTTP Call Back

If you request, we will send you an HTTP call back with your fax status with the following parameters using HTTP POST:

```
(
    [fax_id] => 18123772
    [status] => success
    [pages] => 1
    [long_status] => Success
    [seconds] => 200
    [source] => 7209994255
    [destination] => 7208886293
    [direction] => outbound
    [send_time] => 2024-04-10 05:04:31
    [complete_time] => 2024-04-10 06:04:28
)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.api19.com/faxing/create-outbound-fax.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
