> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.fax.plus/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Start sending faxes in 4 steps

<Frame>
  <img className="block" src="https://mintcdn.com/alohi-faxplus/cC0DzEP8P19x5X1k/resources/get-started/quickstart/quickstart.svg?fit=max&auto=format&n=cC0DzEP8P19x5X1k&q=85&s=148823a67de0781385fc9eee1f56a9e9" alt="Quickstart" width="733" height="314" data-path="resources/get-started/quickstart/quickstart.svg" />
</Frame>

<Steps>
  <Step title="Create a Fax.Plus Account">
    <Note>Fax.Plus API is available for enterprise plan only</Note>
    Please sign up on the [Fax.Plus Platform](https://app.fax.plus) to get started.

    <Frame>
      <video controls>
        <source src="https://mintcdn.com/alohi-faxplus/cC0DzEP8P19x5X1k/resources/get-started/quickstart/fax-plus-signup.mp4?fit=max&auto=format&n=cC0DzEP8P19x5X1k&q=85&s=288acededa3cc5a30b9e51a89b74fd46" type="video/mp4" data-path="resources/get-started/quickstart/fax-plus-signup.mp4" />

        Your browser does not support the video tag.
      </video>
    </Frame>
  </Step>

  <Step title="Get Your API Key">
    Please visit the [Integrations](https://app.fax.plus/profile/integrations) page to get your API key.
  </Step>

  <Step title="Upload a file">
    To send a fax, you need to upload a file to the Fax.Plus server. The file can be in PDF, TIFF, Word, Excel, RTF or image format.

    <Tabs>
      <Tab title="NodeJS SDK">
        ```js theme={null}
        const axios = require('axios');
        const fs = require('fs')
        const FilesApiFp = require('@alohi/faxplus-api').FilesApiFp;
        const Configuration = require('@alohi/faxplus-api').Configuration;

        const config = new Configuration({
            accessToken: accessToken,
            basePath: 'https://restapi.fax.plus/v3',
            // Header required only when using the OAuth2 token scheme
            baseOptions: {
                headers: {
                  "x-fax-clientid": clientId,
                }
            }
        });

        async function uploadFile() {
            const reqParams = {
                "format": 'tiff',
                "userId": '13d8z73c',
                "faxFile": fs.createReadStream(FILE_PATH)
            }
            const req = await FilesApiFp(config).uploadFile(reqParams);
            const resp = await req(axios);
        }

        uploadFile()

        ```
      </Tab>

      <Tab title="Python">
        ```python theme={null}
        from faxplus import ApiClient, FilesApi
        from faxplus.configuration import Configuration

        conf = Configuration()
        conf.access_token = access_token
        # header_name and header_value required only when using the OAuth2 token scheme
        api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
        api = FilesApi(api_client)
        resp = api.upload_file(
            format='tiff',
            user_id='13d8z73c',
            fax_file='/path/to/file.pdf'
        )


        ```
      </Tab>

      <Tab title="Java">
        ```java theme={null}
        /**
         * Example below uses Apache HTTP Client 4 with Fluent API
         **/

        Map<String, String> pathParams = new HashMap<>();
        pathParams.put("user_id", "'13d8z73c'");
        pathParams.put("fax_id", "'132esd4cs31'");

        StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
        String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/report/{fax_id}");

        String result = Request
            .Get(url)
             // The x-fax-clientid header is required only when using the OAuth2 token scheme
            .addHeader("x-fax-clientid", "{client-id}")
            .addHeader("Accept", "'application/pdf'")
            .addHeader("Authorization", "''Bearer {access-token}''")
            .execute()
            .returnContent().asString();

        System.out.println(result.toString());

        ```
      </Tab>

      <Tab title="Go">
        ```go theme={null}
        package main

        import (
            "bytes"
            "net/http"
        )

        func main() {
        package main

        import (
               "bytes"
               "net/http"
        )

        func main() {

            headers := map[string][]string{
                // The x-fax-clientid header is required only when using the OAuth2 token scheme
                "Accept": []string{"application/pdf"},
                "Authorization": []string{"Bearer {access-token}"},
                "x-fax-clientid": []string{"{client-id}"}
            }

            data := bytes.NewBuffer([]byte{jsonReq})
            req, err := http.NewRequest("GET", "https://restapi.fax.plus/v3/accounts/{user_id}/report/{fax_id}", data)
            req.Header = headers

            client := &http.Client{}
            resp, err := client.Do(req)
            // ...
        }


        }
        ```
      </Tab>

      <Tab title="PHP">
        ```php theme={null}
        <?php

        require 'vendor/autoload.php';

        $headers = array(
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {access-token}',
            'x-fax-clientid' => '{client-id}',
        );

        $client = new GuzzleHttp\Client();

        try {
            $response = $client->request('GET', 'https://restapi.fax.plus/v3/accounts', array(
                'headers' => $headers,
            ));
            print_r($response->getBody()->getContents());
        } catch (GuzzleHttp\Exception\BadResponseException $e) {
            print_r($e->getMessage());
        }
        ```
      </Tab>

      <Tab title="cURL">
        ```bash theme={null}
        # You can also use wget
        curl -X GET https://restapi.fax.plus/v3/accounts/{user_id}/files/{fax_id} \
          -H 'Accept: application/pdf'  \
          -H 'Authorization: Bearer {access-token}' \
          # The x-fax-clientid header is required only when using the OAuth2 token scheme
          -H 'x-fax-clientid: "YOUR_CLIENT_ID"'

        ```
      </Tab>
    </Tabs>

    Once the file is uploaded, you will receive a `path` in the response. You will need this `path` to send a fax.

    ```bash theme={null}
    {
      "path": "/storage/2937237320213-213-21323"
    }
    ```
  </Step>

  <Step title="Send a fax">
    To send a fax, you need to provide the recipient's fax number and the file path you received in the previous step.

    <Tabs>
      <Tab title="Javascript">
        ```js theme={null}
        const axios = require('axios');
        const OutboxApiFp = require('@alohi/faxplus-api').OutboxApiFp;
        const Configuration = require('@alohi/faxplus-api').Configuration;

        const config = new Configuration({
            accessToken: accessToken,
            basePath: 'https://restapi.fax.plus/v3',
            // Header required only when using the OAuth2 token scheme
            baseOptions: {
                headers: {
                "x-fax-clientid": clientId,
                }
            }
        });

        async function sendFax() {
            const reqParams = {
                "userId": '13d8z73c',
                "payloadOutbox": {
                    "comment": {
                        "tags": [
                            "tag1",
                            "tag2"
                        ],
                        "text": "text comment"
                    },
                    "files": [
                        "filetosend.pdf"
                    ],
                    "from": "+12345667",
                    "options": {
                        "enhancement": true,
                        "retry": {
                            "count": 2,
                            "delay": 15
                        }
                    },
                    "send_time": "2000-01-01 01:02:03 +0000",
                    "to": [
                        "+12345688",
                        "+12345699"
                    ],
                    "return_ids": true
                }
            }
            const req = await OutboxApiFp(config).sendFax(reqParams);
            const resp = await req(axios);
        }

        sendFax()
        ```
      </Tab>

      <Tab title="Python">
        ```python theme={null}
        from faxplus import ApiClient, OutboxApi, OutboxComment, RetryOptions, OutboxOptions, OutboxCoverPage, PayloadOutbox
        from faxplus.configuration import Configuration

        outbox_comment = OutboxComment(tags=['tag1', 'tag2'],
            text='text comment')

        retry_options = RetryOptions(count=2, delay=15)

        outbox_options = OutboxOptions(enhancement=True, retry=retry_options)

        outbox_cover_page = OutboxCoverPage(include_company_logo=True)

        payload_outbox = PayloadOutbox(from='+12345667',
            to=['+12345688', '+12345699'],
            files=['filetosend.pdf'],
            comment=outbox_comment,
            options=outbox_options,
            send_time='2000-01-01 01:02:03 +0000',
            return_ids=True,
            cover_page=outbox_cover_page)

        conf = Configuration()
        conf.access_token = access_token
        # header_name and header_value required only when using the OAuth2 token scheme
        api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
        api = OutboxApi(api_client)
        resp = api.send_fax(
            user_id='13d8z73c',
            body=payload_outbox
        )
        ```
      </Tab>

      <Tab title="Java">
        ```java theme={null}
        /**
         * Example below uses Apache HTTP Client 4 with Fluent API
         **/

        Map<String, String> pathParams = new HashMap<>();
        pathParams.put("user_id", "'13d8z73c'");

        StrSubstitutor sub = new StrSubstitutor(values, "{", "}");
        String url = sub.replace("https://restapi.fax.plus/v3/accounts/{user_id}/outbox");

        String jsonBody = ...; // See request body example

        String result = Request
            .Post(url)
            // The x-fax-clientid header is required only when using the OAuth2 token scheme
            .addHeader("x-fax-clientid", "YOUR CLIENT_ID")
            .addHeader("Content-Type", "'application/json'")
            .addHeader("Accept", "'application/json'")
            .addHeader("Authorization", "'Bearer {access-token}'")
            .bodyString(jsonBody, "application/json")
            .execute()
            .returnContent().asString();

        System.out.println(result);
        ```
      </Tab>

      <Tab title="Go">
        ```go theme={null}
        package main

        import (
            "bytes"
            "net/http"
        )

        func main() {

            headers := map[string][]string{
                // The x-fax-clientid header is required only when using the OAuth2 token scheme
                "Content-Type": []string{"application/json"},
                "Accept": []string{"application/json"},
                "Authorization": []string{"Bearer {access-token}"},
                "x-fax-clientid": []string{"YOUR CLIENT_ID"}
            }

            data := bytes.NewBuffer([]byte{jsonReq})
            req, err := http.NewRequest("POST", "https://restapi.fax.plus/v3/accounts/{user_id}/outbox", data)
            req.Header = headers

            client := &http.Client{}
            resp, err := client.Do(req)
            // ...
        }
        ```
      </Tab>

      <Tab title="PHP">
        ```php theme={null}
        <?php

        require 'vendor/autoload.php';

        $headers = array(
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {access-token}',
            // The x-fax-clientid header is required only when using the OAuth2 token scheme
            'x-fax-clientid' => '{client ID}',
        );

        $client = new GuzzleHttp\Client();

        // Define array of request body.
        $request_body = ...;  // See request body example

        try {
            $response = $client->request('POST','https://restapi.fax.plus/v3/accounts/{user_id}/outbox', array(
                'headers' => $headers,
                'json' => $request_body,
                )
            );
            print_r($response->getBody()->getContents());
        }
        catch (GuzzleHttp\Exception\BadResponseException $e) {
            // handle exception or api errors.
            print_r($e->getMessage());
        }

        // ...
        ```
      </Tab>

      <Tab title="cURL">
        ```bash theme={null}
        # You can also use wget
        curl -X POST https://restapi.fax.plus/v3/accounts/{user_id}/outbox \
        -H 'Content-Type: application/json'  \
        -H 'Accept: application/json'  \
        -H 'Authorization: Bearer {access-token}' \
        # The x-fax-clientid header is required only when using the OAuth2 token scheme
        -H 'x-fax-clientid: "YOUR CLIENT_ID"'
        ```
      </Tab>
    </Tabs>

    On success, the API will return a response with return a list of fax IDs. Each fax ID represents a fax that was sent to a recipient.

    ```bash theme={null}
    {
      "ids": {
        "+1234567890": "1a2b3c4d5e6f7890",
        "+1345678912": "78901a2b3c4d5e6f"
      }
    }
    ```
  </Step>
</Steps>

## Go further

* Get notified when the fax status changes with [webhooks](/concepts/webhook)
* Explore our API [online](/api-reference) or download the reference in the [OpenAPI](/api-reference/openapi.json) format
