openapi: 3.0.0
info:
  title: Voice Messaging
  description: Everything about sending and viewing responses to voice messages
servers:
  - url: https://rest.clicksend.com
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    voice_message:
      type: object
      properties:
        date:
          type: number
          description: The date.
          example: 1436871253
        to:
          type: string
          description: The recipient's phone number.
          example: '+61411111111'
        to_type:
          type: string
          description: The type of recipient.
          example: mobile
        body:
          type: string
          description: The body of the message.
          example: Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.
        from:
          type: string
          nullable: true
          description: The sender's phone number.
          example: null
        lang:
          type: string
          description: The language of the message.
          example: en-au
        voice:
          type: string
          description: The voice of the message.
          example: female
        schedule:
          type: number
          description: The timestamp when the message should be sent.
          example: 1436874701
        message_id:
          type: string
          description: The ID of the message.
          example: BF7AD270-0DE2-418B-B606-71D527D9C1AE
        message_parts:
          type: number
          description: The number of parts in the message.
          example: 1
        message_price:
          type: number
          description: The price of the message.
          example: 0.07
        custom_string:
          type: string
          description: The custom string of the message.
          example: this is a test
        user_id:
          type: number
          description: The ID of the user.
          example: 1
        subaccount_id:
          type: number
          description: The ID of the subaccount.
          example: 1
        country:
          type: string
          description: The country code of the message.
          example: AU
        require_input:
          type: number
          description: The require input of the message.
          example: 0
        machine_detection:
          type: number
          description: The machine detection of the message.
          example: 0
        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-voice-message:
      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: Here are your data.
        data:
          type: object
          properties:
            total_price:
              type: number
              example: 0.07
              description: The total price of the message.
            total_count:
              type: number
              example: 1
              description: The total count of the message.
            queued_count:
              type: number
              example: 1
              description: The count of the queued message.
            messages:
              type: array
              items:
                $ref: '#/components/schemas/voice_message'
            _currency:
              $ref: '#/components/schemas/currency'
    calculate-voice-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: Here are your data.
        data:
          type: object
          properties:
            total_price:
              type: number
              example: 0.07
              description: The total price of the message.
            total_count:
              type: number
              example: 1
              description: The total count of the message.
            queued_count:
              type: number
              example: 1
              description: The count of the queued message.
            messages:
              type: array
              items:
                $ref: '#/components/schemas/voice_message'
            _currency:
              $ref: '#/components/schemas/currency'
    view-voice-languages:
      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 the possible languages.
        data:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: The code of the language.
                example: en-us
              country:
                type: string
                description: The country of the language.
                example: English, US
              gender:
                type: array
                items:
                  type: string
                  description: The gender of the language.
                example:
                  - male
                  - female
          example:
            - code: en-us
              country: English, US
              gender:
                - male
                - female
            - code: en-au
              country: English, Australia
              gender:
                - male
                - female
    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
    voice_receipt:
      type: object
      properties:
        timestamp_send:
          type: string
          description: >-
            Timestamp of the original send request in UNIX format. e.g
            1439173980
          example: '1442381791'
        timestamp:
          type: string
          description: Timestamp of delivery report in UNIX format. e.g 1439173981
          example: '1442381791'
        message_id:
          type: string
          description: Message ID, returned when originally sending the message.
          example: 31BC271B-1E0C-45F6-9E7E-97186C46BB82
        status_code:
          type: string
          description: Status code. Refer to 'Voice Delivery Status Codes' in docs.
          example: '201'
        status_text:
          type: string
          description: Status text.
          example: 'Success: Message received on handset.'
        error_code:
          type: string
          nullable: true
          description: Error code.
          example: null
        error_text:
          type: string
          nullable: true
          description: Error text.
          example: null
        custom_string:
          type: string
          nullable: true
          description: A custom string used when sending the original message.
          example: null
        message_type:
          type: string
          description: voice (constant).
          example: voice
        digits:
          type: string
          description: >-
            Numbers the recipient pressed on their keypad during the call. A
            blank string will be used if they didn't provide any input.
          example: null
    view-voice-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/voice_receipt'
                  example:
                    - timestamp_send: '1442381791'
                      timestamp: '1442381791'
                      message_id: 31BC271B-1E0C-45F6-9E7E-97186C46BB82
                      status_code: '201'
                      status_text: 'Success: Message received on handset.'
                      error_code: null
                      error_text: null
                      custom_string: null
                      message_type: voice
                      digits: 2
                    - timestamp_send: '1442381829'
                      timestamp: '1442381829'
                      message_id: 23C8ADA3-FD8B-420B-801A-F829BB87AC6F
                      status_code: '201'
                      status_text: 'Success: Message received on handset.'
                      error_code: null
                      error_text: null
                      custom_string: null
                      message_type: voice
                      digits: 5
    cancel-voice-message:
      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: Voice have been cancelled.
        data:
          type: array
          items: []
          example: []
    cancel-all-voice-messages:
      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: 5 messages have been cancelled.
        data:
          type: object
          properties:
            count:
              type: integer
              example: 5
              description: The count of messages that has been cancelled.
    get-voice-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/voice_message'
    export-voice-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: Download your file here.
        data:
          type: object
          properties:
            url:
              type: string
              description: The URL to download the file.
              example: >-
                https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv
