{
  "openapi": "3.0.0",
  "info": {
    "title": "Fax",
    "description": "Everything about Fax Sending\n\nWe're no longer offering Fax to new customers. \nFor a great alternative, our parent company, Sinch, specialises in online voice solutions. \nYou can find their best-in-class service here: [https://sinch.com/fax/](https://sinch.com/fax/)\n"
  },
  "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"
          },
          "min_recharge_amount": {
            "type": "string",
            "description": "The minimum amount that can be used to recharge the account, in this currency.",
            "example": "20.00"
          },
          "max_recharge_amount": {
            "type": "string",
            "description": "The maximum amount that can be used to recharge the account, in this currency.",
            "example": "10000.00"
          }
        }
      },
      "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": "integer",
                "example": 1,
                "description": "The total count of the fax."
              },
              "queued_count": {
                "type": "integer",
                "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": "integer",
                "description": "The total count of the fax messages.",
                "example": 1
              },
              "queued_count": {
                "type": "integer",
                "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**\n\n- 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`\n- This will return a URL to the converted pdf file that can be used in the /fax/send endpoint.\n- Contact us to add support for any other file type.\n    \n\n### Documents\n\n| File type | Required to be passed to uploads endpoint first? |\n| --- | --- |\n| pdf | No |\n| docx | Yes |\n| doc | Yes |\n| rtf | Yes |\n\n_Send a fax using supplied supported file-types._\n\n### **Letter File Options**\n\n### Use existing URL\n\nWith this option, you can use an existing URL to a `pdf` document. For example, you might generate the `pdf` on your server.\n\nWhen using an existing url make sure that it is publicly accessible as it will not work if it is private.\n\n### Upload File to Our Server\n\nWith this option, you can use the [/uploads](/#upload-media-file) endpoint to upload the document. The `/uploads` endpoint returns a URL that can be used in the `/fax/send` endpoint.\n\n### Properties\n\n| Name | Type | Required | Restrictions | Description |\n| --- | --- | --- | --- | --- |\n| file_url | string | true | none | URL of file to send |\n| source | string | true | none | Your method of sending e.g. 'wordpress', 'php', 'c#'. |\n| to | string | true | none | Recipient fax number in [E.164](https://en.wikipedia.org/wiki/E.164) format. |\n| list_id | integer(int32) | false | none | Your list ID if sending to a whole list. Can be used instead of 'to'. |\n| 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. |\n| 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) |\n| custom_string | string | false | none | Your reference. Will be passed back with all replies and delivery reports. |\n| 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. |\n| from_email | string | false | none | An email address where the reply should be emailed to. |\n\n\nRefer to [Status Codes](/#status-codes) for definitions of HTTP status code responses.\n\n\n<div style=\"background-color: #FF6A4B; padding: 10px; border-radius: 8px;\">\n  <span style=\"color: white;\">This endpoint requires authentication,</span> \n  <a href=\"/docs/#authentication\" style=\"color: white; text-decoration: underline;\">more info...</a>\n</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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request POST \\\n\n     --header \"Content-Type: application/json\" \\\n     --data-binary \"{\n    \\\"file_url\\\":\\\"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\\\",\n    \\\"messages\\\":[\n        {\n            \\\"source\\\":\\\"php\\\",\n            \\\"to\\\":\\\"+61261111111\\\",\n            \\\"schedule\\\":\\\"1436874701\\\",\n            \\\"custom_string\\\":\\\"custom_string\\\",\n            \\\"country\\\":\\\"AF\\\",\n            \\\"from_email\\\":\\\"will@smith.com\\\"\n        },\n        {\n            \\\"source\\\":\\\"php\\\",\n            \\\"to\\\":\\\"+61261111122\\\",\n            \\\"schedule\\\":\\\"1436874701\\\",\n            \\\"custom_string\\\":\\\"custom_string\\\",\n            \\\"country\\\":\\\"AF\\\",\n            \\\"from_email\\\":\\\"john@doe.com\\\"\n        }\n    ]\n}\" \\\n'https://rest.clicksend.com/v3/fax/send'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\FAXApi(new GuzzleHttp\\Client(),$config);\n$fax_message_list= new \\ClickSend\\Model\\FaxMessage();\n$fax_message_list->setSource(\"php\");\n$fax_message_list->setTo(\"+61261111111\");\n$fax_message_list->setListId(\"185161\");\n$fax_message_list->setCustomString(\"custom_string\");\n$fax_message_list->setFromEmail(\"will@smith.com\");\n// \\ClickSend\\Model\\FaxMessageCollection | FaxMessageCollection model\n$fax_message = new \\ClickSend\\Model\\FaxMessageCollection();\n$fax_message->setMessages([$fax_message_list]);\n$fax_message->setFileUrl(\"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\"); \n\ntry {\n    $result = $apiInstance->faxSendPost($fax_message);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling FAXApi->faxSendPost: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar faxApi = new FAXApi(configuration);\nvar listOfFaxMessages = new List<FaxMessage>();\nlistOfFaxMessages.Add(new FaxMessage(\n    source: \"sdk\",\n    to: \"+11231231234\",\n    from: \"+11231231234\",\n    schedule: Timestamp,\n    customString: \"CustomString\",\n    country: \"CA\",\n    fromEmail: \"john@doe.com\"\n));\nvar faxMessageCollection = new FaxMessageCollection(listOfFaxMessages, \"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\");\nvar response = faxApi.FaxSendPost(faxMessageCollection);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport ClickSend.Api.FaxApi;\nimport ClickSend.Model.FaxMessage;\nimport ClickSend.Model.FaxMessageCollection;\n\npublic class send_fax {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    FaxApi apiInstance = new FaxApi(defaultClient);\n    FaxMessage fax_message=new FaxMessage();\n    fax_message.source(\"sdk\");\n    fax_message.to(\"+11231231234\");\n    fax_message.listId(new Integer(185161));\n    fax_message.from(\"+11231231234\");\n    fax_message.schedule(new Integer(1545477071));\n    fax_message.customString(\"CustomString\");\n    fax_message.country(\"AF\");\n    fax_message.fromEmail(\"john@doe.com\");\n    List<FaxMessage> faxMessageList=Arrays.asList(fax_message);\n    // FaxMessageCollection | FaxMessageCollection model\n    FaxMessageCollection faxMessage = new FaxMessageCollection(); \n    faxMessage.messages(faxMessageList);\n    faxMessage.fileUrl(\"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\");\n    try {\n        String result = apiInstance.faxSendPost(faxMessage);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling FaxApi#faxSendPost\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar faxApi = new api.FAXApi(\"USERNAME\", \"API_KEY\");\n\nvar faxMessageList = new api.FaxMessage();\n\nfaxMessageList.source = \"php\";\nfaxMessageList.to = \"+61261111111\";\nfaxMessageList.listId = 185161;\nfaxMessageList.from = \"4197\";\nfaxMessageList.customString = \"custom_string\";\nfaxMessageList.country = \"AF\";\nfaxMessageList.fromEmail = \"will@smith.com\";\n\nvar faxMessage = new api.FaxMessageCollection();\n\nfaxMessage.messages = [faxMessageList]\nfaxMessage.fileUrl = \"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\";\n\nfaxApi.faxSendPost(faxMessage).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::FAXApi.new\n\n# FaxMessageCollection | FaxMessageCollection model\nfax_messages = ClickSendClient::FaxMessageCollection.new(\n  \"file_url\": \"file_url\",\n  messages: [\n    ClickSendClient::FaxMessage.new(\n      \"schedule\": 6,\n      \"to\": +61411111111,\n      \"from\": \"from\",\n      \"source\": \"source\",\n      \"custom_string\": \"custom_string\"\n    ),\n    ClickSendClient::FaxMessage.new(\n      \"schedule\": 6,\n      \"to\": \"+61422222222\",\n      \"from\": \"from\",\n      \"source\": \"source\",\n      \"to\": \"to\",\n      \"custom_string\": \"custom_string\"\n    )\n  ]\n)\n\nbegin\n  # Send a fax using supplied supported file-types.\n  result = api_instance.fax_send_post(fax_messages)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling FAXApi->fax_send_post: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client import FaxMessage\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))\nfile_url='https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf'\nfax_message_list = [FaxMessage(\n                  \"sdk\",\"+11231231234\",185161,\"+11231231234\",1,\"CustomString\",\"CA\",\"john@doe.com\")];\n# FaxMessageCollection | FaxMessageCollection model\nfax_message = clicksend_client.FaxMessageCollection(file_url=file_url,messages=fax_message_list) \n\ntry:\n    # Send a fax using supplied supported file-types.\n    api_response = api_instance.fax_send_post(fax_message)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling FAXApi->fax_send_post: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::FAXApi;\nuse WWW::ClickSendClient::Object::FaxMessageCollection;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::FAXApi->new(username => $username, password => $password);\n\nmy %params = (\n    'messages' => [\n        {\n            'source'        => 'perl',\n            'to'            => '+61261111111',\n            'schedule'      => '1436874701',\n            'custom_string' => 'custom_string',\n            'country'       => 'AF',\n            'from_email'    => 'test1@test.com'\n        },\n        {\n            'source'        => 'perl',\n            'to'            => '+61261111122',\n            'schedule'      => '1436874701',\n            'custom_string' => 'custom_string',\n            'country'       => 'AF',\n            'from_email'    => 'test1@test1.com'\n        }\n    ],\n    'file_url' => 'https://www.domain.com/examples/document.pdf'\n);\n\nmy $fax_message_obj = WWW::ClickSendClient::Object::FaxMessageCollection->new(%params);\nmy $json_output = $api->fax_send_post('fax_message' => $fax_message_obj);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSFAXApi.h\"\n#import \"CSDefaultConfiguration.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"USERNAME\"];\n[apiConfig setPassword:@\"PASSWORD\"];\n\nCSFaxMessage *faxMessage = [[CSFaxMessage alloc] init];\nfaxMessage.source = @\"objc\";\nfaxMessage.to = @\"+61261111111\";\nfaxMessage.listId = [NSNumber numberWithInt:1];\nfaxMessage.from = @\"from\";\nfaxMessage.customString = @\"custom_string\";\nfaxMessage.country = @\"AF\";\nfaxMessage.fromEmail = @\"will@smith.com\";\n\nCSFaxMessage *faxMessage2 = [[CSFaxMessage alloc] init];\nfaxMessage2.source = @\"objc\";\nfaxMessage2.to = @\"+61261111111\";\nfaxMessage2.listId = [NSNumber numberWithInt:1];\nfaxMessage2.from = @\"from\";\nfaxMessage2.customString = @\"custom_string\";\nfaxMessage2.country = @\"AF\";\nfaxMessage2.fromEmail = @\"will@smith.com\";\n\nCSFaxMessageCollection *faxMessageCollection = [[CSFaxMessageCollection alloc] init];\nfaxMessageCollection.messages = [NSArray arrayWithObjects:faxMessage, faxMessage2, nil];\nfaxMessageCollection.fileUrl = @\"fileUrl\";\n\nCSFAXApi *faxApi = [[CSFAXApi alloc] init];\n[faxApi faxSendPostWithFaxMessage:faxMessageCollection completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n`ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nlet faxMessage = FaxMessage(\n                    source: \"swift\", \n                    to: \"+61261111111\", \n                    listId: 1, \n                    from: \"from\", \n                    schedule: 1436874701, \n                    customString: \"custom_string\", \n                    country: \"AF\", \n                    fromEmail: \"will@smith.com\"\n                )\nlet faxMessage2 = FaxMessage(\n                    source: \"swift\", \n                    to: \"+61261111111\", \n                    listId: 1, \n                    from: \"from\", \n                    schedule: nil, \n                    customString: \"custom_string\", \n                    country: \"AF\", \n                    fromEmail: \"will@smith.com\"\n                )\n\nlet faxMessageCollection = FaxMessageCollection(messages: [faxMessage, faxMessage2], fileUrl: \"fileUrl\")\n\nFAXAPI.faxSendPost(faxMessage: faxMessageCollection) { (dataString, error) in\n    if let error = error {\n        print(error)\n    } else {\n        if let data = dataString!.data(using: String.Encoding.utf8) {\n            do {\n                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                    print(dictonary)\n                } else {\n                    print(\"bad json\")\n                }\n            } catch let error as NSError {\n                print(error)\n            }\n        }\n    }\n}"
          }
        ]
      }
    },
    "/v3/fax/price": {
      "post": {
        "summary": "Calculate Fax Price",
        "operationId": "calculate-fax-price",
        "description": "_Calculate Total Price for Fax Messages sent_\n\n### Properties\n\n| Name | Type | Required | Restrictions | Description |\n| --- | --- | --- | --- | --- |\n| file_url | string | true | none | URL of file to send |\n| source | string | true | none | Your method of sending e.g. 'wordpress', 'php', 'c#'. |\n| to | string | true | none | Recipient fax number in [E.164](https://en.wikipedia.org/wiki/E.164) format. |\n| list_id | integer(int32) | false | none | Your list ID if sending to a whole list. Can be used instead of 'to'. |\n| 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. |\n| 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) |\n| custom_string | string | false | none | Your reference. Will be passed back with all replies and delivery reports. |\n| 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. |\n| from_email | string | false | none | An email address where the reply should be emailed to. |\n\n\nRefer to [Status Codes](/#status-codes) for definitions of HTTP status code responses.\n\n\n<div style=\"background-color: #FF6A4B; padding: 10px; border-radius: 8px;\">\n  <span style=\"color: white;\">This endpoint requires authentication,</span> \n  <a href=\"/docs/#authentication\" style=\"color: white; text-decoration: underline;\">more info...</a>\n</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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request POST \\\n\n     --header \"Content-Type: application/json\" \\\n     --data-binary \"{\n    \\\"file_url\\\":\\\"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\\\",\n    \\\"messages\\\":[\n        {\n            \\\"source\\\":\\\"php\\\",\n            \\\"to\\\":\\\"+61261111111\\\",\n            \\\"schedule\\\":\\\"1436874701\\\",\n            \\\"custom_string\\\":\\\"custom_string\\\",\n            \\\"country\\\":\\\"AF\\\",\n            \\\"from_email\\\":\\\"will@smith.com\\\"\n        },\n        {\n            \\\"source\\\":\\\"php\\\",\n            \\\"to\\\":\\\"+61261111122\\\",\n            \\\"schedule\\\":\\\"1436874701\\\",\n            \\\"custom_string\\\":\\\"custom_string\\\",\n            \\\"country\\\":\\\"AF\\\",\n            \\\"from_email\\\":\\\"john@doe.com\\\"\n        }\n    ]\n}\" \\\n'https://rest.clicksend.com/v3/fax/price'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\FAXApi(new GuzzleHttp\\Client(),$config);\n$fax_message_list= new \\ClickSend\\Model\\FaxMessage();\n$fax_message_list->setSource(\"php\");\n$fax_message_list->setTo(\"+61261111111\");\n$fax_message_list->setListId(\"185161\");\n$fax_message_list->setCustomString(\"custom_string\");\n$fax_message_list->setFromEmail(\"will@smith.com\");\n// \\ClickSend\\Model\\FaxMessageCollection | FaxMessageCollection model\n$fax_message = new \\ClickSend\\Model\\FaxMessageCollection();\n$fax_message->setMessages([$fax_message_list]);\n$fax_message->setFileUrl(\"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\"); \n\ntry {\n    $result = $apiInstance->faxPricePost($fax_message);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling FAXApi->faxPricePost: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar faxApi = new FAXApi(configuration);\nvar listOfFaxMessages = new List<FaxMessage>();\nlistOfFaxMessages.Add(new FaxMessage( \n    dource: \"sdk\",\n    to: \"+11231231234\",\n    from: \"+11231231234\",\n    schedule: Timestamp,\n    customString: \"CustomString\",\n    country: \"CA\",\n    fromEmail: \"john@doe.com\"\n));\nvar faxMessageCollection = new FaxMessageCollection(listOfFaxMessages, \"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\");\nvar response = faxApi.FaxPricePost(faxMessageCollection);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport ClickSend.Api.FaxApi;\nimport ClickSend.Model.FaxMessage;\nimport ClickSend.Model.FaxMessageCollection;\n\npublic class calculate_fax_price {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    FaxApi apiInstance = new FaxApi(defaultClient);\n    FaxMessage fax_message=new FaxMessage();\n    fax_message.source(\"sdk\");\n    fax_message.to(\"+11231231234\");\n    fax_message.listId(new Integer(185161));\n    fax_message.from(\"+11231231234\");\n    fax_message.schedule(new Integer(1545477071));\n    fax_message.customString(\"CustomString\");\n    fax_message.country(\"AF\");\n    fax_message.fromEmail(\"john@doe.com\");\n    List<FaxMessage> faxMessageList=Arrays.asList(fax_message);\n    // FaxMessageCollection | FaxMessageCollection model\n    FaxMessageCollection faxMessage = new FaxMessageCollection(); \n    faxMessage.messages(faxMessageList);\n    faxMessage.fileUrl(\"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\");\n    try {\n        String result = apiInstance.faxPricePost(faxMessage);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling FaxApi#faxPricePost\");\n        e.printStackTrace();\n    }\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar faxApi = new api.FAXApi(\"USERNAME\", \"API_KEY\");\n\nvar faxMessageList = new api.FaxMessage();\n\nfaxMessageList.source = \"php\";\nfaxMessageList.to = \"+61261111111\";\nfaxMessageList.listId = 185161;\nfaxMessageList.from = \"4197\";\nfaxMessageList.customString = \"custom_string\";\nfaxMessageList.country = \"AF\";\nfaxMessageList.fromEmail = \"will@smith.com\";\n\nvar faxMessage = new api.FaxMessageCollection();\n\nfaxMessage.messages = [faxMessageList]\nfaxMessage.fileUrl = \"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\";\n\nfaxApi.faxPricePost(faxMessage).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::FAXApi.new\n\n# FaxMessageCollection | FaxMessageCollection model\nfax_messages = ClickSendClient::FaxMessageCollection.new(\n  \"file_url\": \"file_url\",\n  messages: [\n    ClickSendClient::FaxMessage.new(\n      \"schedule\": 6,\n      \"from\": \"from\",\n      \"source\": \"source\",\n      \"to\": \"+61411111111\",\n      \"custom_string\": \"custom_string\"\n    ),\n    ClickSendClient::FaxMessage.new(\n      \"schedule\": 6,\n      \"from\": \"from\",\n      \"source\": \"source\",\n      \"to\": \"+61422222222\",\n      \"custom_string\": \"custom_string\"\n    )\n  ]\n)\n\nbegin\n  # Calculate Total Price for Fax Messages sent\n  result = api_instance.fax_price_post(fax_messages)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling FAXApi->fax_price_post: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client import FaxMessage\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))\nfile_url='https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf'\nfax_message_list = [FaxMessage(\n                  \"sdk\",\"+11231231234\",185161,\"+11231231234\",1,\"CustomString\",\"CA\",\"john@doe.com\")];\n# FaxMessageCollection | FaxMessageCollection model\nfax_message = clicksend_client.FaxMessageCollection(file_url=file_url,messages=fax_message_list)\n\ntry:\n    # Calculate Total Price for Fax Messages sent\n    api_response = api_instance.fax_price_post(fax_message)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling FAXApi->fax_price_post: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::FAXApi;\nuse WWW::ClickSendClient::Object::FaxMessageCollection;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::FAXApi->new(username => $username, password => $password);\n\nmy %params = (\n    'messages' => [\n        {\n            'source'        => 'perl',\n            'to'            => '+61261111111',\n            'schedule'      => '1436874701',\n            'custom_string' => 'custom_string',\n            'country'       => 'AF',\n            'from_email'    => 'test1@test.com'\n        },\n        {\n            'source'        => 'perl',\n            'to'            => '+61261111122',\n            'schedule'      => '1436874701',\n            'custom_string' => 'custom_string',\n            'country'       => 'AF',\n            'from_email'    => 'test1@test1.com'\n        }\n    ],\n    'file_url' => 'https://www.domain.com/examples/document.pdf'\n);\n\nmy $fax_message_obj = WWW::ClickSendClient::Object::FaxMessageCollection->new(%params);\n\nmy $json_output = $api->fax_price_post('fax_message' => $fax_message_obj);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSFAXApi.h\"\n#import \"CSDefaultConfiguration.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"USERNAME\"];\n[apiConfig setPassword:@\"PASSWORD\"];\n\nCSFaxMessage *faxMessage = [[CSFaxMessage alloc] init];\nfaxMessage.source = @\"objc\";\nfaxMessage.to = @\"+61261111111\";\nfaxMessage.listId = [NSNumber numberWithInt:1];\nfaxMessage.from = @\"from\";\nfaxMessage.customString = @\"custom_string\";\nfaxMessage.country = @\"AF\";\nfaxMessage.fromEmail = @\"will@smith.com\";\n\nCSFaxMessage *faxMessage2 = [[CSFaxMessage alloc] init];\nfaxMessage2.source = @\"objc\";\nfaxMessage2.to = @\"+61261111111\";\nfaxMessage2.listId = [NSNumber numberWithInt:1];\nfaxMessage2.from = @\"from\";\nfaxMessage2.customString = @\"custom_string\";\nfaxMessage2.country = @\"AF\";\nfaxMessage2.fromEmail = @\"will@smith.com\";\n\nCSFaxMessageCollection *faxMessageCollection = [[CSFaxMessageCollection alloc] init];\nfaxMessageCollection.messages = [NSArray arrayWithObjects:faxMessage, faxMessage2, nil];\n\nfaxMessageCollection.fileUrl = @\"fileUrl\";\nCSFAXApi *faxApi = [[CSFAXApi alloc] init];\n[faxApi faxPricePostWithFaxMessage:faxMessageCollection completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nlet faxMessage = FaxMessage(\n                    source: \"swift\", \n                    to: \"+61261111111\", \n                    listId: 1, \n                    from: \"from\", \n                    schedule: 1436874701, \n                    customString: \"custom_string\", \n                    country: \"AF\", \n                    fromEmail: \"will@smith.com\"\n                )\nlet faxMessage2 = FaxMessage(\n                    source: \"swift\", \n                    to: \"+61261111111\", \n                    listId: 1, \n                    from: \"from\", \n                    schedule: nil, \n                    customString: \"custom_string\", \n                    country: \"AF\", \n                    fromEmail: \"will@smith.com\"\n                )\n\nlet faxMessageCollection = FaxMessageCollection(messages: [faxMessage, faxMessage2], fileUrl: \"fileUrl\")\nFAXAPI.faxPricePost(faxMessage: faxMessageCollection) { (dataString, error) in\n    if let error = error {\n        print(error)\n    } else {\n        if let data = dataString!.data(using: String.Encoding.utf8) {\n            do {\n                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                    print(dictonary)\n                } else {\n                    print(\"bad json\")\n                }\n            } catch let error as NSError {\n                print(error)\n            }\n        }\n    }\n}"
          }
        ]
      }
    },
    "/v3/fax/receipts": {
      "get": {
        "summary": "View Fax Receipts",
        "operationId": "view-fax-receipts",
        "description": "_Get List of Fax Receipts_\n\n**Push Delivery Receipts**\n\nIf you prefer, we can push message replies to your server as they arrive with us.\n\n1. Log into your account.\n2. Click on your profile on the top right.\n3. Then click on the Messaging Settings option.\n4. Click on Fax then Delivery Reports.\n5. Click the 'Add New Rule' button.\n6. Select the 'URL' action.\n7. Enter the URL and click 'Save'.\n    \n\nThe following variables will be posted to the URL specified:\n\n| Variable | Description |\n| --- | --- |\n| `timestamp_send` | Timestamp of the original send request in UNIX format. e.g 1439173980 |\n| `timestamp` | Timestamp of delivery report in UNIX format. e.g 1439173981 |\n| `message_id` | Message ID, returned when originally sending the message. |\n| `status` | Delivered or Undelivered |\n| `status_code` | Status code. Refer to 'Fax Delivery Status Codes' in docs. |\n| `status_text` | Status text. |\n| `error_code` | Error code. |\n| `error_text` | Error text. |\n| `custom_string` | A custom string used when sending the original message. |\n| `user_id` | The user ID of the user who sent the message. |\n| `subaccount_id` | The subaccount ID of the user who sent the message. |\n| `message_type` | 'fax' (constant). |\n\n**Pull Delivery Receipts**\n\nReceive delivery reports by polling. You can poll our server and retrieve delivery reports at a time that suits you.\n\n1. Log into your account.\n2. Click on your profile on the top right.\n3. Then click on the Messaging Settings option.\n4. Click on Fax then Delivery Rules.\n5. Click the 'Add New Rule' button.\n6. Select the 'Poll' action.\n7. Then click 'Save'.\n    \n\nRefer to [Status Codes](/#status-codes) for definitions of HTTP status code responses.\n\n\n<div style=\"background-color: #FF6A4B; padding: 10px; border-radius: 8px;\">\n  <span style=\"color: white;\">This endpoint requires authentication,</span> \n  <a href=\"/docs/#authentication\" style=\"color: white; text-decoration: underline;\">more info...</a>\n</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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/fax/receipts'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\FAXApi(new GuzzleHttp\\Client(),$config);\n$page = 1; // int | Page number\n$limit = 10; // int | Number of records per page\n\ntry {\n    $result = $apiInstance->faxReceiptsGet($page, $limit);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling FAXApi->faxReceiptsGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar faxApi = new FAXApi(configuration);\nvar response = faxApi.FaxReceiptsGet();"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.FaxApi;\n\npublic class view_all_fax_receipt {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    FaxApi apiInstance = new FaxApi(defaultClient);\n    Integer page = 1; // Integer | Page number\n    Integer limit = 10; // Integer | Number of records per page\n    try {\n      String result = apiInstance.faxReceiptsGet(page, limit);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling FaxApi#faxReceiptsGet\");\n        e.printStackTrace();\n    }\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar faxApi = new api.FAXApi(\"USERNAME\", \"API_KEY\");\n\nvar page = 1;\nvar limit = 10;\n\nfaxApi.faxReceiptsGet(page, limit).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::FAXApi.new\n\nbegin\n  # Get List of Fax Receipts\n  result = api_instance.fax_receipts_get\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling FAXApi->fax_receipts_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))\n\ntry:\n    # Get List of Fax Receipts\n    api_response = api_instance.fax_receipts_get()\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling FAXApi->fax_receipts_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::FAXApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::FAXApi->new(username => $username, password => $password);\n\nmy $json_output = $api->fax_receipts_get();\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSFAXApi.h\"\n#import \"CSDefaultConfiguration.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"USERNAME\"];\n[apiConfig setPassword:@\"PASSWORD\"];\n\nCSFAXApi *faxApi = [[CSFAXApi alloc] init];\n[faxApi faxReceiptsGetWithPage:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nFAXAPI.faxReceiptsGet { (dataString, error) in\n    if let error = error {\n        print(error)\n    } else {\n        if let data = dataString!.data(using: String.Encoding.utf8) {\n            do {\n                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                    print(dictonary)\n                } else {\n                    print(\"bad json\")\n                }\n            } catch let error as NSError {\n                print(error)\n            }\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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._\n\n### Parameters\n\n| Parameter | In | Type | Required | Description |\n| --- | --- | --- | --- | --- |\n| message_id | path | string | true | ID of the message receipt to retrieve |\n\n\nRefer to [Status Codes](/#status-codes) for definitions of HTTP status code responses.\n\n\n<div style=\"background-color: #FF6A4B; padding: 10px; border-radius: 8px;\">\n  <span style=\"color: white;\">This endpoint requires authentication,</span> \n  <a href=\"/docs/#authentication\" style=\"color: white; text-decoration: underline;\">more info...</a>\n</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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/fax/receipts/{message_id}'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\FAXApi(new GuzzleHttp\\Client(),$config);\n$message_id = \"message_id_example\"; // string | ID of the message receipt to retrieve\n\ntry {\n    $result = $apiInstance->faxReceiptsByMessageIdGet($message_id);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling FAXApi->faxReceiptsByMessageIdGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar faxApi = new FAXApi(configuration);\nvar response = faxApi.FaxReceiptsByMessageIdGet(\"MESSAGE_ID\");"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.FaxApi;\n\npublic class view_specific_fax_receipt {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    FaxApi apiInstance = new FaxApi(defaultClient);\n    // String | ID of the message receipt to retrieve\n    String messageId = \"message_id_example\"; \n    try {\n        String result = apiInstance.faxReceiptsByMessageIdGet(messageId);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling FaxApi#faxReceiptsByMessageIdGet\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar faxApi = new api.FAXApi(\"USERNAME\", \"API_KEY\");\n\nvar messageId = \"message_id_example\";\n\nfaxApi.faxReceiptsByMessageIdGet(messageId).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::FAXApi.new\n\nmessage_id = \"message_id_example\" # String | ID of the message receipt to retrieve\n\nbegin\n  # Get a single fax receipt based on message id.\n  result = api_instance.fax_receipts_by_message_id_get(message_id)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling FAXApi->fax_receipts_by_message_id_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))\nmessage_id = 'message_id_example' # str | ID of the message receipt to retrieve\n\ntry:\n    # Get a single fax receipt based on message id.\n    api_response = api_instance.fax_receipts_by_message_id_get(message_id)\n    pprint(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling FAXApi->fax_receipts_by_message_id_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::FAXApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::FAXApi->new(username => $username, password => $password);\n\nmy $json_output = $api->fax_receipts_by_message_id_get('message_id' => '1234');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSFAXApi.h\"\n#import \"CSDefaultConfiguration.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"USERNAME\"];\n[apiConfig setPassword:@\"PASSWORD\"];\n\nCSFAXApi *faxApi = [[CSFAXApi alloc] init];\n[faxApi faxReceiptsByMessageIdGetWithMessageId:@\"message_id\" completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nFAXAPI.faxReceiptsByMessageIdGet(messageId: \"message_id\") { (dataString, error) in\n    if let error = error {\n        print(error)\n    } else {\n        if let data = dataString!.data(using: String.Encoding.utf8) {\n            do {\n                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                    print(dictonary)\n                } else {\n                    print(\"bad json\")\n                }\n            } catch let error as NSError {\n                print(error)\n            }\n        }\n    }\n}"
          }
        ]
      }
    },
    "/v3/fax/history": {
      "get": {
        "summary": "View Fax History",
        "operationId": "view-fax-history",
        "description": "_Get a list of Fax History._\n\n### Parameters\n\n| Parameter | In | Type | Required | Description |\n| --- | --- | --- | --- | --- |\n| date_from | query | integer(int32) | false | Start date (Unix Timestamp e.g. 1436849372) |\n| date_to | query | integer(int32) | false | End date (Unix Timestamp e.g. 1436879372) |\n| q | query | string | false | Custom query Example: status:Sent,status_code:201. |\n| order | query | string | false | Order result by Example: date_added:desc,list_id:desc. |\n| page | query | integer(int32) | false | [Page number](/#pagination) |\n| limit | query | integer(int32) | false | [Number of records per page](/#pagination) |\n\nRefer to [Status Codes](/#status-codes) for definitions of HTTP status code responses.\n\nThis endpoint requires authentication, [more info...](/#authentication)\n\n\nRefer to [Status Codes](/#status-codes) for definitions of HTTP status code responses.\n\n\n<div style=\"background-color: #FF6A4B; padding: 10px; border-radius: 8px;\">\n  <span style=\"color: white;\">This endpoint requires authentication,</span> \n  <a href=\"/docs/#authentication\" style=\"color: white; text-decoration: underline;\">more info...</a>\n</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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/fax/"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\FAXApi(new GuzzleHttp\\Client(),$config);\n$date_from = '2018-01-01'; // int | Customize result by setting from date (timestamp) Example: 1457572619.\n$date_to = '2019-01-01'; // int | Customize result by setting to date (timestamp) Example: 1457573000.\n$q = \"q_example\"; // string | Custom query Example: status:Sent,status_code:201.\n$order = \"order_example\"; // string | Order result by Example: date_added:desc,list_id:desc.\n$page = 1; // int | Page number\n$limit = 10; // int | Number of records per page\n\ntry {\n    $result = $apiInstance->faxHistoryGet($date_from, $date_to, $q, $order, $page, $limit);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling FAXApi->faxHistoryGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar faxApi = new FAXApi(configuration);\n\nvar dateFrom = '1546913229';\nvar dateTo = '1546923229';\nvar q = 'q_example';\nvar order = 'order_example';\nvar page = 1;\nvar limit = 10;\n\nvar response = faxApi.FaxHistoryGet(dateFrom, dateTo, q, order, page, limit);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.FaxApi;\n\npublic class view_fax_history {\n  public static void main(String[] args) {\n        ApiClient defaultClient = new ApiClient();\n        defaultClient.setUsername(\"USERNAME\");\n        defaultClient.setPassword(\"API_KEY\");\n        FaxApi apiInstance = new FaxApi(defaultClient);\n        Integer dateFrom = 1546913229; // Integer | Customize result by setting from date (timestamp) Example: 1457572619.\n        Integer dateTo = 1546923229; // Integer | Customize result by setting to date (timestamp) Example: 1457573000.\n        String q = \"q_example\"; // String | Custom query Example: status:Sent,status_code:201.\n        String order = \"order_example\"; // String | Order result by Example: date_added:desc,list_id:desc.\n        Integer page = 1; // Integer | Page number\n        Integer limit = 10; // Integer | Number of records per page\n        try {\n            String result = apiInstance.faxHistoryGet(dateFrom, dateTo, q, order, page, limit);\n            System.out.println(result);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling FaxApi#faxHistoryGet\");\n            e.printStackTrace();\n        }\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar faxApi = new api.FAXApi(\"USERNAME\", \"API_KEY\");\n\nvar dateFrom = '1546913229';\nvar dateTo = '1546923229';\nvar q = 'q_example';\nvar order = 'order_example';\nvar page = 1;\nvar limit = 10;\n\nfaxApi.faxHistoryGet(dateFrom, dateTo, q, order, page, limit).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::FAXApi.new\n\nopts = {\n  \"date_from\": 1546913229, # Integer | Customize result by setting from date (timestamp) Example: 1457572619.\n  \"date_to\": 1546923229, # Integer | Customize result by setting to date (timestamp) Example: 1457573000.\n  \"q\": \"q_example\", # String | Custom query Example: status:Sent,status_code:201.\n  \"order\": \"order_example\", # String | Order result by Example: date_added:desc,list_id:desc.\n  \"page\": 1, # Integer | Page number\n  \"limit\": 10 # Integer | Number of records per page\n}\n\nbegin\n  # Get a list of Fax History.\n  result = api_instance.fax_history_get(opts)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling FAXApi->fax_history_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))\ndate_from = 1546913229 # int | Customize result by setting from date (timestamp) Example: 1457572619. (optional)\ndate_to = 1546923229 # int | Customize result by setting to date (timestamp) Example: 1457573000. (optional)\nq = 'q_example' # str | Custom query Example: status:Sent,status_code:201. (optional)\norder = 'order_example' # str | Order result by Example: date_added:desc,list_id:desc. (optional)\npage = 1 # int | Page number (optional) (default to 1)\nlimit = 10 # int | Number of records per page (optional) (default to 10)\n\ntry:\n    # Get a list of Fax History.\n    api_response = api_instance.fax_history_get(date_from=date_from, date_to=date_to, q=q, order=order, page=page, limit=limit)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling FAXApi->fax_history_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::FAXApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::FAXApi->new(username => $username, password => $password);\n\nmy %params = (\n    'date_from' => '1457572619',\n    'date_to'   => '1457573000',\n    'q'         => 'status_code:201',\n    'order'     => 'list_id:desc',\n    'page'      => '1',\n    'limit'     => '6'\n);\n\nmy $json_output = $api->fax_history_get(%params);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSFAXApi.h\"\n#import \"CSDefaultConfiguration.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"USERNAME\"];\n[apiConfig setPassword:@\"PASSWORD\"];\n\nNSNumber *dateFrom = [NSNumber numberWithInt:3113123];\nNSNumber *dateTo = [NSNumber numberWithInt:3113125];\nCSFAXApi *faxApi = [[CSFAXApi alloc] init];\n[faxApi faxHistoryGetWithDateFrom:dateFrom dateTo:dateTo q:@\"q\" order:@\"order\" page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nFAXAPI.faxHistoryGet { (dataString, error) in\n    if let error = error {\n        print(error)\n    } else {\n        if let data = dataString!.data(using: String.Encoding.utf8) {\n            do {\n                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                    print(dictonary)\n                } else {\n                    print(\"bad json\")\n                }\n            } catch let error as NSError {\n                print(error)\n            }\n        }\n    }\n}"
          }
        ]
      }
    }
  }
}