openapi: 3.0.0
info:
  title: Fax
  description: Everything about Fax Sending
servers:
  - url: https://rest.clicksend.com
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    fax:
      type: object
      properties:
        user_id:
          type: integer
          description: The ID of the user.
          example: 1
        subaccount_id:
          type: integer
          description: The ID of the subaccount.
          example: 1
        list_id:
          type: integer
          nullable: true
          description: The ID of the list.
          example: null
        message_id:
          type: string
          description: The ID of the message.
          example: 6BBEB11E-CAA6-4B04-8537-63619F3D6B37
        to:
          type: string
          description: The recipient's phone number.
          example: '+61261111122'
        from:
          type: string
          description: The sender's phone number.
          example: '+61298441484'
        carrier:
          type: string
          description: The carrier associated with the message.
          example: ''
        country:
          type: string
          description: The country code.
          example: AU
        custom_string:
          type: string
          description: A custom string associated with the message.
          example: custom_string
        schedule:
          type: string
          description: The scheduled time for sending the message.
          example: '1436874701'
        message_pages:
          type: integer
          description: The number of pages in the message.
          example: 6
        message_price:
          type: string
          description: The price of the message.
          example: '13.2000'
        status_code:
          type: string
          nullable: true
          description: The status code of the message.
          example: '201'
        status_text:
          type: string
          nullable: true
          description: The status text of the message.
          example: Sent
        date_added:
          type: integer
          description: The date when the message was added.
          example: 1457504350
        from_email:
          type: string
          description: The sender's email address.
          example: john@doe.com
        _file_url:
          type: string
          description: The URL of the file associated with the message.
          example: >-
            https://rest.clicksend.com/files/98DDA1A4-8A74-4831-8FAF-CC4B4EBD8241.pdf
        status:
          type: string
          description: The status of the message.
          example: SUCCESS
    currency:
      type: object
      description: The parameters related to currency.
      properties:
        currency_name_short:
          type: string
          description: >-
            The currency used for the sender in three-letter format (e.g. USD,
            EUR, AUD, NZD, etc).
          example: AUD
        currency_prefix_d:
          type: string
          description: >-
            The symbol used to indicate the currency of the sender (e.g. $ , €,
            etc).
          example: $
        currency_prefix_c:
          type: string
          description: The currency basic unit (e.g. cents).
          example: c
        currency_name_long:
          type: string
          description: The full name of the currency.
          example: Australian Dollars
    send-fax:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Fax queued for delivery.
        data:
          type: object
          properties:
            total_price:
              type: number
              example: 13.2
              description: The total price of the fax.
            total_count:
              type: string
              example: 1
              description: The total count of the fax.
            queued_count:
              type: string
              example: 1
              description: The count of the queued fax.
            messages:
              type: array
              items:
                $ref: '#/components/schemas/fax'
              description: The list of messages that were sent.
            _currency:
              $ref: '#/components/schemas/currency'
    calculate-fax-price:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are some prices.
        data:
          type: object
          properties:
            total_price:
              type: number
              description: The total price of the fax messages.
              example: 13.2
            total_count:
              type: string
              description: The total count of the fax messages.
              example: 1
            queued_count:
              type: string
              description: The count of the queued fax messages.
              example: 1
            messages:
              type: array
              items:
                $ref: '#/components/schemas/fax'
              description: The list of messages that were sent.
            _currency:
              $ref: '#/components/schemas/currency'
    pagination:
      type: object
      properties:
        total:
          type: integer
          description: The total number of items available for viewing.
          example: 2
        per_page:
          type: integer
          description: >-
            The number of items returned per page. This is specified in the
            limit parameter. You can have 100 items at maximum, and 15 at
            minimum.
          example: 15
        current_page:
          type: integer
          description: The current page number.
          example: 1
        last_page:
          type: integer
          description: The last page number.
          example: 1
        next_page_url:
          type: string
          nullable: true
          description: >-
            A URL of the next page. It will return **null** if there’s no next
            page.
          example: null
        prev_page_url:
          type: string
          nullable: true
          description: >-
            A URL of the previous page. It will return **null** if there’s no
            previous page.
          example: null
        from:
          type: integer
          description: The number of the first result in the current page.
          example: 1
        to:
          type: integer
          description: The number of the last result in the current page.
          example: 2
    fax_receipt:
      type: object
      properties:
        timestamp_send:
          type: string
          description: The timestamp when the message was sent.
          example: '1450854013'
        timestamp:
          type: string
          description: The timestamp associated with the message.
          example: '1451200622'
        message_id:
          type: string
          description: The ID of the message.
          example: 88AB118E-EB1B-478C-98CE-6C73ABA23F67
        status_code:
          type: string
          description: The status code of the message.
          example: Completed
        status_text:
          type: string
          description: The status text of the message.
          example: ''
        error_code:
          type: string
          description: The error code associated with the message.
          example: ''
        error_text:
          type: string
          description: The error text associated with the message.
          example: ''
        custom_string:
          type: string
          description: A custom string associated with the message.
          example: ''
        subaccount_id:
          type: integer
          description: The ID of the subaccount.
          example: 1
        message_type:
          type: string
          description: The type of message.
          example: fax
    view-fax-receipts:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your delivery receipts.
        data:
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/fax_receipt'
    view-specific-fax-receipt:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here is your fax receipt.
        data:
          $ref: '#/components/schemas/fax'
    view-fax-history:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here is your history.
        data:
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/fax'
paths:
  /v3/fax/send:
    post:
      summary: Send Fax
      operationId: send-fax
      description: >-
        ### **Supported File Types**


        - Supported file types are listed below. If you need to convert a file
        to a supported format, it can be first passed to our uploads endpoint:
        `/uploads?convert=fax`

        - This will return a URL to the converted pdf file that can be used in
        the /fax/send endpoint.

        - Contact us to add support for any other file type.
            

        ### Documents


        | File type | Required to be passed to uploads endpoint first? |

        | --- | --- |

        | pdf | No |

        | docx | Yes |

        | doc | Yes |

        | rtf | Yes |


        _Send a fax using supplied supported file-types._


        ### **Letter File Options**


        ### Use existing URL


        With this option, you can use an existing URL to a `pdf` document. For
        example, you might generate the `pdf` on your server.


        When using an existing url make sure that it is publicly accessible as
        it will not work if it is private.


        ### Upload File to Our Server


        With this option, you can use the
        [/uploads](https://developers.clicksend.com/docs/rest/v3/#upload-media-file)
        endpoint to upload the document. The `/uploads` endpoint returns a URL
        that can be used in the `/fax/send` endpoint.


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | file_url | string | true | none | URL of file to send |

        | source | string | true | none | Your method of sending e.g.
        'wordpress', 'php', 'c#'. |

        | to | string | true | none | Recipient fax number in
        [E.164](https://en.wikipedia.org/wiki/E.164) format. |

        | list_id | integer(int32) | false | none | Your list ID if sending to a
        whole list. Can be used instead of 'to'. |

        | from | string | true |
        [yes](http://help.clicksend.com/SMS/what-is-a-sender-id-or-sender-number)
        | Your sender id. Must be a valid fax number. |

        | schedule | integer(int32) | false | none | Leave blank for immediate
        delivery. Your schedule time in unix format
        [http://help.clicksend.com/what-is-a-unix-timestamp](http://help.clicksend.com/what-is-a-unix-timestamp)
        |

        | custom_string | string | false | none | Your reference. Will be passed
        back with all replies and delivery reports. |

        | country | string | false | none | ISO alpha-2 character country code
        e.g. 'US', we use this to format the recipient number if it's not in
        international format. |

        | from_email | string | false | none | An email address where the reply
        should be emailed to. |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                file_url:
                  type: string
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      source:
                        type: string
                      from:
                        type: string
                      to:
                        type: string
                      custom_string:
                        type: string
              example:
                file_url: '{{fileURL}}'
                messages:
                  - source: php
                    from: '+61411111111'
                    to: '+61411111111'
                    custom_string: A custom string to fax
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/send-fax'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \

                 --header "Content-Type: application/json" \
                 --data-binary "{
                \"file_url\":\"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\",
                \"messages\":[
                    {
                        \"source\":\"php\",
                        \"to\":\"+61261111111\",
                        \"schedule\":\"1436874701\",
                        \"custom_string\":\"custom_string\",
                        \"country\":\"AF\",
                        \"from_email\":\"will@smith.com\"
                    },
                    {
                        \"source\":\"php\",
                        \"to\":\"+61261111122\",
                        \"schedule\":\"1436874701\",
                        \"custom_string\":\"custom_string\",
                        \"country\":\"AF\",
                        \"from_email\":\"john@doe.com\"
                    }
                ]
            }" \
            'https://rest.clicksend.com/v3/fax/send'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\FAXApi(new
            GuzzleHttp\Client(),$config);

            $fax_message_list= new \ClickSend\Model\FaxMessage();

            $fax_message_list->setSource("php");

            $fax_message_list->setTo("+61261111111");

            $fax_message_list->setListId("185161");

            $fax_message_list->setCustomString("custom_string");

            $fax_message_list->setFromEmail("will@smith.com");

            // \ClickSend\Model\FaxMessageCollection | FaxMessageCollection
            model

            $fax_message = new \ClickSend\Model\FaxMessageCollection();

            $fax_message->setMessages([$fax_message_list]);

            $fax_message->setFileUrl("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf"); 


            try {
                $result = $apiInstance->faxSendPost($fax_message);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling FAXApi->faxSendPost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var faxApi = new FAXApi(configuration);

            var listOfFaxMessages = new List<FaxMessage>();

            listOfFaxMessages.Add(new FaxMessage(
                source: "sdk",
                to: "+11231231234",
                from: "+11231231234",
                schedule: Timestamp,
                customString: "CustomString",
                country: "CA",
                fromEmail: "john@doe.com"
            ));

            var faxMessageCollection = new
            FaxMessageCollection(listOfFaxMessages,
            "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf");

            var response = faxApi.FaxSendPost(faxMessageCollection);
        - lang: Java
          source: |-
            package ClickSend;

            import java.util.Arrays;
            import java.util.List;
            import ClickSend.Api.FaxApi;
            import ClickSend.Model.FaxMessage;
            import ClickSend.Model.FaxMessageCollection;

            public class send_fax {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                FaxApi apiInstance = new FaxApi(defaultClient);
                FaxMessage fax_message=new FaxMessage();
                fax_message.source("sdk");
                fax_message.to("+11231231234");
                fax_message.listId(new Integer(185161));
                fax_message.from("+11231231234");
                fax_message.schedule(new Integer(1545477071));
                fax_message.customString("CustomString");
                fax_message.country("AF");
                fax_message.fromEmail("john@doe.com");
                List<FaxMessage> faxMessageList=Arrays.asList(fax_message);
                // FaxMessageCollection | FaxMessageCollection model
                FaxMessageCollection faxMessage = new FaxMessageCollection(); 
                faxMessage.messages(faxMessageList);
                faxMessage.fileUrl("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf");
                try {
                    String result = apiInstance.faxSendPost(faxMessage);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling FaxApi#faxSendPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var faxApi = new api.FAXApi("USERNAME", "API_KEY");


            var faxMessageList = new api.FaxMessage();


            faxMessageList.source = "php";

            faxMessageList.to = "+61261111111";

            faxMessageList.listId = 185161;

            faxMessageList.from = "4197";

            faxMessageList.customString = "custom_string";

            faxMessageList.country = "AF";

            faxMessageList.fromEmail = "will@smith.com";


            var faxMessage = new api.FaxMessageCollection();


            faxMessage.messages = [faxMessageList]

            faxMessage.fileUrl =
            "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf";


            faxApi.faxSendPost(faxMessage).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::FAXApi.new

            # FaxMessageCollection | FaxMessageCollection model
            fax_messages = ClickSendClient::FaxMessageCollection.new(
              "file_url": "file_url",
              messages: [
                ClickSendClient::FaxMessage.new(
                  "schedule": 6,
                  "to": +61411111111,
                  "from": "from",
                  "source": "source",
                  "custom_string": "custom_string"
                ),
                ClickSendClient::FaxMessage.new(
                  "schedule": 6,
                  "to": "+61422222222",
                  "from": "from",
                  "source": "source",
                  "to": "to",
                  "custom_string": "custom_string"
                )
              ]
            )

            begin
              # Send a fax using supplied supported file-types.
              result = api_instance.fax_send_post(fax_messages)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling FAXApi->fax_send_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client import FaxMessage

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))

            file_url='https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf'

            fax_message_list = [FaxMessage(
                              "sdk","+11231231234",185161,"+11231231234",1,"CustomString","CA","john@doe.com")];
            # FaxMessageCollection | FaxMessageCollection model

            fax_message =
            clicksend_client.FaxMessageCollection(file_url=file_url,messages=fax_message_list) 


            try:
                # Send a fax using supplied supported file-types.
                api_response = api_instance.fax_send_post(fax_message)
                print(api_response)
            except ApiException as e:
                print("Exception when calling FAXApi->fax_send_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::FAXApi;

            use WWW::ClickSendClient::Object::FaxMessageCollection;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::FAXApi->new(username => $username,
            password => $password);


            my %params = (
                'messages' => [
                    {
                        'source'        => 'perl',
                        'to'            => '+61261111111',
                        'schedule'      => '1436874701',
                        'custom_string' => 'custom_string',
                        'country'       => 'AF',
                        'from_email'    => 'test1@test.com'
                    },
                    {
                        'source'        => 'perl',
                        'to'            => '+61261111122',
                        'schedule'      => '1436874701',
                        'custom_string' => 'custom_string',
                        'country'       => 'AF',
                        'from_email'    => 'test1@test1.com'
                    }
                ],
                'file_url' => 'https://www.domain.com/examples/document.pdf'
            );


            my $fax_message_obj =
            WWW::ClickSendClient::Object::FaxMessageCollection->new(%params);

            my $json_output = $api->fax_send_post('fax_message' =>
            $fax_message_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSFAXApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSFaxMessage *faxMessage = [[CSFaxMessage alloc] init];

            faxMessage.source = @"objc";

            faxMessage.to = @"+61261111111";

            faxMessage.listId = [NSNumber numberWithInt:1];

            faxMessage.from = @"from";

            faxMessage.customString = @"custom_string";

            faxMessage.country = @"AF";

            faxMessage.fromEmail = @"will@smith.com";


            CSFaxMessage *faxMessage2 = [[CSFaxMessage alloc] init];

            faxMessage2.source = @"objc";

            faxMessage2.to = @"+61261111111";

            faxMessage2.listId = [NSNumber numberWithInt:1];

            faxMessage2.from = @"from";

            faxMessage2.customString = @"custom_string";

            faxMessage2.country = @"AF";

            faxMessage2.fromEmail = @"will@smith.com";


            CSFaxMessageCollection *faxMessageCollection =
            [[CSFaxMessageCollection alloc] init];

            faxMessageCollection.messages = [NSArray
            arrayWithObjects:faxMessage, faxMessage2, nil];

            faxMessageCollection.fileUrl = @"fileUrl";


            CSFAXApi *faxApi = [[CSFAXApi alloc] init];

            [faxApi faxSendPostWithFaxMessage:faxMessageCollection
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {

            `ClickSendClientAPI.customHeaders = [authHeader.key :
            authHeader.value]

            }


            let faxMessage = FaxMessage(
                                source: "swift", 
                                to: "+61261111111", 
                                listId: 1, 
                                from: "from", 
                                schedule: 1436874701, 
                                customString: "custom_string", 
                                country: "AF", 
                                fromEmail: "will@smith.com"
                            )
            let faxMessage2 = FaxMessage(
                                source: "swift", 
                                to: "+61261111111", 
                                listId: 1, 
                                from: "from", 
                                schedule: nil, 
                                customString: "custom_string", 
                                country: "AF", 
                                fromEmail: "will@smith.com"
                            )

            let faxMessageCollection = FaxMessageCollection(messages:
            [faxMessage, faxMessage2], fileUrl: "fileUrl")


            FAXAPI.faxSendPost(faxMessage: faxMessageCollection) { (dataString,
            error) in
                if let error = error {
                    print(error)
                } else {
                    if let data = dataString!.data(using: String.Encoding.utf8) {
                        do {
                            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                                print(dictonary)
                            } else {
                                print("bad json")
                            }
                        } catch let error as NSError {
                            print(error)
                        }
                    }
                }
            }
  /v3/fax/price:
    post:
      summary: Calculate Fax Price
      operationId: calculate-fax-price
      description: >-
        _Calculate Total Price for Fax Messages sent_


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | file_url | string | true | none | URL of file to send |

        | source | string | true | none | Your method of sending e.g.
        'wordpress', 'php', 'c#'. |

        | to | string | true | none | Recipient fax number in
        [E.164](https://en.wikipedia.org/wiki/E.164) format. |

        | list_id | integer(int32) | false | none | Your list ID if sending to a
        whole list. Can be used instead of 'to'. |

        | from | string | true |
        [yes](http://help.clicksend.com/SMS/what-is-a-sender-id-or-sender-number)
        | Your sender id. Must be a valid fax number. |

        | schedule | integer(int32) | false | none | Leave blank for immediate
        delivery. Your schedule time in unix format
        [http://help.clicksend.com/what-is-a-unix-timestamp](http://help.clicksend.com/what-is-a-unix-timestamp)
        |

        | custom_string | string | false | none | Your reference. Will be passed
        back with all replies and delivery reports. |

        | country | string | false | none | ISO alpha-2 character country code
        e.g. 'US', we use this to format the recipient number if it's not in
        international format. |

        | from_email | string | false | none | An email address where the reply
        should be emailed to. |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                file_url:
                  type: string
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      source:
                        type: string
                      from:
                        type: string
                      to:
                        type: string
                      from_email:
                        type: string
                      schedule:
                        type: string
                      custom_string:
                        type: string
              example:
                file_url: '{{fileURL}}'
                messages:
                  - source: php
                    from: '+61411111111'
                    to: '+61411111111'
                    from_email: test@test.com
                    schedule: '1436874701'
                    custom_string: custom_string
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/calculate-fax-price'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \

                 --header "Content-Type: application/json" \
                 --data-binary "{
                \"file_url\":\"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\",
                \"messages\":[
                    {
                        \"source\":\"php\",
                        \"to\":\"+61261111111\",
                        \"schedule\":\"1436874701\",
                        \"custom_string\":\"custom_string\",
                        \"country\":\"AF\",
                        \"from_email\":\"will@smith.com\"
                    },
                    {
                        \"source\":\"php\",
                        \"to\":\"+61261111122\",
                        \"schedule\":\"1436874701\",
                        \"custom_string\":\"custom_string\",
                        \"country\":\"AF\",
                        \"from_email\":\"john@doe.com\"
                    }
                ]
            }" \
            'https://rest.clicksend.com/v3/fax/price'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\FAXApi(new
            GuzzleHttp\Client(),$config);

            $fax_message_list= new \ClickSend\Model\FaxMessage();

            $fax_message_list->setSource("php");

            $fax_message_list->setTo("+61261111111");

            $fax_message_list->setListId("185161");

            $fax_message_list->setCustomString("custom_string");

            $fax_message_list->setFromEmail("will@smith.com");

            // \ClickSend\Model\FaxMessageCollection | FaxMessageCollection
            model

            $fax_message = new \ClickSend\Model\FaxMessageCollection();

            $fax_message->setMessages([$fax_message_list]);

            $fax_message->setFileUrl("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf"); 


            try {
                $result = $apiInstance->faxPricePost($fax_message);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling FAXApi->faxPricePost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var faxApi = new FAXApi(configuration);

            var listOfFaxMessages = new List<FaxMessage>();

            listOfFaxMessages.Add(new FaxMessage( 
                dource: "sdk",
                to: "+11231231234",
                from: "+11231231234",
                schedule: Timestamp,
                customString: "CustomString",
                country: "CA",
                fromEmail: "john@doe.com"
            ));

            var faxMessageCollection = new
            FaxMessageCollection(listOfFaxMessages,
            "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf");

            var response = faxApi.FaxPricePost(faxMessageCollection);
        - lang: Java
          source: |
            package ClickSend;

            import java.util.Arrays;
            import java.util.List;
            import ClickSend.Api.FaxApi;
            import ClickSend.Model.FaxMessage;
            import ClickSend.Model.FaxMessageCollection;

            public class calculate_fax_price {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                FaxApi apiInstance = new FaxApi(defaultClient);
                FaxMessage fax_message=new FaxMessage();
                fax_message.source("sdk");
                fax_message.to("+11231231234");
                fax_message.listId(new Integer(185161));
                fax_message.from("+11231231234");
                fax_message.schedule(new Integer(1545477071));
                fax_message.customString("CustomString");
                fax_message.country("AF");
                fax_message.fromEmail("john@doe.com");
                List<FaxMessage> faxMessageList=Arrays.asList(fax_message);
                // FaxMessageCollection | FaxMessageCollection model
                FaxMessageCollection faxMessage = new FaxMessageCollection(); 
                faxMessage.messages(faxMessageList);
                faxMessage.fileUrl("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf");
                try {
                    String result = apiInstance.faxPricePost(faxMessage);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling FaxApi#faxPricePost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var faxApi = new api.FAXApi("USERNAME", "API_KEY");


            var faxMessageList = new api.FaxMessage();


            faxMessageList.source = "php";

            faxMessageList.to = "+61261111111";

            faxMessageList.listId = 185161;

            faxMessageList.from = "4197";

            faxMessageList.customString = "custom_string";

            faxMessageList.country = "AF";

            faxMessageList.fromEmail = "will@smith.com";


            var faxMessage = new api.FaxMessageCollection();


            faxMessage.messages = [faxMessageList]

            faxMessage.fileUrl =
            "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf";


            faxApi.faxPricePost(faxMessage).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::FAXApi.new

            # FaxMessageCollection | FaxMessageCollection model
            fax_messages = ClickSendClient::FaxMessageCollection.new(
              "file_url": "file_url",
              messages: [
                ClickSendClient::FaxMessage.new(
                  "schedule": 6,
                  "from": "from",
                  "source": "source",
                  "to": "+61411111111",
                  "custom_string": "custom_string"
                ),
                ClickSendClient::FaxMessage.new(
                  "schedule": 6,
                  "from": "from",
                  "source": "source",
                  "to": "+61422222222",
                  "custom_string": "custom_string"
                )
              ]
            )

            begin
              # Calculate Total Price for Fax Messages sent
              result = api_instance.fax_price_post(fax_messages)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling FAXApi->fax_price_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client import FaxMessage

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))

            file_url='https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf'

            fax_message_list = [FaxMessage(
                              "sdk","+11231231234",185161,"+11231231234",1,"CustomString","CA","john@doe.com")];
            # FaxMessageCollection | FaxMessageCollection model

            fax_message =
            clicksend_client.FaxMessageCollection(file_url=file_url,messages=fax_message_list)


            try:
                # Calculate Total Price for Fax Messages sent
                api_response = api_instance.fax_price_post(fax_message)
                print(api_response)
            except ApiException as e:
                print("Exception when calling FAXApi->fax_price_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::FAXApi;

            use WWW::ClickSendClient::Object::FaxMessageCollection;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::FAXApi->new(username => $username,
            password => $password);


            my %params = (
                'messages' => [
                    {
                        'source'        => 'perl',
                        'to'            => '+61261111111',
                        'schedule'      => '1436874701',
                        'custom_string' => 'custom_string',
                        'country'       => 'AF',
                        'from_email'    => 'test1@test.com'
                    },
                    {
                        'source'        => 'perl',
                        'to'            => '+61261111122',
                        'schedule'      => '1436874701',
                        'custom_string' => 'custom_string',
                        'country'       => 'AF',
                        'from_email'    => 'test1@test1.com'
                    }
                ],
                'file_url' => 'https://www.domain.com/examples/document.pdf'
            );


            my $fax_message_obj =
            WWW::ClickSendClient::Object::FaxMessageCollection->new(%params);


            my $json_output = $api->fax_price_post('fax_message' =>
            $fax_message_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSFAXApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSFaxMessage *faxMessage = [[CSFaxMessage alloc] init];

            faxMessage.source = @"objc";

            faxMessage.to = @"+61261111111";

            faxMessage.listId = [NSNumber numberWithInt:1];

            faxMessage.from = @"from";

            faxMessage.customString = @"custom_string";

            faxMessage.country = @"AF";

            faxMessage.fromEmail = @"will@smith.com";


            CSFaxMessage *faxMessage2 = [[CSFaxMessage alloc] init];

            faxMessage2.source = @"objc";

            faxMessage2.to = @"+61261111111";

            faxMessage2.listId = [NSNumber numberWithInt:1];

            faxMessage2.from = @"from";

            faxMessage2.customString = @"custom_string";

            faxMessage2.country = @"AF";

            faxMessage2.fromEmail = @"will@smith.com";


            CSFaxMessageCollection *faxMessageCollection =
            [[CSFaxMessageCollection alloc] init];

            faxMessageCollection.messages = [NSArray
            arrayWithObjects:faxMessage, faxMessage2, nil];


            faxMessageCollection.fileUrl = @"fileUrl";

            CSFAXApi *faxApi = [[CSFAXApi alloc] init];

            [faxApi faxPricePostWithFaxMessage:faxMessageCollection
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let faxMessage = FaxMessage(
                                source: "swift", 
                                to: "+61261111111", 
                                listId: 1, 
                                from: "from", 
                                schedule: 1436874701, 
                                customString: "custom_string", 
                                country: "AF", 
                                fromEmail: "will@smith.com"
                            )
            let faxMessage2 = FaxMessage(
                                source: "swift", 
                                to: "+61261111111", 
                                listId: 1, 
                                from: "from", 
                                schedule: nil, 
                                customString: "custom_string", 
                                country: "AF", 
                                fromEmail: "will@smith.com"
                            )

            let faxMessageCollection = FaxMessageCollection(messages:
            [faxMessage, faxMessage2], fileUrl: "fileUrl")

            FAXAPI.faxPricePost(faxMessage: faxMessageCollection) { (dataString,
            error) in
                if let error = error {
                    print(error)
                } else {
                    if let data = dataString!.data(using: String.Encoding.utf8) {
                        do {
                            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                                print(dictonary)
                            } else {
                                print("bad json")
                            }
                        } catch let error as NSError {
                            print(error)
                        }
                    }
                }
            }
  /v3/fax/receipts:
    get:
      summary: View Fax Receipts
      operationId: view-fax-receipts
      description: >-
        _Get List of Fax Receipts_


        **Push Delivery Receipts**


        If you prefer, we can push message replies to your server as they arrive
        with us.


        1. Log into your account.

        2. Click on your profile on the top right.

        3. Then click on the Messaging Settings option.

        4. Click on Fax then Delivery Reports.

        5. Click the 'Add New Rule' button.

        6. Select the 'URL' action.

        7. Enter the URL and click 'Save'.
            

        The following variables will be posted to the URL specified:


        | Variable | Description |

        | --- | --- |

        | `timestamp_send` | Timestamp of the original send request in UNIX
        format. e.g 1439173980 |

        | `timestamp` | Timestamp of delivery report in UNIX format. e.g
        1439173981 |

        | `message_id` | Message ID, returned when originally sending the
        message. |

        | `status` | Delivered or Undelivered |

        | `status_code` | Status code. Refer to 'Fax Delivery Status Codes' in
        docs. |

        | `status_text` | Status text. |

        | `error_code` | Error code. |

        | `error_text` | Error text. |

        | `custom_string` | A custom string used when sending the original
        message. |

        | `user_id` | The user ID of the user who sent the message. |

        | `subaccount_id` | The subaccount ID of the user who sent the message.
        |

        | `message_type` | 'fax' (constant). |


        **Pull Delivery Receipts**


        Receive delivery reports by polling. You can poll our server and
        retrieve delivery reports at a time that suits you.


        1. Log into your account.

        2. Click on your profile on the top right.

        3. Then click on the Messaging Settings option.

        4. Click on Fax then Delivery Rules.

        5. Click the 'Add New Rule' button.

        6. Select the 'Poll' action.

        7. Then click 'Save'.
            

        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-fax-receipts'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/fax/receipts'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\FAXApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->faxReceiptsGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling FAXApi->faxReceiptsGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var faxApi = new FAXApi(configuration);
            var response = faxApi.FaxReceiptsGet();
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.FaxApi;

            public class view_all_fax_receipt {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                FaxApi apiInstance = new FaxApi(defaultClient);
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                  String result = apiInstance.faxReceiptsGet(page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling FaxApi#faxReceiptsGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var faxApi = new api.FAXApi("USERNAME", "API_KEY");

            var page = 1;
            var limit = 10;

            faxApi.faxReceiptsGet(page, limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::FAXApi.new

            begin
              # Get List of Fax Receipts
              result = api_instance.fax_receipts_get
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling FAXApi->fax_receipts_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))


            try:
                # Get List of Fax Receipts
                api_response = api_instance.fax_receipts_get()
                print(api_response)
            except ApiException as e:
                print("Exception when calling FAXApi->fax_receipts_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::FAXApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::FAXApi->new(username => $username,
            password => $password);


            my $json_output = $api->fax_receipts_get();


            print $json_output;
        - lang: objc
          source: >-
            #import "CSFAXApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSFAXApi *faxApi = [[CSFAXApi alloc] init];

            [faxApi faxReceiptsGetWithPage:@(1) limit:@(15)
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            FAXAPI.faxReceiptsGet { (dataString, error) in
                if let error = error {
                    print(error)
                } else {
                    if let data = dataString!.data(using: String.Encoding.utf8) {
                        do {
                            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                                print(dictonary)
                            } else {
                                print("bad json")
                            }
                        } catch let error as NSError {
                            print(error)
                        }
                    }
                }
            }
  /v3/fax/receipts/{message_id}:
    get:
      summary: View Specific Fax Receipt
      operationId: view-specific-fax-receipt
      description: >-
        _Get a single fax receipt based on message id._


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | message_id | path | string | true | ID of the message receipt to
        retrieve |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: message_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-specific-fax-receipt'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/fax/receipts/{message_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\FAXApi(new
            GuzzleHttp\Client(),$config);

            $message_id = "message_id_example"; // string | ID of the message
            receipt to retrieve


            try {
                $result = $apiInstance->faxReceiptsByMessageIdGet($message_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling FAXApi->faxReceiptsByMessageIdGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var faxApi = new FAXApi(configuration);
            var response = faxApi.FaxReceiptsByMessageIdGet("MESSAGE_ID");
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.FaxApi;

            public class view_specific_fax_receipt {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                FaxApi apiInstance = new FaxApi(defaultClient);
                // String | ID of the message receipt to retrieve
                String messageId = "message_id_example"; 
                try {
                    String result = apiInstance.faxReceiptsByMessageIdGet(messageId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling FaxApi#faxReceiptsByMessageIdGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var faxApi = new api.FAXApi("USERNAME", "API_KEY");


            var messageId = "message_id_example";


            faxApi.faxReceiptsByMessageIdGet(messageId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: >-
            # load the gem

            require 'clicksend_client'

            require 'json'


            # setup authorization

            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end


            api_instance = ClickSendClient::FAXApi.new


            message_id = "message_id_example" # String | ID of the message
            receipt to retrieve


            begin
              # Get a single fax receipt based on message id.
              result = api_instance.fax_receipts_by_message_id_get(message_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling FAXApi->fax_receipts_by_message_id_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))

            message_id = 'message_id_example' # str | ID of the message receipt
            to retrieve


            try:
                # Get a single fax receipt based on message id.
                api_response = api_instance.fax_receipts_by_message_id_get(message_id)
                pprint(api_response)
            except ApiException as e:
                print("Exception when calling FAXApi->fax_receipts_by_message_id_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::FAXApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::FAXApi->new(username => $username,
            password => $password);


            my $json_output = $api->fax_receipts_by_message_id_get('message_id'
            => '1234');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSFAXApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSFAXApi *faxApi = [[CSFAXApi alloc] init];

            [faxApi faxReceiptsByMessageIdGetWithMessageId:@"message_id"
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            FAXAPI.faxReceiptsByMessageIdGet(messageId: "message_id") {
            (dataString, error) in
                if let error = error {
                    print(error)
                } else {
                    if let data = dataString!.data(using: String.Encoding.utf8) {
                        do {
                            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                                print(dictonary)
                            } else {
                                print("bad json")
                            }
                        } catch let error as NSError {
                            print(error)
                        }
                    }
                }
            }
  /v3/fax/history:
    get:
      summary: View Fax History
      operationId: view-fax-history
      description: >-
        _Get a list of Fax History._


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | date_from | query | integer(int32) | false | Start date (Unix
        Timestamp e.g. 1436849372) |

        | date_to | query | integer(int32) | false | End date (Unix Timestamp
        e.g. 1436879372) |

        | q | query | string | false | Custom query Example:
        status:Sent,status_code:201. |

        | order | query | string | false | Order result by Example:
        date_added:desc,list_id:desc. |

        | page | query | integer(int32) | false | [Page
        number](https://developers.clicksend.com/docs/rest/v3/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](https://developers.clicksend.com/docs/rest/v3/#pagination) |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        This endpoint requires authentication, [more
        info...](https://developers.clicksend.com/docs/rest/v3/#authentication)



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-fax-history'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/fax/
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\FAXApi(new
            GuzzleHttp\Client(),$config);

            $date_from = '2018-01-01'; // int | Customize result by setting from
            date (timestamp) Example: 1457572619.

            $date_to = '2019-01-01'; // int | Customize result by setting to
            date (timestamp) Example: 1457573000.

            $q = "q_example"; // string | Custom query Example:
            status:Sent,status_code:201.

            $order = "order_example"; // string | Order result by Example:
            date_added:desc,list_id:desc.

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->faxHistoryGet($date_from, $date_to, $q, $order, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling FAXApi->faxHistoryGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var faxApi = new FAXApi(configuration);


            var dateFrom = '1546913229';

            var dateTo = '1546923229';

            var q = 'q_example';

            var order = 'order_example';

            var page = 1;

            var limit = 10;


            var response = faxApi.FaxHistoryGet(dateFrom, dateTo, q, order,
            page, limit);
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.FaxApi;

            public class view_fax_history {
              public static void main(String[] args) {
                    ApiClient defaultClient = new ApiClient();
                    defaultClient.setUsername("USERNAME");
                    defaultClient.setPassword("API_KEY");
                    FaxApi apiInstance = new FaxApi(defaultClient);
                    Integer dateFrom = 1546913229; // Integer | Customize result by setting from date (timestamp) Example: 1457572619.
                    Integer dateTo = 1546923229; // Integer | Customize result by setting to date (timestamp) Example: 1457573000.
                    String q = "q_example"; // String | Custom query Example: status:Sent,status_code:201.
                    String order = "order_example"; // String | Order result by Example: date_added:desc,list_id:desc.
                    Integer page = 1; // Integer | Page number
                    Integer limit = 10; // Integer | Number of records per page
                    try {
                        String result = apiInstance.faxHistoryGet(dateFrom, dateTo, q, order, page, limit);
                        System.out.println(result);
                    } catch (ApiException e) {
                        System.err.println("Exception when calling FaxApi#faxHistoryGet");
                        e.printStackTrace();
                    }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var faxApi = new api.FAXApi("USERNAME", "API_KEY");


            var dateFrom = '1546913229';

            var dateTo = '1546923229';

            var q = 'q_example';

            var order = 'order_example';

            var page = 1;

            var limit = 10;


            faxApi.faxHistoryGet(dateFrom, dateTo, q, order, page,
            limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::FAXApi.new

            opts = {
              "date_from": 1546913229, # Integer | Customize result by setting from date (timestamp) Example: 1457572619.
              "date_to": 1546923229, # Integer | Customize result by setting to date (timestamp) Example: 1457573000.
              "q": "q_example", # String | Custom query Example: status:Sent,status_code:201.
              "order": "order_example", # String | Order result by Example: date_added:desc,list_id:desc.
              "page": 1, # Integer | Page number
              "limit": 10 # Integer | Number of records per page
            }

            begin
              # Get a list of Fax History.
              result = api_instance.fax_history_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling FAXApi->fax_history_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))

            date_from = 1546913229 # int | Customize result by setting from date
            (timestamp) Example: 1457572619. (optional)

            date_to = 1546923229 # int | Customize result by setting to date
            (timestamp) Example: 1457573000. (optional)

            q = 'q_example' # str | Custom query Example:
            status:Sent,status_code:201. (optional)

            order = 'order_example' # str | Order result by Example:
            date_added:desc,list_id:desc. (optional)

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get a list of Fax History.
                api_response = api_instance.fax_history_get(date_from=date_from, date_to=date_to, q=q, order=order, page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling FAXApi->fax_history_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::FAXApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::FAXApi->new(username => $username,
            password => $password);


            my %params = (
                'date_from' => '1457572619',
                'date_to'   => '1457573000',
                'q'         => 'status_code:201',
                'order'     => 'list_id:desc',
                'page'      => '1',
                'limit'     => '6'
            );


            my $json_output = $api->fax_history_get(%params);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSFAXApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *dateFrom = [NSNumber numberWithInt:3113123];

            NSNumber *dateTo = [NSNumber numberWithInt:3113125];

            CSFAXApi *faxApi = [[CSFAXApi alloc] init];

            [faxApi faxHistoryGetWithDateFrom:dateFrom dateTo:dateTo q:@"q"
            order:@"order" page:@(1) limit:@(15) completionHandler:^(NSString
            *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            FAXAPI.faxHistoryGet { (dataString, error) in
                if let error = error {
                    print(error)
                } else {
                    if let data = dataString!.data(using: String.Encoding.utf8) {
                        do {
                            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                                print(dictonary)
                            } else {
                                print("bad json")
                            }
                        } catch let error as NSError {
                            print(error)
                        }
                    }
                }
            }