paths:
  /v3/voice/send:
    post:
      summary: Send Voice Message
      operationId: send-voice-message
      description: >-
        _Send voice message(s)_


        Send TTS (Text-to-speech) voice calls


        ### How many messages can I send?


        You can post **up to 1000 messages** with each API call. You can send to
        a mix of contacts and contact lists, as long as the total number of
        recipients is up to 1000. The response contains a status and details for
        each recipient.


        ### How many characters can I send in a message?


        If a message is longer than 4 message parts, it will be truncated (see
        below). If a message contains any characters that aren't in the GSM
        03.38 character set, the message type will be treated as unicode.
        (`https://en.wikipedia.org/wiki/GSM_03.38`)


        ### _Standard English Characters:_


        | Number of Characters | Message Credits |

        | --- | --- |

        | 1 - 300 | 1 |

        | 301 - 600 | 2 |

        | 601 - 900 | 3 |

        | 901 - 1200 | 4 |


        ### _Non-GSM (Unicode) characters:_


        | Number of Characters | Message Credits |

        | --- | --- |

        | 1 - 150 | 1 |

        | 151 - 300 | 2 |

        | 301 - 450 | 3 |

        | 451 - 600 | 4 |


        ### _Allowed Languages_


        | Language, Locale | lang | voice |

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

        | `English`, US | en-us | female (default) / male |

        | `English`, Australia | en-au | female (default) / male |

        | `English`, UK | en-gb | female (default) / male |

        | `English`, India | en-in | female |

        | `English`, Wales | en-gb-wls | female (default) / male |

        | `Celtic`, Wales | cy-gb-wls | female (default) / male |

        | `German`, Germany | de-de | female (default) / male |

        | `Spanish`, Spain | es-es | female (default) / male |

        | `Spanish`, US | es-us | female (default) / male |

        | `French`, Canada | fr-ca | female |

        | `French`, France | fr-fr | female (default) / male |

        | `Icelandic`, Iceland | is-is | female (default) / male |

        | `Italian`, Italy | it-it | female (default) / male |

        | `Danish`, Denmark | da-dk | female (default) / male |

        | `Dutch`, Netherlands | nl-nl | female (default) / male |

        | `Norwegian`, Norway | nb-no | female |

        | `Polish`, Poland | pl-pl | female (default) / male |

        | `Portuguese`, Portugal | pt-pt | male |

        | `Portuguese`, Brazil | pt-br | female (default) / male |

        | `Romanian`, Romania | ro-ro | female |

        | `Russian`, Russia | ru-ru | female (default) / male |

        | `Swedish`, Sweden | sv-se | female |

        | `Turkish`, Turkey | tr-tr | female |


        _Tips_


        To introduce a small delay between words or digits you can use a comma
        (,).


        For example: `Please enter your activation code 9, 0, 9, 0, in the next
        20 minutes.`


        We support some SSML tags allowing custom breaks or pauses to be
        entered, and the readout rate to be altered.


        [More
        info...](https://help.clicksend.com/voice/how-to-adjust-tts-voice-calls)


        ### Properties


        | Name | Type | Required | Restrictions | Description |

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

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

        | body | string | true | none | Biscuit uv3nlCOjRk croissant chocolate
        lollipop chocolate muffin. |

        | voice | string | true | none | Either 'female' or 'male'. |

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

        | country | string | true | none | The country of the recipient. |

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

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

        | lang | string | false | none | au (string, required) - See section on
        available languages. |

        | 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)
        |

        | require_input | integer(int1) | false | none | Recieve a keypress from
        the recipient. Flag value must be 1 for yes or 0 for no. |

        | machine_detection | integer(int1) | false | none | Detect answering
        machine or voicemail and leave a message. Flag value must be 1 for yes
        or 0 for no. |



        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:
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      source:
                        type: string
                      body:
                        type: string
                      to:
                        type: string
                      voice:
                        type: string
                      lang:
                        type: string
                      machine_detection:
                        type: integer
              example:
                messages:
                  - source: postman
                    body: >-
                      Your verification code is. 1. 2. 3. 4. 5. Again that's. 1,
                      2, 3, 4, 5.
                    to: '+61411111111'
                    voice: male
                    lang: en-au
                    machine_detection: 1
      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-voice-message'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \

                 --data-binary "    {
                    \"messages\":[
                        {
                            \"source\":\"php\",
                            \"body\":\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\",
                            \"to\":\"+61411111111\",
                            \"lang\":\"en-au\",
                            \"voice\":\"female\",
                            \"schedule\":1436874701,
                            \"custom_string\":\"this is a test\",
                            \"require_input\": 1,
                            \"machine_detection\": 1
                        },
                        {
                            \"source\":\"php\",
                            \"body\":\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\",
                            \"to\":\"+61422222222\",
                            \"lang\":\"en-au\",
                            \"voice\":\"female\",
                            \"schedule\":1436876011,
                            \"custom_string\":\"this is a test\"
                        }
                    ]
                }" \
            'https://rest.clicksend.com/v3/voice/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\VoiceApi(new
            GuzzleHttp\Client(),$config);

            $voice_message = new \ClickSend\Model\VoiceMessage();

            $voice_message->setTo("+61411111111");

            $voice_message->setBody("Jelly liquorice marshmallow candy carrot
            cake 4Eyffjs1vL.");

            $voice_message->setVoice("female");

            $voice_message->setCustomString("custom");

            $voice_message->setCountry("country");

            $voice_message->setSource("php");

            $voice_message->setListId(185161);

            $voice_message->setLang("en-au");

            $voice_message->setSchedule(1577053342);

            $voice_message->setRequireInput(1);

            $voice_message->setMachineDetection(1);

            // \ClickSend\Model\VoiceMessageCollection | VoiceMessageCollection
            model

            $voice_messages = new \ClickSend\Model\VoiceMessageCollection(); 

            $voice_messages->setMessages([$voice_message]);


            try {
                $result = $apiInstance->voiceSendPost($voice_messages);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling VoiceApi->voiceSendPost: ', $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 voiceApi = new VoiceApi(configuration);

            var listOfVoiceMessages = new List<VoiceMessage>();

            listOfVoiceMessages.Add(new VoiceMessage( 
                to: "+11231231234",
                body: "This is test body",
                voice: "female",
                customString: "Custom String",
                country: "CA",
                source: "sdk",
                lang: "en-us",
                machineDetection: 0,
                requireInput: 0,
                schedule: TimeStamp
            ));

            var voicemessagecollection = new
            VoiceMessageCollection(listOfVoiceMessages);

            var response = voiceApi.VoiceSendPost(voicemessagecollection);
        - lang: Java
          source: |-
            package ClickSend;

            import java.util.Arrays;
            import java.util.List;
            import ClickSend.Api.VoiceApi;
            import ClickSend.Model.VoiceMessage;
            import ClickSend.Model.VoiceMessageCollection;

            public class send_voice_msg {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                VoiceApi apiInstance = new VoiceApi(defaultClient);
                VoiceMessage voiceMessage=new VoiceMessage();
                voiceMessage.to("+61411111111");
                voiceMessage.body("Test");
                voiceMessage.voice("female");
                voiceMessage.customString("testing");
                voiceMessage.country("india");
                voiceMessage.source("source");
                voiceMessage.listId(new Integer(185161));
                voiceMessage.lang("lang");
                voiceMessage.schedule(new Integer(1545477071));
                voiceMessage.requireInput(new Integer(1));
                voiceMessage.machineDetection(new Integer(0));
                List<VoiceMessage> voiceMessageList=Arrays.asList(voiceMessage);
                // VoiceMessageCollection | VoiceMessageCollection model
                VoiceMessageCollection voiceMessages = new VoiceMessageCollection(); 
                voiceMessages.messages(voiceMessageList);
                try {
                    String result = apiInstance.voiceSendPost(voiceMessages);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling VoiceApi#voiceSendPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME",
            "API_KEY");


            var voiceMessage = new api.VoiceMessage();


            voiceMessage.to = "+61411111111";

            voiceMessage.body = "Jelly liquorice marshmallow candy carrot cake
            4Eyffjs1vL";

            voiceMessage.voice = "female";

            voiceMessage.customString = "this is a test";

            voiceMessage.country = "US";

            voiceMessage.source = "source";

            voiceMessage.listId = 185161;

            voiceMessage.lang = "en-au";

            voiceMessage.requireInput = 1;

            voiceMessage.machineDetection = 1;


            var voiceMessages = new api.VoiceMessageCollection();


            voiceMessages.messages = [voiceMessage]


            voiceDeliveryReceiptApi.voiceSendPost(voiceMessages).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::VoiceApi.new

            # VoiceMessageCollection | VoiceMessageCollection model
            voice_messages = ClickSendClient::VoiceMessageCollection.new(
              "messages": [
                ClickSendClient::VoiceMessage.new(
                  "voice": "voice",
                  "require_input": 0,
                  "to": "to",
                  "source": "source",
                  "body": "body",
                  "lang": "lang",
                  "custom_string": "custom_string",
                  "machine_detection": 0
                ),
                ClickSendClient::VoiceMessage.new(
                  "voice": "voice",
                  "require_input": 0,
                  "to": "to",
                  "source": "source",
                  "body": "body",
                  "lang": "lang",
                  "custom_string": "custom_string",
                  "machine_detection": 0
                )
              ]
            )

            begin
              # Send voice message(s)
              result = api_instance.voice_send_post(voice_messages)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling VoiceApi->voice_send_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client import VoiceMessage

            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.VoiceApi(clicksend_client.ApiClient(configuration))

            # VoiceMessageCollection | VoiceMessageCollection model

            voice_message=VoiceMessage(source="php",
                            body="Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
                            to="+61411111111",
                            lang="en-au",
                            voice="female",
                            schedule="1436874701",
                            custom_string="this is a test",
                            require_input=1,
                            machine_detection=1,country="india")
            voice_messages =
            clicksend_client.VoiceMessageCollection(messages=[voice_message]) 


            try:
                # Send voice message(s)
                api_response = api_instance.voice_send_post(voice_messages)
                print(api_response)
            except ApiException as e:
                print("Exception when calling VoiceApi->voice_send_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::VoiceApi;

            use WWW::ClickSendClient::Object::VoiceMessageCollection;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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

            my %params = (
                'messages' => [
                    {
                        'voice'             => 'voice',
                        'country'           => 'country',
                        'require_input'     => 0,
                        'to'                => 'to',
                        'source'            => 'source',
                        'body'              => 'body',
                        'lang'              => 'lang',
                        'custom_string'     => 'custom_string',
                        'machine_detection' => 0
                    },
                    {
                        'voice'             => 'voice',
                        'country'           => 'country',
                        'require_input'     => 0,
                        'to'                => 'to',
                        'source'            => 'source',
                        'body'              => 'body',
                        'lang'              => 'lang',
                        'custom_string'     => 'custom_string',
                        'machine_detection' => 0
                    }
                ]
            );


            my $voice_messages_obj =
            WWW::ClickSendClient::Object::VoiceMessageCollection->new(%params);


            my $json_output = $api->voice_send_post('voice_messages' =>
            $voice_messages_obj);


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

            #import "CSVoiceApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSVoiceMessage *voiceMessage1 = [[CSVoiceMessage alloc] init];

            voiceMessage1.to = @"+61411111111";

            voiceMessage1.body = @"Jelly two liquorice marshmallow candy carrot
            cake.";

            voiceMessage1.voice = @"female";

            voiceMessage1.customString = @"test";

            voiceMessage1.country = @"US";

            voiceMessage1.source = @"objc";


            CSVoiceMessage *voiceMessage2 = [[CSVoiceMessage alloc] init];

            voiceMessage2.to = @"+61411111111";

            voiceMessage2.body = @"Jelly two liquorice marshmallow candy carrot
            cake.";

            voiceMessage2.voice = @"female";

            voiceMessage2.customString = @"test";

            voiceMessage2.country = @"US";

            voiceMessage2.source = @"objc";


            CSVoiceMessageCollection *voiceMessageCollection = 
            [[CSVoiceMessageCollection alloc] init];

            voiceMessageCollection.messages = (NSArray<CSVoiceMessage> *)
            [NSArray arrayWithObjects:
                                                                                    voiceMessage1,
                                                                                    voiceMessage2,
                                                                                    nil];

            CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];

            [voiceAPI voiceSendPostWithVoiceMessages:voiceMessageCollection
            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 voiceMessage1 = VoiceMessage(
                to: "+61411111111", 
                body: "Jelly liquorice marshmallow candy carrot cake.", 
                voice: "female", 
                customString: "test", 
                country: "US", 
                source: "swift", 
                listId: nil, 
                lang: nil, 
                schedule: nil, 
                requireInput: nil, 
                machineDetection: nil
            )


            let voiceMessage2 = VoiceMessage(
                to: "+61411111111",
                body: "Jelly two liquorice marshmallow candy carrot cake.", 
                voice: "female", 
                customString: "test",
                country: "US",
                source: "swift", 
                listId: nil, 
                lang: nil, 
                schedule: nil, 
                requireInput: nil, 
                machineDetection: nil
            )


            let voiceMessageCollection = VoiceMessageCollection(messages:
            [voiceMessage1, voiceMessage2])


            VoiceAPI.voiceSendPost(voiceMessages: voiceMessageCollection) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                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("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/voice/price:
    post:
      summary: Calculate Voice Price
      operationId: calculate-voice-price
      description: >-
        _Calculate voice price_


        ### Properties


        | Name | Type | Required | Restrictions | Description |

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

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

        | body | string | true | none | Biscuit uv3nlCOjRk croissant chocolate
        lollipop chocolate muffin. |

        | voice | string | true | none | Either 'female' or 'male'. |

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

        | country | string | true | none | The country of the recipient. |

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

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

        | lang | string | false | none | au (string, required) - See section on
        available languages. |

        | 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)
        |

        | require_input | integer(int1) | false | none | Recieve a keypress from
        the recipient. Flag value must be 1 for yes or 0 for no. |

        | machine_detection | integer(int1) | false | none | Detect answering
        machine or voicemail and leave a message. Flag value must be 1 for yes
        or 0 for no. |



        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:
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      source:
                        type: string
                      from:
                        type: string
                      body:
                        type: string
                      to:
                        type: string
                      voice:
                        type: string
                      lang:
                        type: string
                      schedule:
                        type: string
                      custom_string:
                        type: string
                      asdasd:
                        type: string
                      machine_detection:
                        type: integer
              example:
                messages:
                  - source: php
                    from: '1234'
                    body: Hi, this is a test.
                    to: '+61411111111'
                    voice: female
                    lang: en-au
                    schedule: '1529086126'
                    custom_string: this is a test
                    asdasd: asdadasd
                    machine_detection: 1
      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-voice-price'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \

                 --data-binary "    {
                    \"messages\":[
                        {
                            \"source\":\"php\",
                            \"body\":\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\",
                            \"to\":\"+61411111111\",
                            \"lang\":\"en-au\",
                            \"voice\":\"female\",
                            \"schedule\":1436874701,
                            \"custom_string\":\"this is a test\"
                        },
                        {
                            \"source\":\"php\",
                            \"body\":\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\",
                            \"to\":\"+61422222222\",
                            \"lang\":\"en-au\",
                            \"voice\":\"female\",
                            \"schedule\":1436876011,
                            \"custom_string\":\"this is a test\",
                            \"require_input\":1
                        }
                    ]
                }" \
            'https://rest.clicksend.com/v3/voice/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\VoiceApi(new
            GuzzleHttp\Client(),$config);

            $voice_message = new \ClickSend\Model\VoiceMessage();

            $voice_message->setTo("+61411111111");

            $voice_message->setBody("Jelly liquorice marshmallow candy carrot
            cake 4Eyffjs1vL.");

            $voice_message->setVoice("female");

            $voice_message->setCustomString("custom");

            $voice_message->setCountry("country");

            $voice_message->setSource("php");

            $voice_message->setListId(185161);

            $voice_message->setLang("en-au");

            $voice_message->setSchedule(1577053342);

            $voice_message->setRequireInput(1);

            $voice_message->setMachineDetection(1);

            // \ClickSend\Model\VoiceMessageCollection | VoiceMessageCollection
            model

            $voice_messages = new \ClickSend\Model\VoiceMessageCollection(); 

            $voice_messages->setMessages([$voice_message]);


            try {
                $result = $apiInstance->voicePricePost($voice_messages);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling VoiceApi->voicePricePost: ', $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 voiceApi = new VoiceApi(configuration);

            var listOfVoiceMessages = new List<VoiceMessage>();

            listOfVoiceMessages.Add(new VoiceMessage(
                to: "+11231231234",
                body: "This is test body",
                voice: "female",
                customString: "Custom String",
                country: "CA",
                source: "sdk",
                lang: "en-us",
                machineDetection: 0,
                requireInput: 0,
                schedule: TimeStamp
            ));

            var voicemessagecollection = new
            VoiceMessageCollection(listOfVoiceMessages);

            var response = voiceApi.VoicePricePost(voicemessagecollection);
        - lang: Java
          source: |-
            package ClickSend;

            import java.util.Arrays;
            import java.util.List;
            import ClickSend.Api.VoiceApi;
            import ClickSend.Model.VoiceMessage;
            import ClickSend.Model.VoiceMessageCollection;

            public class calculate_voice_price {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                VoiceApi apiInstance = new VoiceApi(defaultClient);
                VoiceMessage voiceMessage=new VoiceMessage();
                voiceMessage.to("+61411111111");
                voiceMessage.body("Test");
                voiceMessage.voice("female");
                voiceMessage.customString("testing");
                voiceMessage.country("india");
                voiceMessage.source("source");
                voiceMessage.listId(new Integer(185161));
                voiceMessage.lang("lang");
                voiceMessage.schedule(new Integer(1545477071));
                voiceMessage.requireInput(new Integer(1));
                voiceMessage.machineDetection(new Integer(0));
                List<VoiceMessage> voiceMessageList=Arrays.asList(voiceMessage);
                // VoiceMessageCollection | VoiceMessageCollection model
                VoiceMessageCollection voiceMessages = new VoiceMessageCollection(); 
                voiceMessages.messages(voiceMessageList);
                try {
                    String result = apiInstance.voicePricePost(voiceMessages);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling VoiceApi#voicePricePost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME",
            "API_KEY");


            var voiceMessage = new api.VoiceMessage();


            voiceMessage.to = "+61411111111";

            voiceMessage.body = "Jelly liquorice marshmallow candy carrot cake
            4Eyffjs1vL";

            voiceMessage.voice = "female";

            voiceMessage.customString = "this is a test";

            voiceMessage.country = "US";

            voiceMessage.source = "source";

            voiceMessage.listId = 185161;

            voiceMessage.lang = "en-au";

            voiceMessage.requireInput = 1;

            voiceMessage.machineDetection = 1;


            var voiceMessages = new api.VoiceMessageCollection();


            voiceMessages.messages = [voiceMessage]


            voiceDeliveryReceiptApi.voicePricePost(voiceMessages).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::VoiceApi.new

            # VoiceMessageCollection | VoiceMessageCollection model
            voice_messages = ClickSendClient::VoiceMessageCollection.new(
              "messages": [
                ClickSendClient::VoiceMessage.new(
                  "voice": "voice",
                  "require_input": 0,
                  "to": "to",
                  "source": "source",
                  "body": "body",
                  "lang": "lang",
                  "custom_string": "custom_string",
                  "machine_detection": 0
                ),
                ClickSendClient::VoiceMessage.new(
                  "voice": "voice",
                  "require_input": 0,
                  "to": "to",
                  "source": "source",
                  "body": "body",
                  "lang": "lang",
                  "custom_string": "custom_string",
                  "machine_detection": 0
                )
              ]
            )

            begin
              # Calculate voice price
              result = api_instance.voice_price_post(voice_messages)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling VoiceApi->voice_price_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client import VoiceMessage

            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.VoiceApi(clicksend_client.ApiClient(configuration))

            # VoiceMessageCollection | VoiceMessageCollection model

            voice_message=VoiceMessage(source="php",
                            body="Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
                            to="+61411111111",
                            lang="en-au",
                            voice="female",
                            schedule="1436874701",
                            custom_string="this is a test",
                            require_input=1,
                            machine_detection=1,country="india")
            voice_messages =
            clicksend_client.VoiceMessageCollection(messages=[voice_message]) 


            try:
                # Calculate voice price
                api_response = api_instance.voice_price_post(voice_messages)
                print(api_response)
            except ApiException as e:
                print("Exception when calling VoiceApi->voice_price_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::VoiceApi;

            use WWW::ClickSendClient::Object::VoiceMessageCollection;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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

            my %params = (
                'messages' => [
                    {
                        'voice'             => 'voice',
                        'country'           => 'country',
                        'require_input'     => 0,
                        'to'                => 'to',
                        'source'            => 'source',
                        'body'              => 'body',
                        'lang'              => 'lang',
                        'custom_string'     => 'custom_string',
                        'machine_detection' => 0
                    },
                    {
                        'voice'             => 'voice',
                        'country'           => 'country',
                        'require_input'     => 0,
                        'to'                => 'to',
                        'source'            => 'source',
                        'body'              => 'body',
                        'lang'              => 'lang',
                        'custom_string'     => 'custom_string',
                        'machine_detection' => 0
                    }
                ]
            );


            my $voice_messages_obj =
            WWW::ClickSendClient::Object::VoiceMessageCollection->new(%params);


            my $json_output = $api->voice_price_post('voice_messages' =>
            $voice_messages_obj);


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

            #import "CSVoiceApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSVoiceMessage *voiceMessage1 = [[CSVoiceMessage alloc] init];

            voiceMessage1.to = @"+61411111111";

            voiceMessage1.body = @"Jelly two liquorice marshmallow candy carrot
            cake.";

            voiceMessage1.voice = @"female";

            voiceMessage1.customString = @"test";

            voiceMessage1.country = @"US";

            voiceMessage1.source = @"objc";


            CSVoiceMessage *voiceMessage2 = [[CSVoiceMessage alloc] init];

            voiceMessage2.to = @"+61411111111";

            voiceMessage2.body = @"Jelly two liquorice marshmallow candy carrot
            cake.";

            voiceMessage2.voice = @"female";

            voiceMessage2.customString = @"test";

            voiceMessage2.country = @"US";

            voiceMessage2.source = @"objc";


            CSVoiceMessageCollection *voiceMessageCollection = 
            [[CSVoiceMessageCollection alloc] init];

            voiceMessageCollection.messages = (NSArray<CSVoiceMessage> *)
            [NSArray arrayWithObjects:
                                                                                    voiceMessage1,
                                                                                    voiceMessage2,
                                                                                    nil];

            CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];

            [voiceAPI voicePricePostWithVoiceMessages:voiceMessageCollection
            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 voiceMessage1 = VoiceMessage(
                to: "+61411111111", 
                body: "Jelly liquorice marshmallow candy carrot cake.", 
                voice: "female", 
                customString: "test", 
                country: "US", 
                source: "swift", 
                listId: nil, 
                lang: nil, 
                schedule: nil, 
                requireInput: nil, 
                machineDetection: nil
            )


            let voiceMessage2 = VoiceMessage(
                to: "+61411111111",
                body: "Jelly two liquorice marshmallow candy carrot cake.", 
                voice: "female", 
                customString: "test",
                country: "US",
                source: "swift", 
                listId: nil, 
                lang: nil, 
                schedule: nil, 
                requireInput: nil, 
                machineDetection: nil
            )


            let voiceMessageCollection = VoiceMessageCollection(messages:
            [voiceMessage1, voiceMessage2])


            VoiceAPI.voicePricePost(voiceMessages: voiceMessageCollection) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                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("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/voice/lang:
    get:
      summary: View Voice Languages
      operationId: view-voice-languages
      description: >-
        _Get all voice languages_



        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-voice-languages'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/voice/lang'
        - 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\VoiceApi(new
            GuzzleHttp\Client(),$config);


            try {
                $result = $apiInstance->voiceLangGet();
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling VoiceApi->voiceLangGet: ', $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 voiceApi = new VoiceApi(configuration);
            var response = voiceApi.VoiceLangGet();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.VoiceApi;

            public class view_voice_language {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                VoiceApi apiInstance = new VoiceApi(defaultClient);
                try {
                    String result = apiInstance.voiceLangGet();
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling VoiceApi#voiceLangGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME",
            "API_KEY");


            voiceDeliveryReceiptApi.voiceLangGet().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::VoiceApi.new

            begin
              # Get all voice languages
              result = api_instance.voice_lang_get
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling VoiceApi->voice_lang_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.VoiceApi(clicksend_client.ApiClient(configuration))


            try:
                # Get all voice languages
                api_response = api_instance.voice_lang_get()
                print(api_response)
            except ApiException as e:
                print("Exception when calling VoiceApi->voice_lang_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::VoiceApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


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


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

            #import "CSVoiceApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];

            [voiceAPI voiceLangGetWithCompletionHandler:^(NSString *output,
            NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: |-
            import Alamofire

            VoiceAPI.voiceLangGet { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                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("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/voice/receipts:
    get:
      summary: View Voice Receipts
      operationId: view-voice-receipts
      description: >-
        _Get all voice 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 Voice then Delivery Report Rules.

        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 'Voice 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` | 'voice' (constant). |

        | `digits` | Numbers the recipient pressed on their keypad during the
        call. A blank string will be used if they didn't provide any input. |


        **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 Voice then Delivery Report Rules.

        5. Click the 'Add New Rule' button.

        6. Select the 'Poll' action.

        7. Then click 'Save'.
            

        ### Parameters


        | Parameter | In | Type | Required | Description |

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

        | page | query | integer(int32) | false | [Page number](/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](/#pagination) |



        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-voice-receipts'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/voice/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\VoiceApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

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


            try {
                $result = $apiInstance->voiceReceiptsGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling VoiceApi->voiceReceiptsGet: ', $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 voiceApi = new VoiceApi(configuration);
            var response = voiceApi.VoiceReceiptsGet();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.VoiceApi;

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


            var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME",
            "API_KEY");


            var page = 1;

            var limit = 10;


            voiceDeliveryReceiptApi.voiceReceiptsGet(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::VoiceApi.new

            opts = {
              page: 1, # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all voice receipts
              result = api_instance.voice_receipts_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling VoiceApi->voice_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.VoiceApi(clicksend_client.ApiClient(configuration))

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

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


            try:
                # Get all voice receipts
                api_response = api_instance.voice_receipts_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling VoiceApi->voice_receipts_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::VoiceApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output = $api->voice_receipts_get('page' => 1,'limit' =>
            '10');


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

            #import "CSVoiceApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];

            [voiceAPI voiceReceiptsGetWithPage:@(1) limit:@(15)
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: |-
            import Alamofire
            VoiceAPI.voiceReceiptsGet { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                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("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/voice/{message_id}/cancel:
    put:
      summary: Cancel Voice Message
      operationId: cancel-voice-message
      description: >-
        _Update voice message status as cancelled_


        ### Parameters


        | Parameter | In | Type | Required | Description |

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

        | message_id | path | string | true | Your voice message id |



        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
              example: ''
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/x-www-form-urlencoded
        - name: message_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cancel-voice-message'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

            'https://rest.clicksend.com/v3/voice/{message_id}/cancel'
        - 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\VoiceApi(new
            GuzzleHttp\Client(),$config);

            $message_id = "message_id_example"; // string | Your voice message
            id


            try {
                $result = $apiInstance->voiceCancelByMessageIdPut($message_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling VoiceApi->voiceCancelByMessageIdPut: ', $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 voiceApi = new VoiceApi(configuration);
            var response = voiceApi.VoiceCancelByMessageIdPut("MESSAGE_ID");
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.VoiceApi;

            public class cancel_voice_message {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                VoiceApi apiInstance = new VoiceApi(defaultClient);
                // String | Your voice message id
                String messageId = "4FEEA69D-4903-4E03-90BF-BCFB5EBC6BB5"; 
                try {
                    String result = apiInstance.voiceCancelByMessageIdPut(messageId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling VoiceApi#voiceCancelByMessageIdPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME",
            "API_KEY");


            var messageId = "message_id";


            voiceDeliveryReceiptApi.voiceCancelByMessageIdPut(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::VoiceApi.new


            message_id = "AEABF1AE-A8F7-471B-BA59-256FFC186D81" # String | Your
            voice message id


            begin
              # Update voice message status as cancelled
              result = api_instance.voice_cancel_by_message_id_put(message_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling VoiceApi->voice_cancel_by_message_id_put: #{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.VoiceApi(clicksend_client.ApiClient(configuration))

            message_id = 'B8AEB637-1BE6-47C5-9B6B-584A0EE7F415' # str | Your
            voice message id


            try:
                # Update voice message status as cancelled
                api_response = api_instance.voice_cancel_by_message_id_put(message_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling VoiceApi->voice_cancel_by_message_id_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::VoiceApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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

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


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

            #import "CSVoiceApi.h


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];

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


            VoiceAPI.voiceCancelByMessageIdPut(messageId: "message_id") {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                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("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/voice/cancel-all:
    put:
      summary: Cancel All Voice Messages
      operationId: cancel-all-voice-messages
      description: >-
        _Update all voice messages as cancelled_


        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
              example: ''
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/x-www-form-urlencoded
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cancel-all-voice-messages'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

            'https://rest.clicksend.com/v3/voice/cancel-all'
        - 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\VoiceApi(new
            GuzzleHttp\Client(),$config);


            try {
                $result = $apiInstance->voiceCancelAllPut();
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling VoiceApi->voiceCancelAllPut: ', $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 voiceApi = new VoiceApi(configuration);
            var response = voiceApi.VoiceCancelAllPut();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.VoiceApi;

            public class cancel_all_voice_msg {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                VoiceApi apiInstance = new VoiceApi(defaultClient);
                try {
                    String result = apiInstance.voiceCancelAllPut();
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling VoiceApi#voiceCancelAllPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME",
            "API_KEY");


            voiceDeliveryReceiptApi.voiceCancelAllPut().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::VoiceApi.new

            begin
              # Update all voice messages as cancelled
              result = api_instance.voice_cancel_all_put
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling VoiceApi->voice_cancel_all_put: #{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.VoiceApi(clicksend_client.ApiClient(configuration))


            try:
                # Update all voice messages as cancelled
                api_response = api_instance.voice_cancel_all_put()
                print(api_response)
            except ApiException as e:
                print("Exception when calling VoiceApi->voice_cancel_all_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::VoiceApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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

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


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

            #import "CSVoiceApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];

            [voiceAPI voiceCancelAllPutWithCompletionHandler:^(NSString *output,
            NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: |-
            import Alamofire

            VoiceAPI.voiceCancelAllPut { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                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("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/voice/history:
    get:
      summary: Get Voice History
      operationId: get-voice-history
      description: >-
        _Get all voice 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) |

        | 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.



        <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: date_to
          in: query
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
          example: '20'
        - name: operator
          in: query
          schema:
            type: string
          example: AND
        - name: order_by
          in: query
          schema:
            type: string
          example: date_added:desc
        - name: page
          in: query
          schema:
            type: integer
          example: '1'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-voice-history'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/voice/history?date_from=&date_to='
        - 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\VoiceApi(new
            GuzzleHttp\Client(),$config);

            $date_from = '2018-01-01'; // int | Timestamp (from) used to show
            records by date.

            $date_to = '2019-01-01'; // int | Timestamp (to) used to show
            records by date

            $page = 1; // int | Page number

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


            try {
                $result = $apiInstance->voiceHistoryGet($date_from, $date_to, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling VoiceApi->voiceHistoryGet: ', $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 voiceApi = new VoiceApi(configuration);
            var response = voiceApi.VoiceHistoryGet();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.VoiceApi;

            public class view_voice_history {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                VoiceApi apiInstance = new VoiceApi(defaultClient);
                Integer dateFrom = 56; // Integer | Timestamp (from) used to show records by date.
                Integer dateTo = 56; // Integer | Timestamp (to) used to show records by date
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.voiceHistoryGet(dateFrom, dateTo, page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling VoiceApi#voiceHistoryGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME",
            "API_KEY");


            var dateFrom = '2018-01-01';

            var dateTo = '2018-12-31';

            var page = 1;

            var limit = 10;


            voiceDeliveryReceiptApi.voiceHistoryGet(dateFrom, dateTo ,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::VoiceApi.new

            opts = {
              date_from: 56, # Integer | Timestamp (from) used to show records by date.
              date_to: 56,   # Integer | Timestamp (to) used to show records by date
              page: 1,       # Integer | Page number
              limit: 10      # Integer | Number of records per page
            }

            begin
              # Get all voice history
              result = api_instance.voice_history_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling VoiceApi->voice_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.VoiceApi(clicksend_client.ApiClient(configuration))

            date_from = 56 # int | Timestamp (from) used to show records by
            date. (optional)

            date_to = 56 # int | Timestamp (to) used to show records by date
            (optional)

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

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


            try:
                # Get all voice history
                api_response = api_instance.voice_history_get(date_from=date_from, date_to=date_to, page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling VoiceApi->voice_history_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::VoiceApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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

            my $json_output = $api->voice_history_get('date_from' =>
            'filename','date_to'  => '','page'  => '','limit' => '');


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

            #import "CSVoiceApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];



            NSNumber *dateFromNum = [NSNumber numberWithInt:123145123];

            NSNumber *dateToNum = [NSNumber numberWithInt:12313332];

            NSNumber *page = [NSNumber numberWithInt:1];

            NSNumber *limit = [NSNumber numberWithInt:15];


            CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];

            [voiceAPI voiceHistoryGetWithDateFrom:dateFromNum dateTo:dateToNum
            page:page limit:limit completionHandler:^(NSString *output, NSError
            *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: |-
            import Alamofire

            VoiceAPI.voiceHistoryGet { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                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("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/voice/history/export:
    get:
      summary: Export Voice History
      operationId: export-voice-history
      description: >-
        _Export voice history_


        ### Parameters


        | Parameter | In | Type | Required | Description |

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

        | filename | query | string | true | Filename to export 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>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: filename
          in: query
          schema:
            type: string
          example: Voice_history.csv
        - name: q
          in: query
          schema:
            type: string
        - name: order_by
          in: query
          schema:
            type: string
          example: date_added:desc
        - name: date_from
          in: query
          schema:
            type: string
        - name: date_to
          in: query
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
          example: '50000'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/export-voice-history'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/voice/history/export?filename={filename}'
        - 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\VoiceApi(new
            GuzzleHttp\Client(),$config);

            $filename = "filename_example"; // string | Filename to export to


            try {
                $result = $apiInstance->voiceHistoryExportGet($filename);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling VoiceApi->voiceHistoryExportGet: ', $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 voiceApi = new VoiceApi(configuration);
            var response = voiceApi.VoiceHistoryExportGet("File_Name");
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.VoiceApi;

            public class export_voice_history {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                VoiceApi apiInstance = new VoiceApi(defaultClient);
                String filename = "filename_example"; // String | Filename to export to
                try {
                    String result = apiInstance.voiceHistoryExportGet(filename);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling VoiceApi#voiceHistoryExportGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME",
            "API_KEY");


            var filename = "filename";


            voiceDeliveryReceiptApi.voiceHistoryExportGet(filename).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::VoiceApi.new

            filename = "filename_example" # String | Filename to export to

            begin
              # Export voice history
              result = api_instance.voice_history_export_get(filename)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling VoiceApi->voice_history_export_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.VoiceApi(clicksend_client.ApiClient(configuration))

            filename = 'voice_history' # str | Filename to export to


            try:
                # Export voice history
                api_response = api_instance.voice_history_export_get(filename)
                print(api_response)
            except ApiException as e:
                print("Exception when calling VoiceApi->voice_history_export_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::VoiceApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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

            my $json_output = $api->voice_history_export_get('filename' =>
            'filename');


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

            #import "CSVoiceApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];

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


            VoiceAPI.voiceHistoryExportGet(filename: "file_name") { (dataString,
            error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                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("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
