openapi: 3.0.0
info:
  title: SMS
  description: >-
    You can use the SMS endpoints to send and manage SMS, check the cost of
    sending SMS, view message history, and more. Integrate them into your system
    as part of your workflow.


    Relevant guides: <a
    href="https://help.clicksend.com/article/h474eseq3a-how-many-characters-can-i-send-in-an-sms"
    target="_blank">How many characters can I send in an SMS?</a>, <a
    href="https://help.clicksend.com/article/1hd33n2xns-sms-status-delivery-receipt-expired"
    target="_blank">SMS status delivery receipt expired</a>, <a
    href="https://help.clicksend.com/article/mueq678bcy-do-you-support-non-english-characters"
    target="_blank">Do you support non-English characters</a>, and <a
    href="https://help.clicksend.com/category/mfdctha7f0-country-specific-features-and-restrictions"
    target="_blank">Country Specific Features and Restrictions</a>.

    <div class="info-box">
      <h4><i class="fas fa-info-circle"></i> Note :</h4>
      ClickSend is pausing SMS messages containing URLs for new customers. Please remove links from messages to maintain uninterrupted delivery, or <a href="https://www.clicksend.com/gb/help/" target="_blank">contact support</a> to apply for approval for URL messaging.
    </div>
servers:
  - url: https://rest.clicksend.com
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    senders:
      type: array
      description: >
        The `senders` property specifies sender IDs for each recipient country.

        - **Want to leverage the default sender settings:**
          - If the `senders` property is missing or left empty, the system uses the default sender settings configured for each recipient country.

        - **Want to override the default sender settings:**
          - When the `senders` property is provided, it should contain valid sender IDs for each recipient country listed under recipients. These IDs will override the default sender settings for the specified countries.
          - If an invalid sender ID is provided, or a sender ID for a specific recipient country is missing, the system will revert to using the default sender settings for that country.

        <div class="info-box">

        The <strong>senders</strong> parameter is currently in beta and
        available only to beta testing users. 

        <p><strong>Join the BETA Program:</strong></p>

        <p>Early access to Smart Assign is available. <a
        href="https://www.clicksend.com/gb/help/"><strong>Contact the sales
        team</strong></a> to opt-in and participate in the BETA program.</p>

        </div>
      items:
        type: object
        required:
          - recipient_country_code
        properties:
          recipient_country_code:
            type: string
            description: Recipient ISO country code
          sender_id:
            type: string
            description: >
              The sender ID must be either an alpha tag or a phone number. It is
              a required field unless the sender type is a `shared_longcode`. 


              If the sender ID is an **alpha tag**, it must be between 3 and 11
              characters long and contains only letters, numbers, and pluses.
          sender_type:
            type: string
            description: >-
              The type of sender ID, it only supports `shared_longcode` at the
              moment.
            enum:
              - shared_longcode
          sender_country_code:
            type: string
            description: >
              The ISO 3166-1 alpha-2 country code that identifies the country
              associated with the sender’s number in a shared pool.

              This is affected only when `sender_type` is set to
              `shared_longcode` to determine the appropriate number based on the
              sender’s geographic location.

              If this field is not provided or left empty, it will default to
              the recipient's country code.
    shorten_urls:
      type: boolean
      description: >
        This controls whether URLs are automatically shortened. This affects all
        messages in the request. You can either specify:


        - **True** - Automatically detects and shortens one URL on each message.

        - **False** - Leaves all URLs in their original form. This is the
        default value.


        You will be able to retrieve the open rates and statistics for the link
        from this <a
        href="/messaging/url-shortening/other/short-url-get-statistics">link</a>.


        More info about shortening URLs <a href="/messaging/url-shortening/">
        here</a>.
    sms_send_sms:
      type: object
      properties:
        direction:
          type: string
          description: >-
            It can either be **in** or **out**:


            - **in** - You received a message. it has to do with inbound
            messages.
                
            - **out** \- You are sending a message. It has to do with outbound
            messages.
          example: in
        date:
          type: integer
          description: >-
            The date you sent the message. It is in <a
            href="http://help.clicksend.com/what-is-a-unix-timestamp"
            target="_blank">Unix format</a>.
          example: 1436871253
        to:
          type: string
          description: >-
            The phone number of the recipient. It should be in <a
            href="https://en.wikipedia.org/wiki/E.164" target="_blank">E.164
            format</a>.
          example: '+61411111111'
        body:
          type: string
          description: >-
            The message sent. The price of sending a message depends on the
            number of characters and the type of message. There are two types:


            - Standard message - Contains only characters in the <a
            href="https://en.wikipedia.org/wiki/GSM_03.38"
            target="_blank">GSM</a> set, with a maximum of 160 characters.
                
            - Unicode message - Contains characters outside the <a
            href="https://en.wikipedia.org/wiki/GSM_03.38"
            target="_blank">GSM</a> set, with a maximum of 70 characters.
                

            Longer messages will be sent as multiple messages (parts), but the
            recipient will receive them as a single long message. Visit <a
            href="https://help.clicksend.com/article/h474eseq3a-how-many-characters-can-i-send-in-an-sms"
            target="_blank">this page</a> to learn more about the number of
            characters per message, and <a href="http://smscharactercount.com/"
            target="_blank">this page</a> to count the number of characters.
          example: Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.
        from:
          type: string
          description: >-
            The sender of the message. This is also referred to as the **Sender
            ID**. If your **Sender ID** has a different country code to the
            recipient’s, it'll be replaced by a local number, except in <a
            href="https://help.clicksend.com/category/mfdctha7f0-country-specific-features-and-restrictions"
            target="_blank">certain countries</a>. If the sender number is
            blocked, a different number will replace it.
          example: sendmobile
        schedule:
          type: integer
          description: >-
            The scheduled date of the message. It is in <a
            href="http://help.clicksend.com/what-is-a-unix-timestamp"
            target="_blank">Unix format</a>.
          example: 1436874701
        message_id:
          type: string
          description: >-
            The generated ID of the message. This ID is typically used as a
            reference for <a href="https://www.clicksend.com/au/help/"
            target="_blank">customer support</a> in case of any issues.
          example: BF7AD270-0DE2-418B-B606-71D527D9C1AE
        message_parts:
          type: integer
          description: >-
            The number of parts the message was broken into. To look at how many
            parts your message is broken down into, use the **<a
            href="http://smscharactercount.com/">SMS Character Count</a>**.
          example: 1
        message_price:
          type: number
          description: >-
            The price of this message. This depends on the total number of parts
            of the message.
          example: 0.07
        from_email:
          type: string
          description: >-
            The email address to which replies should be emailed to. If omitted,
            the reply will be emailed back to the user who sent the outgoing
            SMS.
          example: john@example.com
        list_id:
          type: string
          description: >-
            The _list_id_ of the contact list the message was sent to. This
            parameter will have a **null** value if you didn’t send to a list in
            the request.
          example: 1
        custom_string:
          type: string
          description: A note that was sent from the request.
          example: this is a test
        contact_id:
          type: string
          description: >-
            This is the ID of the contact. This parameter will have a **null**
            value if you didn’t provide a _contact_id_ in the request.
          example: 52649412
        user_id:
          type: integer
          description: The unique user ID of the sender.
          example: 1
        subaccount_id:
          type: integer
          description: This sub-account of the user. A user can have multiple sub-accounts.
          example: 1
        is_shared_system_number:
          type: boolean
          description: >-
            Indicates whether you use a shared number to send a message:


            - **True** \- if the sender is randomly selected.
                
            - **False** \- if the sender is specified and passed the validation
            process.
          example: false
        country:
          type: string
          description: >-
            The country of the recipient in two-letter format (e.g. US, UK, AU,
            NZ, etc).
          example: AU
        carrier:
          type: string
          description: The phone carrier of the recipient.
          example: Telstra
        status:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#application-status-codes) for more information. This
            reflects the actual status of the individual 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-sms:
      type: object
      properties:
        http_code:
          type: string
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.


            This parameter doesn’t reflect the status of each message. Check the
            status parameter of the message object to view the status of the
            individual message.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Messages queued for delivery.
        data:
          type: object
          description: The parameters related to messages.
          properties:
            total_price:
              type: number
              example: 0.0792
              description: >-
                The total price of sending the messages. Visit [this
                page](/#status-codes) for more information.
            total_count:
              type: integer
              example: 1
              description: The total number of messages sent from the request.
            queued_count:
              type: integer
              example: 1
              description: >-
                The messages will be put in a queue if it goes through the
                validation process. The validation process checks whether the
                **Sender ID** is registered or not. Some countries don't require
                messages to go through the validation process.


                Messages scheduled to be sent right away will be sent
                immediately. If not, it will be queued.
            messages:
              type: array
              description: The parameters related to messages.
              items:
                $ref: '#/components/schemas/sms_send_sms'
              example:
                - direction: out
                  date: 1721099039,
                  to: '+61411111111'
                  body: test message
                  from: '+61431111112'
                  schedule: 1721099039
                  message_id: 1ABC3200-C38C-6308-BE4B-C7C51D01DCF0
                  message_parts: 1
                  message_price: 0.0792
                  from_email: null
                  list_id: null
                  custom_string: ''
                  contact_id: null
                  user_id: 123456
                  subaccount_id: 123456
                  is_shared_system_number: false
                  country: AU
                  carrier: Vodafone
                  status: SUCCESS
            _currency:
              $ref: '#/components/schemas/currency'
            blocked_count:
              type: integer
              description: >-
                The number of messages unable to be sent. This is often caused
                by:


                - Receipient’s country not enabled for <a
                href="https://help.clicksend.com/article/qdavyt16qs-global-sending">global
                sending</a>.
                    
                - **Sender ID** resitriction.
                    
                - Number registration restrcition.
              example: 0
    sms:
      type: object
      properties:
        date:
          type: integer
          description: >-
            The date you sent the message. It is in <a
            href="http://help.clicksend.com/what-is-a-unix-timestamp"
            target="_blank">Unix format</a>.
          example: 1436871253
        to:
          type: string
          description: >-
            The phone number of the recipient. It should be in <a
            href="https://en.wikipedia.org/wiki/E.164" target="_blank">E.164
            format</a>.
          example: '+61411111111'
        body:
          type: string
          description: >-
            The message sent. The price of sending a message depends on the
            number of characters and the type of message. There are two types:


            - Standard message - Contains only characters in the <a
            href="https://en.wikipedia.org/wiki/GSM_03.38"
            target="_blank">GSM</a> set, with a maximum of 160 characters.
                
            - Unicode message - Contains characters outside the <a
            href="https://en.wikipedia.org/wiki/GSM_03.38"
            target="_blank">GSM</a> set, with a maximum of 70 characters.
                

            Longer messages will be sent as multiple messages (parts), but the
            recipient will receive them as a single long message. Visit <a
            href="https://help.clicksend.com/article/h474eseq3a-how-many-characters-can-i-send-in-an-sms"
            target="_blank">this page</a> to learn more about the number of
            characters per message, and <a href="http://smscharactercount.com/"
            target="_blank">this page</a> to count the number of characters.
          example: Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.
        from:
          type: string
          description: >-
            The sender of the message. This is also referred to as the **Sender
            ID**. If your **Sender ID** has a different country code to the
            recipient’s, it'll be replaced by a local number, except in <a
            href="https://help.clicksend.com/category/mfdctha7f0-country-specific-features-and-restrictions"
            target="_blank">certain countries</a>. If the sender number is
            blocked, a different number will replace it.
          example: sendmobile
        schedule:
          type: integer
          description: >-
            The scheduled date of the message. It is in <a
            href="http://help.clicksend.com/what-is-a-unix-timestamp"
            target="_blank">Unix format</a>.
          example: 1436874701
        message_id:
          type: string
          description: >-
            The generated ID of the message. This ID is typically used as a
            reference for <a href="https://www.clicksend.com/au/help/"
            target="_blank">customer support</a> in case of any issues.
          example: BF7AD270-0DE2-418B-B606-71D527D9C1AE
        message_parts:
          type: integer
          description: >-
            The number of parts the message was broken into. To look at how many
            parts your message is broken down into, use the **<a
            href="http://smscharactercount.com/">SMS Character Count</a>**.
          example: 1
        message_price:
          type: number
          description: >-
            The price of this message. This depends on the total number of parts
            of the message.
          example: 0.07
        custom_string:
          type: string
          description: A note that was sent from the request.
          example: this is a test
        contact_id:
          type: string
          description: >-
            This is the ID of the contact. This parameter will have a **null**
            value if you didn’t provide a _contact_id_ in the request.
          example: 52649412
        is_shared_system_number:
          type: boolean
          description: >-
            Indicates whether you use a shared number to send a message:


            - **True** \- if the sender is randomly selected.
                
            - **False** \- if the sender is specified and passed the validation
            process.
          example: false
        country:
          type: string
          description: >-
            The country of the recipient in two-letter format (e.g. US, UK, AU,
            NZ, etc).
          example: AU
        status:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#application-status-codes) for more information. This
            reflects the actual status of the individual message.
          example: SUCCESS
    calculate-sms-price:
      type: object
      properties:
        http_code:
          type: string
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.


            This parameter doesn’t reflect the status of each message. Check the
            status parameter of the message object to view the status of the
            individual message.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your data.
        data:
          type: object
          description: The parameters related to the messages price.
          properties:
            total_price:
              type: number
              example: 0.2264
              description: >-
                The total price of sending the messages. Visit [this
                page](/#status-codes) for more information.
            total_count:
              type: integer
              example: 1
              description: The total number of messages sent from the request.
            queued_count:
              type: integer
              example: 1
              description: >-
                The messages will be put in a queue if it goes through the
                validation process. The validation process checks whether the
                **Sender ID** is registered or not. Some countries don't require
                messages to go through the validation process.


                Messages scheduled to be sent right away will be sent
                immediately. If not, it will be queued.
            messages:
              type: array
              description: The parameters related to messages.
              items:
                $ref: '#/components/schemas/sms'
            currency:
              $ref: '#/components/schemas/currency'
            _summary:
              type: object
              description: >-
                The parameters for additional summary. It shows the guidelines
                for each country you have selected.
              properties:
                test_message:
                  type: string
                  description: >-
                    This parameter is used for internal developers. This is used
                    when your account is in trial period.
                countries:
                  type: array
                  description: >-
                    The list of countries of the receipients in two-letter
                    format (e.g. US, UK, AU, NZ, etc).
                  items:
                    type: object
                    properties:
                      country:
                        type: object
                        description: >-
                          The country of the receipient in two-letter format
                          (e.g. US, UK, AU, NZ, etc).
                        properties:
                          registration_type:
                            type: integer
                            description: >-
                              The global sending requirement for this country.
                              It can be one of the following:


                              - **0:** No number or account registration
                              required.
                                  
                              - **1:** Number registration required. You can
                              purchase a registered number from ClickSend.
                              Examples: US and CA.
                                  
                              - **2:** Account registration required. You can
                              register your company details or business details
                              to register your account. Examples: NZ, SG and
                              UAE.


                              <div class="info-box">
                                <h4><i class="fas fa-info-circle"></i> Note:</h4>
                                <p>This parameter is fixed and can't be changed based on your settings.</p>
                              </div>
                          receipient_count:
                            type: integer
                            description: >-
                              The number of messages you are sending to this
                              country. The system can count up to 1000 messages.
                          usable_sender_id:
                            type: boolean
                            description: >-
                              Indicates whether you have a usable ***Sender ID**
                              for this country:


                              - **True:** A **Sender ID** is available for you
                              to use.
                                  
                              - **False:** No **Sender ID** is available for you
                              to use.


                              <div class="info-box">
                                  <h4><i class="fas fa-info-circle"></i> Note:</h4>
                                  <p>Countries with <em>registration_type</em> set to <strong>0</strong> will have the <em>usable_sender_id</em> set as <strong>True</strong>, and messages will be sent from shared numbers.</p>
                              </div>
                          selected:
                            type: boolean
                            description: >-
                              Indicates whether you have enabled the global
                              sending for this country:


                              - **True:** You have selected this country for
                              global sending and can send messages here.
                                  
                              - **False:** You haven’t selected this country for
                              global sending and can’t send messages here.
                          name:
                            type: string
                            description: The name of the country.
                          regulation:
                            type: object
                            description: >-
                              The parameters related to the country guidelines
                              on the user level.
                            properties:
                              country_user_id:
                                type: integer
                                description: Your identifier for the country regulation.
                              sms_registration_type:
                                type: integer
                                description: >-
                                  The global sending requirement for this
                                  country. It can be one of the following:


                                  - **0:** No number or account registration
                                  required.
                                      
                                  - **1:** Number registration required. You can
                                  purchase a registered number from ClickSend.
                                  Examples: US and CA.
                                      
                                  - **2:** Account registration required. You
                                  can register your company details or business
                                  details to register your account. Examples:
                                  NZ, SG and UAE.


                                  This parameter is a duplicate of
                                  registration_type.


                                  <div class="info-box">
                                    <h4><i class="fas fa-info-circle"></i> Note:</h4>
                                    <p>This parameter is fixed and can't be changed based on your settings.</p>
                                  </div>
                              restricted_sending:
                                type: boolean
                                description: >-
                                  Indicates whether you have any restriction for
                                  sending the message to this country:


                                  - **True:** You're restricted from sending
                                  messages to this country, possibly due to not
                                  having a registered number.
                                      
                                  - **False:** You're not restricted from
                                  sending messages to this country.
                              trial_sending:
                                type: boolean
                                description: >-
                                  Indicates whether the country supports trial
                                  sending or not:


                                  - **True:** This country supports trial
                                  sending
                                      
                                  - **False:** This country doesn’t support
                                  trial sending


                                  Countries with restricted sending typically
                                  offers trial sending. With trial sending, you
                                  can send messages to the country without
                                  registering your number or account.


                                  <div class="info-box">
                                    <h4><i class="fas fa-info-circle"></i> Note:</h4>
                                    <p>Trial sending has limitations, such as a daily limit of 200 messages in some countries. The limitations vary by country. <br/><br/> This parameter is fixed and can't be changed based on your settings.</p>
                                  </div>
                              regulation_requirements_description:
                                type: string
                                description: >-
                                  The text description of the regulatory
                                  requirements.
                              created_at:
                                type: object
                                description: >-
                                  The parameters related to the time of your
                                  request.
                                properties:
                                  date:
                                    type: string
                                    format: date-time
                                    description: >-
                                      The time you made the request. It will be
                                      in <a
                                      href="https://en.wikipedia.org/wiki/ISO_8601"
                                      target="_blank">ISO 8601</a> format.
                                  timezone_type:
                                    type: integer
                                    description: >-
                                      The offset value from the time you made
                                      the request.
                                  timezone:
                                    type: string
                                    description: The timezone when you made the request.
                              updated_at:
                                type: object
                                description: >-
                                  The parameters related to when a regulation
                                  parameter value was changed.
                                properties:
                                  date:
                                    type: string
                                    format: date-time
                                    description: >-
                                      The time a parameter was changed. It will
                                      be in <a
                                      href="https://en.wikipedia.org/wiki/ISO_8601"
                                      target="_blank">ISO 8601</a> format.
                                  timezone_type:
                                    type: integer
                                    description: >-
                                      The offset value from the time a parameter
                                      was changed.
                                  timezone:
                                    type: string
                                    description: The timezone when a parameter was changed.
                          registration_status_id:
                            type: integer
                            description: >-
                              Your current registration status for this country.
                              This parameter is used by the internal team to
                              track the status of your registration.
                          registration_entity_id:
                            type: integer
                            description: >-
                              The global sending requirement for this country.
                              It can be one of the following:


                              - **0:** No number or account registration
                              required.
                                  
                              - **1:** Number registration required. You can
                              purchase a registered number from ClickSend.
                              Examples: US and CA.
                                  
                              - **2:** Account registration required. You can
                              register your company details or business details
                              to register your account. Examples: NZ, SG and
                              UAE.
                                
                              This parameter is a duplicate of
                              registration_type. It determines which form you
                              need for the global sending registration process.


                              <div class="info-box">
                                <h4><i class="fas fa-info-circle"></i> Note:</h4>
                                <p>This parameter is static. Its value can’t change based on your settings.</p>
                              </div>
                          jotform_id:
                            type: integer
                            description: >-
                              The Jotform identifier for your account. It’s used
                              to track the global sending registration form. If
                              it is **null**, no Jotform is assigned to you. It
                              is used only for number and account registration.
            blocked_count:
              type: integer
              description: >-
                The number of messages unable to be sent. This is often caused
                by:


                - Receipient’s country not enabled for global sending.
                    
                - Sender ID resitriction.
                    
                - Number registration restrcition.
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Here is some pricing.
        data:
          total_price: 0.079
          total_count: 1
          queued_count: 1
          messages:
            - to: '+123456789'
              body: string
              from: '+123456788'
              schedule: ''
              message_id: 1EF50711-2787-68F4-8223-9F9C4393E380
              message_parts: 1
              message_price: '0.0792'
              custom_string: string
              is_shared_system_number: false
              country: AU
              status: SUCCESS
          _currency:
            currency_name_short: AUD
            currency_prefix_d: $
            currency_prefix_c: c
            currency_name_long: Australian Dollars
          _summary:
            test_message: >-
              This is a test message from None. We are trialing business text
              messaging.🚀


              www.example.com
            countries:
              AU:
                registration_type: 0
                recipient_count: 1
                usable_sender_id: true
                selected: true
                name: Australia
                regulation:
                  country_user_id: 1234567
                  sms_registration_type: 0
                  restricted_sending: false
                  trial_sending: 0
                  regulation_requirements_description: >
                    For sending to Australia, you must generally comply with the
                    following:

                     • No gambling or betting messages
                     • No cryptocurrency messages
                     • No messages relating to drugs, cannabis or CBD
                     • No adult content, including personal ads, or messages related to sex work or prostitution
                     • No personal messaging (commercial/business messaging only)
                  created_at:
                    date: '2024-03-14 18:12:22.000000'
                    timezone_type: 3
                    timezone: UTC
                  updated_at:
                    date: '2024-03-14 18:12:22.000000'
                    timezone_type: 3
                    timezone: UTC
          blocked_count: 0
    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
    sms_receipt:
      type: object
      properties:
        timestamp_send:
          type: integer
          description: >-
            The time you sent the test message. It’s in the <a target="_blank"
            href="http://help.clicksend.com/what-is-a-unix-timestamp">Unix
            format</a>.
          example: 1442381791
        timestamp:
          type: integer
          description: >-
            The time you receive the test message receipt. It’s in the <a
            target="_blank"
            href="http://help.clicksend.com/what-is-a-unix-timestamp">Unix
            format</a>.
          example: 1442381791
        message_id:
          type: string
          description: >-
            The generated ID of the message. This ID is typically used as a
            reference for <a target="_blank"
            href="https://www.clicksend.com/au/help/">customer support</a> in
            case of any issues.
          example: 31BC271B-1E0C-45F6-9E7E-97186C46BB82
        status_code:
          type: integer
          description: >-
            The status code sent from the <a target="_blank"
            href="https://en.wikipedia.org/wiki/SMS_gateway">SMS gateway</a>.
            Visit <a
            href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes">this
            page</a> for more information.
          example: 201
        status_text:
          type: string
          description: >-
            A message describing the status_code of the operation. Visit <a
            href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes">this
            page</a> for more information.
          example: 'Success: Message received on handset.'
        error_code:
          type: integer
          nullable: true
          description: >-
            The error code of the operation. Visit <a
            href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes">this
            page</a> for more information. If no error occurred, the value is
            **null**.
          example: null
        error_text:
          type: string
          nullable: true
          description: >-
            A message describing the _error_code_ of the operation. Visit <a
            href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes">this
            page</a> for more information. If no error occurred, the value is
            **null**.
          example: null
        custom_string:
          type: string
          nullable: true
          description: >-
            A note that was included with the outgoing SMS. If no note was
            included, the value is **null**.
          example: null
        subaccount_id:
          type: integer
          description: The sub-account of the user. A user can have multiple sub-accounts.
        message_type:
          type: string
          description: The type of message (e.g. SMS, MMS, etc).
          example: sms
        digits:
          type: integer
          description: >-
            The numbers that the recipient pressed on their keypad during the
            call. A **null** value is returned if the recipient didn't provide
            any input.


            <div class="info-box">
              <h4><i class="fas fa-info-circle"></i> Note:</h4>
              <p>This parameter is only relevant to <a target="_blank" href="/messaging/voice-messaging/"><strong>Voice Messaging</strong></a> receipts.</p>
            </div>
    view-sms-receipts:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.


            This parameter doesn’t reflect the status of each message. Check the
            _status_ parameter of the message object to view the status of the
            individual message.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your delivery receipts.
        data:
          type: object
          description: >-
            The parameters related to the total message receipts shown. The
            response will depend on the pagination parameters, specified in the
            query parameters.
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  description: The parameters related to the actual message receipts.
                  items:
                    $ref: '#/components/schemas/sms_receipt'
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Here are your delivery receipts.
        data:
          total: 1
          per_page: 16
          current_page: 1
          last_page: 1
          next_page_url: null
          prev_page_url: null
          from: 1
          to: 1
          data:
            - timestamp_send: 1722565661
              timestamp: 1722565661
              message_id: D6D16B28-46AC-484A-AB0A-A08CD08EF75C
              status_code: '201'
              status_text: 'Success: Message received on handset.'
              error_code: null
              error_text: null
              custom_string: null
              subaccount_id: 123456
              message_type: sms
              digits: null
    create-test-sms-receipt:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.


            This parameter doesn’t reflect the status of each message. Check the
            _status_ parameter of the message object to view the status of the
            individual message.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Receipt has been added
        data:
          type: object
          description: The parameters related to the message receipt.
          properties:
            timestamp_send:
              type: integer
              description: >-
                The time you sent the test message. It is in <a target="_blank"
                href="http://help.clicksend.com/what-is-a-unix-timestamp">Unix
                format.</a>
              example: 1722565411
            timestamp:
              type: integer
              description: >-
                The time you receive the test message receipt. It is in <a
                target="_blank"
                href="http://help.clicksend.com/what-is-a-unix-timestamp">Unix
                format.</a>
              example: 1722565411
            message_id:
              type: string
              description: >-
                The generated ID of the message. This ID is typically used as a
                reference for <a target="_blank"
                href="https://www.clicksend.com/au/help/">customer support</a>
                in case of any issues.


                <div class="info-box">
                  <h4><i class="fas fa-info-circle"></i> Note:</h4>
                  <p>This <em>message_id</em> is different from the ID that is generated when sending or receving an actual SMS. This ID is used for testing only.</p>
                </div>
              example: 2336751A-BBBE-4887-9D7C-CB7558F00208
            status_code:
              type: integer
              description: >-
                The status code that is sent from the <a target="_blank"
                href="https://en.wikipedia.org/wiki/SMS_gateway">SMS
                gateway.</a> Visit <a target="_blank"
                href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes">this
                page</a> for more information.
              example: '201'
            status_text:
              type: string
              description: >-
                A message describing the _status_code_ of the operation. Visit
                <a target="_blank"
                href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes">this</a>
                page for more information.
              example: 'Success: Message received on handset.'
            error_code:
              type: integer
              description: >-
                The error code of the operation. Visit <a target="_blank"
                href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes">this
                page</a> for more information. If no error occurred, the value
                is **null**.
              nullable: true
              example: null
            error_text:
              type: string
              description: >-
                A message describing the _error_code_ of the operation. Visit <a
                target="_blank"
                href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes">this
                page</a> for more information. If no error occurred, the value
                is **null**.
              nullable: true
              example: null
            custom_string:
              type: string
              description: |-
                A note that was sent from the request.

                <div class="warning-box">
                  <h4><i class="fas fa-exclamation-triangle"></i> Warning:</h4>
                  <p>This parameter is deprecated and will return <strong>null.</strong></p>
                </div>
              example: null
              nullable: true
            subaccount_id:
              type: integer
              description: >-
                The sub-account of the user. A user can have multiple
                sub-accounts.
              example: 563840
            message_type:
              type: string
              description: The type of message (e.g. SMS, MMS, etc).
              example: sms
            digits:
              type: integer
              description: >-
                The numbers that the recipient pressed on their keypad during
                the call. A **null** value is returned if the recipient didn't
                provide any input.


                <div class="info-box">
                  <h4><i class="fas fa-info-circle"></i> Note:</h4>
                  <p>This parameter is only relevant to <a href="/messaging/voice-messaging/"><strong>Voice Messaging</strong></a> receipts.</p>
                </div>
              nullable: true
              example: null
    view-specific-sms-receipt:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.


            This parameter doesn’t reflect the status of each message. Check the
            _status_ parameter of the message object to view the status of the
            individual message.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Your receipt.
        data:
          $ref: '#/components/schemas/sms_receipt'
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Your receipt.
        data:
          timestamp_send: 1722565661
          timestamp: 1722565661
          message_id: D6D16B28-46AC-484A-AB0A-A08CD08EF75C
          status_code: '201'
          status_text: 'Success: Message received on handset.'
          error_code: null
          error_text: null
          custom_string: null
          subaccount_id: 123456
          message_type: sms
          digits: null
    mark-sms-receipt-as-read:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Receipts have been marked as read.
        data:
          type: object
          description: |-
            The parameters related to the SMS receipt.

            <div class="warning-box">
              <h4><i class="fas fa-exclamation-triangle"></i> Warning:</h4>
              <p>This parameter is deprecated and will return <strong>null</strong/>.</p>
            </div>
          nullable: true
          example: null
    inbound_sms:
      type: object
      description: The parameters related to the message receipt.
      properties:
        timestamp:
          type: integer
          description: >-
            The time you receive the inbound message.. It’s in the <a
            href="http://help.clicksend.com/what-is-a-unix-timestamp">Unix
            format.</a>
          example: '1436174407'
        from:
          type: string
          description: >-
            The sender of the message, which is the phone number of the
            recipient who replied to you. Your recipient can’t reply to an alpha
            tag (business name).
          example: '+61411111111'
        body:
          type: string
          description: The message you received from your recipient.
          example: Liquorice sweet roll fruitcake gummies.
        original_body:
          type: string
          description: The last message you sent to your recipient.
          example: Liquorice sweet roll fruitcake gummies.
        original_message_id:
          type: string
          description: The generated ID of the message that you sent to your receipient.
          example: C557B56E-83C0-4070-A74C-9BF05474B418
        to:
          type: string
          description: >-
            The receiver of the inbound message, which can be either the shared
            number or the dedicated number you used to send the message.
          example: '+61422222222'
        custom_string:
          type: string
          description: >-
            A note that was included with the inbound SMS. If no note was
            included, the value will be an empty string.
          example: 22PKU978RF
        message_id:
          type: string
          description: >-
            The generated ID of the inbound SMS. This ID is typically used as a
            reference for <a href="https://www.clicksend.com/au/help/"
            target="_blank">customer support</a> in case of any issues.
          example: C557B56E-83C0-4070-A74C-9BF05474B418
        _keyword:
          type: string
          description: |-
            The keyword of the inbound SMS.

            <div class="warning-box">
              <h4><i class="fas fa-exclamation-triangle"></i> Warning:</h4>
              <p>This parameter is deprecated and will return the first word of the body message.</p>
            </div>
          example: liquorice
    view-inbound-sms:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your data.
        data:
          allOf:
            - type: object
              description: >-
                The parameters related to the total inbound SMS shown. The
                response will depend on the pagination parameters, specified in
                the query.
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  description: The parameters related to the actual inbound SMS.
                  items:
                    $ref: '#/components/schemas/inbound_sms'
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Here are your data.
        data:
          total: 1
          per_page: 15
          current_page: 1
          last_page: 1
          next_page_url: null
          prev_page_url: null
          from: 1
          to: 15
          data:
            - timestamp_send: 1722997250
              from: '+61123456789'
              body: reply to msg on 7 aug 2024
              original_body: test msg
              original_message_id: 1EF54639-F16D-681E-947A-4F4FCDFD2B87
              to: '+61113456789'
              custom_string: ''
              message_id: D2F2BCC3-6558-4DAA-858E-AD7529CC809C
              _keyword: reply
    inbound_sms_test:
      type: object
      description: The parameters related to the message receipt.
      properties:
        timestamp_send:
          type: integer
          description: >-
            The time you sent the test message. It’s in the <a
            href="http://help.clicksend.com/what-is-a-unix-timestamp">Unix
            format.</a>
          example: '1436174407'
        from:
          type: string
          description: This is a random number used for testing purposes.
          example: '+61411111111'
        body:
          type: string
          description: The sample test message.
          example: Liquorice sweet roll fruitcake gummies.
        original_body:
          type: string
          description: The sample test message you sent to your recipient.
          example: Liquorice sweet roll fruitcake gummies.
        original_message_id:
          type: string
          description: |-
            The generated ID of the message that you sent to your receipient.

            <div class="info-box">
              <h4><i class="fas fa-info-circle"></i> Note:</h4>
              <p>This <em>original_message_id</em> is different from the ID that is generated when sending an actual SMS. This ID is used for testing only.</p>
            </div>
          example: C557B56E-83C0-4070-A74C-9BF05474B418
        to:
          type: string
          description: >-
            The receiver of the inbound message, which can be either the shared
            number or the dedicated number you used to send the message.
          example: '+61422222222'
        custom_string:
          type: string
          description: The sample test note that was included with the inbound SMS.
          example: 22PKU978RF
        message_id:
          type: string
          description: >-
            The generated ID of the inbound SMS. This ID is typically used as a
            reference for <a href="https://www.clicksend.com/au/help/"
            target="_blank">customer support</a> in case of any issues.
          example: C557B56E-83C0-4070-A74C-9BF05474B418
        _keyword:
          type: string
          description: |-
            The keyword of the inbound SMS.

            <div class="warning-box">
              <h4><i class="fas fa-exclamation-triangle"></i> Warning:</h4>
              <p>This parameter is deprecated and will return <strong>null.</strong></p>
            </div>
          example: liquorice
    create-test-inbound-sms:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your incoming messages.
        data:
          $ref: '#/components/schemas/inbound_sms_test'
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Test inbound message has been added.
        data:
          timestamp_send: 1722580202
          from: '+61487722156'
          body: This is a test incoming SMS. E8PWYYVFWK.
          original_body: This is the original message. LSGRMF3FOW.
          original_message_id: 00DD4A0B-FC0F-4FFB-9A95-4BACC477C372
          to: '+61411111111'
          custom_string: 'Test custom string '
          message_id: 7E0F75B6-8CE0-4202-B589-8BA8E5CBA661
          _keyword: this
    view-a-specific-inbound-sms-message:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your data.
        data:
          $ref: '#/components/schemas/inbound_sms'
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Here are your result.
        data:
          timestamp: 1723012981
          from: '+61426123123'
          body: test
          original_body: test
          original_message_id: 1EF54878-1137-62F4-9EAC-CBF078A1262E
          to: '+61437085284'
          custom_string: ''
          message_id: F892B812-24E3-404B-A1CB-D714BBB2B127
          _keyword: reply
    mark-inbound-sms-as-read:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Inbound messages have been marked as read.
        data:
          type: object
          nullable: true
          description: |-
            The parameters related to the inbound SMS.

            <div class="warning-box">
              <h4><i class="fas fa-exclamation-triangle"></i> Warning:</h4>
              <p>This parameter is deprecated and will return <strong>null</strong/>.</p>
            </div>
          example: null
    mark-specific-inbound-sms-message-as-read:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Receipt have been marked as read.
        data:
          type: integer
          description: >-
            The number of SMS marked as read.


            If you have multiple inbound rules set to POLL, you will receive the
            inbound message multiple times. Reading it will mark all those
            messages as read.
          example: 1
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Receipt have been marked as read.
        data: 1
    cancel-sms:
      type: object
      properties:
        http_code:
          type: string
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
        data:
          type: object
          description: |-
            The parameters related to the scheduled SMS.

            <div class="warning-box">
              <h4><i class="fas fa-exclamation-triangle"></i> Warning:</h4>
              <p>This parameter is deprecated and will return <strong>null</strong/>.</p>
            </div>
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Scheduled sms message has been cancelled.
        data: null
    cancel-all-sms:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: 2 sms messages have been cancelled.
        data:
          type: object
          description: The parameters related to the cancelled scheduled SMS.
          properties:
            count:
              type: integer
              example: 2
              description: The number of scehduled SMS cancelled.
    sms_template:
      type: object
      description: The parameters related to the actual templates.
      properties:
        template_id:
          type: integer
          description: The generated ID of the template.
          example: 1
        body:
          type: string
          description: The main content of the template.
          example: This is a sample template.
        template_name:
          type: string
          description: The name of the template.
          example: My Awesome Template
    view-sms-templates:
      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 data.
        data:
          description: >-
            The parameters related to the total message receipts shown. The
            response will depend on the pagination parameters, specified in the
            query parameters.
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  description: The parameters related to the actual templates.
                  items:
                    $ref: '#/components/schemas/sms_template'
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Here are your templates.
        data:
          - totlal: 1
            per_page: 15
            current_page: 1
            last_page: 1
            next_page_url: null
            prev_page_url: null
            from: 1
            to: 1
            data:
              - template_id: 587713
                body: this_is_a_test_template wew21
                template_name: qowiei_1920
    create-sms-template:
      type: object
      properties:
        http_code:
          type: string
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: New template has been saved.
        data:
          $ref: '#/components/schemas/sms_template'
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: New template has been saved.
        data:
          template_id: 589242
          template_name: TTemplate 501916
          body: "This is a test template.\r\nnew line 漢字 here."
    view-a-specific-sms-template:
      type: object
      properties:
        http_code:
          type: string
          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 template.
        data:
          type: object
          description: The parameters related to the template.
          properties:
            template_id:
              type: integer
              description: The generated ID of the template.
              example: 1
            template_name:
              type: string
              description: The main content of the template.
              example: Template 501916
            body:
              type: string
              description: The name of the template.
              example: "This is a test template.\r\nnew line 漢字 here."
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Here is your template.
        data:
          template_id: 587713
          template_name: Template 501916
          body: "This is a test updated template.\r\nnew line 漢字 here."
    sms_template_update:
      type: object
      description: The parameters related to the actual templates.
      properties:
        template_id:
          type: integer
          description: >-
            The generated ID of the template. This remains the same and can’t be
            updated.
          example: 1
        body:
          type: string
          description: The new updated content of the template.
          example: This is a sample template.
        template_name:
          type: string
          description: The new updated name of the template.
          example: My Awesome Template
    update-sms-template:
      type: object
      properties:
        http_code:
          type: string
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Your template has been updated.
        data:
          $ref: '#/components/schemas/sms_template_update'
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Your template has been updated.
        data:
          template_id: 587916
          template_name: Template XYZ
          body: This is a new update template
    delete-sms-template:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Your template has been deleted.
        data:
          type: array
          description: |-
            The parameters related to the SMS template.

            <div class="warning-box">
              <h4><i class="fas fa-exclamation-triangle"></i> Warning:</h4>
              <p>This parameter is deprecated and will return <strong>null</strong>.</p>
            </div>
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Your template has been deleted.
        data: null
    view-sms-history:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your data.
        data:
          description: >-
            The parameters related to the SMS history shown. The response will
            depend on the pagination parameters, specified in the query
            parameters.
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  description: The parameters related to the actual SMS.
                  type: array
                  items:
                    type: object
                    properties:
                      direction:
                        type: string
                        description: |-
                          It can either be in or out:
                            - **in** - You received a message. it has to do with inbound messages.
                            - **out** - You are sending a message. It has to do with outbound messages.
                        example: out
                      date:
                        type: integer
                        description: >-
                          The date you sent the message. It is in <a
                          href="http://help.clicksend.com/what-is-a-unix-timestamp"
                          target="_blank">Unix format</a>.
                        example: 1436932432
                      to:
                        type: string
                        description: >-
                          The phone number of the recipient. It should be in <a
                          href="https://en.wikipedia.org/wiki/E.164"
                          target="_blank">E.164 format</a>.
                        example: '+16783270696'
                      body:
                        type: string
                        description: The message sent.
                        example: >-
                          Chocolate bar icing icing oat cake carrot cake jelly
                          cotton 1iQByXxdLN.
                      status:
                        type: string
                        description: >-
                          The status of the SMS. It can either be:


                          - _Queued_

                          - _Completed_

                          - _Scheduled_

                          - _WaitApproval_

                          - _Failed_

                          - _Cancelled_

                          - _CancelledAfterReview_

                          - _Received_

                          - _Sent_


                          This parameter reflects the actual status of the SMS.
                          It is based on the 

                          status of the SMS sent from the <a
                          href="https://en.wikipedia.org/wiki/SMS_gateway"
                          target="_blank">SMS gateway</a>, which is different 

                          from the [API status
                          code](https://developers-dev.clicksend.net/docs/#status-codes).
                          Visit <a
                          href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes"
                          target="_blank">this page</a> for more information.
                        example: Completed
                      from:
                        type: string
                        description: The sender of the message.
                        example: sendlist
                      schedule:
                        type: integer
                        description: >-
                          The scheduled date of the message. It is in <a
                          href="http://help.clicksend.com/what-is-a-unix-timestamp"
                          target="_blank">Unix format</a>.
                        example: 1436879372
                      status_code:
                        type: integer
                        description: >-
                          The status code sent from the <a
                          href="https://en.wikipedia.org/wiki/SMS_gateway"
                          target="_blank">SMS gateway</a>. Visit <a
                          href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes"
                          target="_blank">this page</a> for more information.
                        example: null
                      status_text:
                        type: string
                        description: >-
                          A message describing the _status_code_ of the
                          operation. Visit <a
                          href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes"
                          target="_blank">this page</a> for more information.
                        example: null
                      error_code:
                        type: integer
                        description: >-
                          The error code of the operation. Visit <a
                          href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes"
                          target="_blank">this page</a> for more information. If
                          no error occurred, the value is **null**.
                        nullable: true
                        example: null
                      error_text:
                        type: string
                        description: >-
                          A message describing the _error_code_ of the
                          operation. Visit <a
                          href="https://help.clicksend.com/article/8cc479qlbb-list-of-sms-gateway-error-codes"
                          target="_blank">this page</a> for more information. If
                          no error occurred, the value is **null**.
                        nullable: true
                        example: null
                      message_id:
                        type: integer
                        description: The generated ID of the message.
                        example: 4E90F4C3-43A3-489D-9AB8-DA1F4332A0C3
                      message_parts:
                        type: integer
                        description: >-
                          The number of parts the message was broken into. To
                          look at how many parts your message is broken down
                          into, use the <a href="http://smscharactercount.com/"
                          target="_blank"><strong>SMS Character
                          Count</strong></a>.
                        example: '1.00'
                      message_price:
                        type: number
                        description: >-
                          The price of this message. This depends on the total
                          number of parts of the message.
                        example: '0.070000'
                      from_email:
                        type: string
                        description: >-
                          The email address to which replies should be emailed
                          to. If omitted, the reply will be emailed back to the
                          user who sent the outgoing SMS
                        example: null
                      list_id:
                        type: string
                        description: >-
                          The _list_id_ of the contact list the message was sent
                          to. This parameter will have a **null** value if you
                          didn’t send to a list in the request.
                        nullable: true
                        example: null
                      custom_string:
                        type: string
                        description: >-
                          A note that was included with the outgoing SMS. If no
                          note was included, the value is **null**.
                        example: this is a test
                      contact_id:
                        type: string
                        description: >-
                          This is the ID of the contact. This parameter will
                          have a **null** value if you didn’t provide a
                          _contact_id_ in the request.
                        example: 1
                      user_id:
                        type: integer
                        description: The unique user ID of the sender.
                        example: 1
                      subaccount_id:
                        type: integer
                        description: >-
                          The sub-account of the user. A user can have multiple
                          sub-accounts.
                        example: 1
                      country:
                        type: string
                        description: >-
                          The country of the recipient in two-letter format
                          (e.g. US, UK, AU, NZ, etc).
                        example: US
                      carrier:
                        type: string
                        description: The phone carrier of the recipient.
                        example: ''
                      first_name:
                        type: string
                        nullable: true
                        description: >-
                          The first name of the recipient. The name will appear
                          if you sent the message to a contact from a contact
                          list. If you are sending directly to a phone number,
                          the value will be **null**.
                        example: John
                      last_name:
                        type: string
                        nullable: true
                        description: >-
                          The last name of the recipient. The name will appear
                          if you sent the message to a contact from a contact
                          list. If you are sending directly to a phone number,
                          the value will be **null**.
                        example: Doe
                      _api_username:
                        type: string
                        description: >-
                          The username of the SMS sender. This can be a <a
                          href="https://dashboard.clicksend.com/account/subaccounts"
                          target="_blank">sub-account</a>.
                        example: johndoe
      example:
        status: 200
        response_code: SUCCESS
        response_msg: Here are your history.
        data:
          - direction: out
            date: 1715660441
            to: '+61426729707'
            body: test message, please ignore
            status: Sent
            from: '+61447254068'
            schedule: '1715660441'
            status_code: '201'
            status_text: Message delivered to the handset
            message_id: 1EF11A95-31A2-6B70-A3E2-750B2DF4583F
            message_parts: 1
            message_price: '0.0792'
            from_email: null
            list_id: null
            custom_string: null
            contact_id: null
            user_id: 496596
            subaccount_id: 563840
            country: AU
            carrier: Vodafone
            first_name: null
            last_name: null
            _api_username: edorlando33@gmail.com
    export-sms-history:
      type: object
      properties:
        http_code:
          type: integer
          description: >-
            The HTTP code of the response. Visit [this page](/#status-codes) for
            more information.
          example: 200
        response_code:
          type: string
          description: >-
            The response code of the operation. Visit [this
            page](/#status-codes) for more information.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Download your file here.
        data:
          type: object
          description: The parameters related to the generated SMS history file.
          properties:
            url:
              type: string
              description: The download link to the generated SMS history file.
              example: >-
                https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv
      example:
        http_code: 200
        response_code: SUCCESS
        response_msg: Download your file here.
        data:
          url: >-
            https://clicksend-api-downloads.s3.ap-southeast-2.amazonaws.com/_private/CF08618C-5E61-4957-914E-3F75E305CB62?response-content-disposition=attachment%3Bfilename%3DSMS_history.csv&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=XXXXXXXXXXXXXXXap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20240830T053306Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Signature=82a0e5740550c171c9c90ccf94fc69dbdb34bfc83acee22b8d13d7043994aa62
paths:
  /v3/sms/send:
    post:
      summary: Send SMS
      operationId: send-sms
      description: >-
        Use this endpoint to send messages to your recipients, either as phone
        numbers or contacts from your contact list. 

        The sender of the message (<a
        href="https://help.clicksend.com/article/4kgj7krx00-what-is-a-sender-id-or-sender-number"
        target="_blank"><strong>Sender ID</strong></a>) can be a shared number,
        a dedicated number, alpha tag (business name), or your own number. 

        You can send messages both locally and globally, subject to the country
        restrictions. The cost of sending messages varies based on the <a
        href="https://help.clicksend.com/article/h474eseq3a-how-many-characters-can-i-send-in-an-sms"
        target="_blank">type</a> and length of the message.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                senders:
                  type: array
                  $ref: '#/components/schemas/senders'
                shorten_urls:
                  type: boolean
                  $ref: '#/components/schemas/shorten_urls'
                messages:
                  type: array
                  description: Messages to send to customers.
                  items:
                    type: object
                    properties:
                      body:
                        type: string
                        description: >-
                          The message to send. The price of sending a message
                          depends on the number of characters and the type of
                          message. There are two types:  


                          - Standard message - Contains only characters in the
                          <a href="https://en.wikipedia.org/wiki/GSM_03.38"
                          target="_blank">GSM</a> set, with a maximum of 160
                          characters.  
                              
                          - Unicode message - Contains characters outside the <a
                          href="https://en.wikipedia.org/wiki/GSM_03.38"
                          target="_blank">GSM</a> set, with a maximum of 70
                          characters.  
                              
                          Longer messages will be sent as multiple messages
                          (parts), but the recipient will receive them as a
                          single long message. Visit <a
                          href="https://help.clicksend.com/article/h474eseq3a-how-many-characters-can-i-send-in-an-sms"
                          target="_blank">this page</a> to learn more about the
                          number of characters per message, and <a
                          href="http://smscharactercount.com/#/counter"
                          target="_blank">this page</a> to count the number of
                          characters.
                      to:
                        type: string
                        description: >
                          The phone number of the recipient. It should be in the
                          international format (<a
                          href="https://en.wikipedia.org/wiki/E.164"
                          target="_blank">E.164</a>). You can send to a contact
                          list using the _list_id_ parameter. You need to
                          provide the _to_ parameter or the _list_id_ parameter.


                          <div class="info-box">
                            <h4><i class="fas fa-info-circle"></i> Note:</h4>
                            <p>To send SMS overseas, enable the <a href="https://help.clicksend.com/article/qdavyt16qs-global-sending" target="_blank">global sending</a> feature on your account either through the <a href="https://dashboard.clicksend.com/global-sending" target="_blank">Dashboard</a>, or by contacting <a href="https://www.clicksend.com/au/help/" target="_blank">customer support</a>.</p>
                          </div>
                      from:
                        type: string
                        description: >-
                          The sender of the message. This is also referred to as
                          the **<a
                          href="https://help.clicksend.com/article/4kgj7krx00-what-is-a-sender-id-or-sender-number"
                          target="_blank">Sender ID</a>**. You can use:

                          - **Shared number:** A number that is randomly
                          selected from a pool if no number is specified. This
                          is not available in the US and Canada. You can’t use a
                          shared number if you have a dedicated number.

                          - **Dedicated number:** A number you've purchased from
                          ClickSend. You can purchase a dedicated number using
                          the <a
                          href="https://dashboard.clicksend.com/sender-ids/manage-senders"
                          target="_blank">Dashboard</a> or the [**Purchase
                          Dedicated Number**](/) endpoint. It should be in the
                          international format (<a
                          href="https://en.wikipedia.org/wiki/E.164"
                          target="_blank">E.164</a>).

                          - **Alpha tag:** A sender name, like the name of your
                          business, used as the **Sender ID** instead of a
                          number. Recipients cannot reply to an alpha tag. You
                          can register an alpha tag using the <a
                          href="https://dashboard.clicksend.com/sender-ids/manage-senders"
                          target="_blank">dashboard</a> or the **[Request Alpha
                          Tag](/)** endpoint. Check which countries support
                          alpha tags <a
                          href="https://help.clicksend.com/article/532u04vhaq-which-countries-support-alpha-tags"
                          target="_blank">here</a>.

                          - **Own number:** Your own number that is connected to
                          your account. Replies from recipients are sent
                          directly to your number. You can register your own
                          number using the <a
                          href="https://dashboard.clicksend.com/sender-ids/manage-senders"
                          target="_blank">dashboard</a> or the [**Request Own
                          Number Verification OTP**](/) endpoint to get the
                          _verification_id_ and OTP code needed for the
                          [**Verify Own Number OTP**](/) endpoint. This isn't
                          available in the US and Canada.

                          If your **Sender ID** has a different country code to
                          the recipient’s, it'll be replaced by a local number,
                          except in <a
                          href="https://help.clicksend.com/category/mfdctha7f0-country-specific-features-and-restrictions"
                          target="_blank">certain countries</a>. If the sender
                          number is blocked, a different number will replace it.
                      source:
                        type: string
                        description: >-
                          The source of the request. For example, the name of
                          your application. It's used to identify messages sent
                          from various applications.
                      schedule:
                        type: integer
                        description: >-
                          The time you want the message to be sent. It should be
                          in <a
                          href="http://help.clicksend.com/what-is-a-unix-timestamp"
                          target="_blank">Unix format</a>.
                      custom_string:
                        type: string
                        description: >-
                          A note that will be sent back to you with the response
                          from the endpoint.
                      list_id:
                        type: string
                        description: >-
                          The _list_id_ of the contact list to send the message
                          to. Use the [**View Contact
                          List**](/contacts/lists/other/view-list-contacts)
                          endpoint to see your contact lists. You can also use
                          the other [lists endpoints](/contacts/lists/) to
                          create and manage your contact list. You need to
                          provide the _to_ parameter or the _list_id_ parameter.
                      contact_id:
                        type: integer
                        description: >-
                          The _contact_id_ of the contact to send the message
                          to. A _contact_id_ is connected to a _list_id_. Use
                          the Search Contact list endpoint to view the
                          _contact_id_ of the specified number. This parameter
                          will be sent back to you with the response from the
                          endpoint.


                          <div class="warning-box">
                            <h4><i class="fas fa-exclamation-triangle"></i> Warning:</h4>
                            <p>This parameter is no longer in use.</p>
                          </div>
                      country:
                        type: string
                        description: >-
                          The country code of the recipient in two-letter format
                          (e.g. US, UK, AU, NZ, <a
                          href="https://help.clicksend.com/article/7wtbhhy6sy-country-code-calling-code-list"
                          target="_blank">etc</a>).
                      from_email:
                        type: string
                        description: >-
                          The email address to which replies should be emailed
                          to. If omitted, the reply will be emailed back to the
                          user who sent the outgoing SMS.
                      exclude_no_sender_id_recipients:
                        type: boolean
                        description: >-
                          Used for validating whether the **Sender ID** in
                          registered or not. You can either specify:


                          - **True** - It will begin sending messages without
                          validating the Sender ID. If your contact is in a
                          country that requires Sender ID validation, your
                          recipient will not received it.
                              
                          - **False** - It will only send messages if the
                          **Sender ID** is registered.
                    required:
                      - body
            examples:
              basic_example:
                summary: Basic example with two messages
                value:
                  messages:
                    - source: php
                      body: >-
                        Jelly liquorice marshmallow candy carrot cake
                        4Eyffjs1vL.
                      to: '+61411111111'
                    - source: php
                      body: >-
                        Chocolate bar icing icing oat cake carrot cake jelly
                        cotton MWEvciEPIr.
                      to: '+61422222222'
              smart_assign_example:
                summary: Example using senders parameter of the smart assign feature
                value:
                  senders:
                    - recipient_country_code: AU
                      sender_id: ClickSend
                    - recipient_country_code: US
                      sender_id: '+14155552345'
                    - recipient_country_code: CA
                      sender_id: '+18338611041'
                  shorten_urls: false
                  messages:
                    - body: Hello from ClickSend! This is a test message.
                      to: '+61411111111'
                    - body: >-
                        Hello from ClickSend! This is another test message to
                        US.
                      to: '+14155552345'
                      custom_string: Test message 001
                    - body: >-
                        Hello from ClickSend! This is another test message to
                        CA.
                      to: '+15142250543'
      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-sms'
      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\"
                        },
                        {
                            \"source\":\"php\",
                            \"body\":\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\",
                            \"to\":\"+61422222222\"
                        }
                    ]
                }" \
            'https://rest.clicksend.com/v3/sms/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\SMSApi(new
            GuzzleHttp\Client(),$config);

            $msg = new \ClickSend\Model\SmsMessage();

            $msg->setBody("test body"); 

            $msg->setTo("0451111111");

            $msg->setSource("sdk");


            // \ClickSend\Model\SmsMessageCollection | SmsMessageCollection
            model

            $sms_messages = new \ClickSend\Model\SmsMessageCollection(); 

            $sms_messages->setMessages([$msg]);


            try {
                $result = $apiInstance->smsSendPost($sms_messages);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsSendPost: ', $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 smsApi = new SMSApi(configuration);

            var listOfSms = new List<SmsMessage>
            {
                new SmsMessage(
                    to: "+61411111111", 
                    body: "test message", 
                    source: "sdk"
                )
            };

            var smsCollection = new SmsMessageCollection(listOfSms);
            var response = smsApi.SmsSendPost(smsCollection);
        - lang: Java
          source: |-
            package ClickSend;

            import java.util.Arrays;
            import java.util.List;
            import ClickSend.Api.SmsApi;
            import ClickSend.Model.SmsMessage;
            import ClickSend.Model.SmsMessageCollection;

            public class send_sms {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                SmsApi apiInstance = new SmsApi(defaultClient);

                SmsMessage smsMessage=new SmsMessage();
                smsMessage.body("body");
                smsMessage.to("to");
                smsMessage.source("source");

                List<SmsMessage> smsMessageList=Arrays.asList(smsMessage);
                // SmsMessageCollection | SmsMessageCollection model
                SmsMessageCollection smsMessages = new SmsMessageCollection();
                smsMessages.messages(smsMessageList);
                try {
                    String result = apiInstance.smsSendPost(smsMessages);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling SmsApi#smsSendPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var smsMessage = new api.SmsMessage();

            smsMessage.source = "sdk";
            smsMessage.to = "+0451111111";
            smsMessage.body = "test message";

            var smsCollection = new api.SmsMessageCollection();

            smsCollection.messages = [smsMessage];

            smsApi.smsSendPost(smsCollection).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::SMSApi.new

            # SmsMessageCollection | SmsMessageCollection model
            sms_messages = ClickSendClient::SmsMessageCollection.new

            sms_messages.messages = [
              ClickSendClient::SmsMessage.new(
                "to": "+61411111111",
                "source": "sdk",
                "body": "body"
              ),
              ClickSendClient::SmsMessage.new(
                "to": "+61422222222",
                "source": "sdk",
                "body": "body"
              )
            ]

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

            import clicksend_client

            from clicksend_client import SmsMessage

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


            # If you want to explictly set from, add the key _from to the
            message.

            sms_message = SmsMessage(source="php",
                                    body="Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
                                    to="+61411111111",
                                    schedule=1436874701)

            sms_messages =
            clicksend_client.SmsMessageCollection(messages=[sms_message])


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

            use WWW::ClickSendClient::Object::SmsMessageCollection;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my %params = (
                'messages' => [
                    {
                        'source'        => 'perl',
                        'body'          => 'Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.',
                        'to'            => '+61411111111'
                    },
                    {
                        'source'        => 'perl',
                        'body'          => 'Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.',
                        'to'            => '+61422222222'
                    }
                ]
            );


            #You can post up to 1000 messages


            my $messages_obj =
            WWW::ClickSendClient::Object::SmsMessageCollection->new(%params);

            my $json_output = $api->sms_send_post('sms_messages' =>
            $messages_obj);


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

            #import "CSSmsMessage.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSmsMessage *smsMessage1 = [[CSSmsMessage alloc] init];

            smsMessage1.to = @"+0451111111";

            smsMessage1.source = @"objc";

            smsMessage1.body = @"Chocolate bar icing icing oat cake carrot cake
            jelly cotton MWEvciEPIr.";


            CSSmsMessage *smsMessage2 = [[CSSmsMessage alloc] init];

            smsMessage2.listId = @"1234";

            smsMessage2.source = @"objc";

            smsMessage2.body = @"Chocolate bar icing icing oat cake carrot cake
            jelly cotton MWEvciEPIr.";



            CSSmsMessageCollection *smsMessageCollection =
            [[CSSmsMessageCollection alloc] init];

            smsMessageCollection.messages = (NSArray<CSSmsMessage> *)
            @[smsMessage1, smsMessage2];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

            [smsAPI smsSendPostWithSmsMessages:smsMessageCollection
            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 message1 = SmsMessage(body: "Chocolate bar icing icing oat cake
            carrot cake jelly cotton MWEvciEPIr.", 
                                    to: "+0451111111", 
                                    source: "swift")

            let message2 = SmsMessage(body: "Chocolate bar icing icing oat cake
            carrot cake jelly cotton MWEvciEPIr.", 
                                    source: "swift", 
                                    listId: 1234)

            let smsCollection = SmsMessageCollection(messages: [message1,
            message2])

            SMSAPI.smsSendPost(smsMessages: smsCollection) { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/price:
    post:
      summary: Calculate SMS Price
      operationId: calculate-sms-price
      description: >-
        Use this endpoint to calculate the price of sending messages. The cost
        of sending messages varies based on the <a
        href="https://help.clicksend.com/article/h474eseq3a-how-many-characters-can-i-send-in-an-sms"
        target="_blank">type</a> and length of the message.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                senders:
                  type: array
                  $ref: '#/components/schemas/senders'
                shorten_urls:
                  type: boolean
                  $ref: '#/components/schemas/shorten_urls'
                messages:
                  type: array
                  description: Messages to send to customers.
                  items:
                    type: object
                    required:
                      - body
                    properties:
                      body:
                        type: string
                        description: >-
                          The message to send. The price of sending a message
                          depends on the number of characters and the type of
                          message. There are two types:


                          - Standard message: Contains only characters in the <a
                          href="https://en.wikipedia.org/wiki/GSM_03.38"
                          target="_blank">GSM</a> set, with a maximum of 160
                          characters.
                              
                          - Unicode message: Contains characters outside the <a
                          href="https://en.wikipedia.org/wiki/GSM_03.38"
                          target="_blank">GSM</a> set, with a maximum of 70
                          characters.
                              
                          Longer messages will be sent as multiple messages
                          (parts), but the recipient will receive them as a
                          single long message. Visit <a
                          href="https://help.clicksend.com/article/h474eseq3a-how-many-characters-can-i-send-in-an-sms"
                          target="_blank">this page</a> to learn more about the
                          number of characters per message, and <a
                          href="http://smscharactercount.com/"
                          target="_blank">this page</a> to count the number of
                          characters.
                      to:
                        type: string
                        description: >-
                          The phone number of the recipient. It should be in the
                          international format (<a
                          href="https://en.wikipedia.org/wiki/E.164"
                          target="_blank">E.164</a>). You can send to a contact
                          list using the _list_id_ parameter. You need to
                          provide the to parameter or the _list_id_ parameter.


                          <div class="info-box">
                            <h4><i class="fas fa-info-circle"></i> Note:</h4>
                            <p>To send SMS overseas, enable the <a href="https://help.clicksend.com/article/qdavyt16qs-global-sending" target="_blank">global sending</a> feature on your account either through the <a href="https://dashboard.clicksend.com/global-sending" target="_blank">Dashboard</a>, or by contacting <a href="https://www.clicksend.com/au/help/" target="_blank">customer support.</a></p>
                          </div> 
                      from:
                        type: string
                        description: >-
                          The sender of the message. This is also referred to as
                          the **<a
                          href="https://help.clicksend.com/article/4kgj7krx00-what-is-a-sender-id-or-sender-number"
                          target="_blank">Sender ID</a>**. You can use:


                          - Shared number: A number that is randomly selected
                          from a pool if no number is specified. This is not
                          available in the US and Canada. You can’t use a shared
                          number if you have a dedicated number.
                              
                          - Dedicated number: A number you've purchased from
                          ClickSend. You can purchase a dedicated number using
                          the <a
                          href="https://dashboard.clicksend.com/sender-ids/manage-senders"
                          target="_blank">Dashboard</a> or the [**Purchase
                          Dedicated Number**](/) endpoint. It should be in the
                          international format (<a
                          href="https://en.wikipedia.org/wiki/E.164"
                          target="_blank">E.164</a>).
                              
                          - Alpha tag: A sender name, like the name of your
                          business, used as the **Sender ID** instead of a
                          number. Recipients cannot reply to an alpha tag. You
                          can register an alpha tag using the <a
                          href="https://dashboard.clicksend.com/sender-ids/manage-senders"
                          target="_blank">dashboard</a> or the [**Request Alpha
                          Tag**](/) endpoint. Check which countries support
                          alpha tags <a
                          href="https://help.clicksend.com/article/532u04vhaq-which-countries-support-alpha-tags"
                          target="_blank">here</a>.
                              
                          - Own number: Your own number that is connected to
                          your account. Replies from recipients are sent
                          directly to your number. You can register your own
                          number using the <a
                          href="https://dashboard.clicksend.com/sender-ids/manage-senders"
                          target="_blank">dashboard</a> or the [**Request Own
                          Number Verification OTP**](/) endpoint to get the
                          verification_id and OTP code needed for the [**Verify
                          Own Number OTP**](/) endpoint. This isn't available in
                          the US and Canada.
                              
                          If your **Sender ID** has a different country code to
                          the recipient’s, it'll be replaced by a local number,
                          except in <a
                          href="https://help.clicksend.com/category/mfdctha7f0-country-specific-features-and-restrictions"
                          target="_blank">certain countries</a>. If the sender
                          number is blocked, a different number will replace it.
                      source:
                        type: string
                        description: >-
                          The source of the request. For example, the name of
                          your application. It's used to identify messages sent
                          from various applications.
                      schedule:
                        type: integer
                        description: >-
                          The time you want the message to be sent. It should be
                          in <a
                          href="http://help.clicksend.com/what-is-a-unix-timestamp"
                          target="_blank">Unix format</a>.
                      custom_string:
                        type: string
                        description: >-
                          A note that will be sent back to you with the response
                          from the endpoint.
                      list_id:
                        type: string
                        description: >-
                          The _list_id_ of the contact list to send the message
                          to. Use the [**View Contact
                          List**](/contacts/lists/other/view-list-contacts)
                          endpoint to see your contact lists. You can also use
                          the other [lists endpoints](/contacts/lists/) to
                          create and manage your contact list. You need to
                          provide the _to_ parameter or the _list_id_ parameter.
                      contact_id:
                        type: string
                        description: >-
                          The _contact_id_ of the contact to send the message
                          to. A _contact_id_ is connected to a _list_id_. Use
                          the [**Search Contact
                          list**](/contacts/lists/#search-contact-lists)
                          endpoint to view the _contact_id_ of the specified
                          number. This parameter will be sent back to you with
                          the response from the endpoint.


                          <div class="warning-box">
                            <h4><i class="fas fa-exclamation-triangle"></i> Warning:</h4>
                            <p>This parameter is no longer in use.</p>
                          </div>
                      country:
                        type: string
                        description: "The country code of the recipient in two-letter format (e.g. US, UK, AU, NZ, <a href=\"https://help.clicksend.com/article/7wtbhhy6sy-country-code-calling-code-list\" target=\"_blank\"\t>etc</a>)."
                      show_summary:
                        type: boolean
                        description: >-
                          Used for showing additional information in the
                          response. You can either specify:

                           - **True:** It will show the additional information.
                               
                           - **False:** It will only show the basic information. This is the default value.              
            examples:
              basic_example:
                summary: Basic example with two messages
                value:
                  messages:
                    - source: php
                      body: >-
                        Jelly liquorice marshmallow candy carrot cake
                        4Eyffjs1vL.
                      to: '+61411111111'
                    - source: php
                      body: >-
                        Chocolate bar icing icing oat cake carrot cake jelly
                        cotton MWEvciEPIr.
                      to: '+61422222222'
              smart_assign_example:
                summary: Example using senders parameter of the smart assign feature
                value:
                  senders:
                    - recipient_country_code: AU
                      sender_id: ClickSend
                    - recipient_country_code: US
                      sender_id: '+14155552345'
                    - recipient_country_code: CA
                      sender_id: '+18338611041'
                  shorten_urls: false
                  messages:
                    - body: Hello from ClickSend! This is a test message.
                      to: '+61411111111'
                    - body: >-
                        Hello from ClickSend! This is another test message to
                        US.
                      to: '+14155552345'
                      custom_string: Test message 001
                    - body: >-
                        Hello from ClickSend! This is another test message to
                        CA.
                      to: '+15142250543'
      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-sms-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\"
                        },
                        {
                            \"source\":\"php\",
                            \"body\":\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\",
                            \"to\":"+61422222222"
                        }
                    ]
                }" \
            'https://rest.clicksend.com/v3/sms/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\SMSApi(new
            GuzzleHttp\Client(),$config);

            $msg = new \ClickSend\Model\SmsMessage();


            $msg->setBody("test body"); 

            $msg->setTo("0451111111"); 

            $msg->setSource("php-sdk");


            // \ClickSend\Model\SmsMessageCollection | SmsMessageCollection
            model

            $sms_messages = new \ClickSend\Model\SmsMessageCollection(); 

            $sms_messages->setMessages([$msg]);


            try {
                $result = $apiInstance->smsPricePost($sms_messages);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsPricePost: ', $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 smsApi = new SMSApi(configuration);

            var listOfSms = new List<SmsMessage>
            {
                new SmsMessage(
                    to: "+61411111111", 
                    body: "test message", 
                    source: "sdk"
                )
            };

            var smsCollection = new SmsMessageCollection(listOfSms);
            var response = smsApi.SmsPricePost(smsCollection);
        - lang: Java
          source: |
            package ClickSend;

            import java.util.Arrays;
            import java.util.List;
            import ClickSend.Api.SmsApi;
            import ClickSend.Model.SmsMessage;
            import ClickSend.Model.SmsMessageCollection;

            public class calculate_sms_price {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                SmsApi apiInstance = new SmsApi(defaultClient);
                SmsMessage smsMessage=new SmsMessage();
                smsMessage.body("body");
                smsMessage.to("to");
                smsMessage.source("source");

                List<SmsMessage> smsMessageList=Arrays.asList(smsMessage);
                // SmsMessageCollection | SmsMessageCollection model
                SmsMessageCollection smsMessages = new SmsMessageCollection();
                smsMessages.messages(smsMessageList);
                try {
                    String result = apiInstance.smsPricePost(smsMessages);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling SmsApi#smsPricePost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var smsMessage = new api.SmsMessage();

            smsMessage.from = "myNumber";
            smsMessage.to = "+0451111111";
            smsMessage.body = "test message";

            var smsCollection = new api.SmsMessageCollection();

            smsCollection.messages = [smsMessage];

            smsApi.smsPricePost(smsCollection).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::SMSApi.new


            sms_messages = ClickSendClient::SmsMessageCollection.new #
            SmsMessageCollection | SmsMessageCollection model


            sms_messages.messages = [
              ClickSendClient::SmsMessage.new(
                "source": "sdk",
                "to": "+61411111111",
                "body": "body"
              ),
              ClickSendClient::SmsMessage.new(
                "source": "sdk",
                "to": "+61422222222",
                "body": "body"
              )
            ]


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

            import clicksend_client

            from clicksend_client import SmsMessage

            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.SMSApi(
              clicksend_client.ApiClient(configuration))
            sms_message = SmsMessage(source="php",
                                    body="Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
                                    to="+61411111111")
            # SmsMessageCollection | SmsMessageCollection model

            sms_messages =
            clicksend_client.SmsMessageCollection(messages=[sms_message]) 


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

            use WWW::ClickSendClient::Object::SmsMessageCollection;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my %params = (
                'messages' => [
                    {
                        'source'        => 'perl',
                        'body'          => 'Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.',
                        'to'            => '+61411111111'
                    },
                    {
                        'source'        => 'perl',
                        'body'          => 'Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.',
                        'to'            => '+61422222222'
                    }
                ]
            );


            my $messages_obj =
            WWW::ClickSendClient::Object::SmsMessageCollection->new(%params);

            my $json_output = $api->sms_price_post('sms_messages' =>
            $messages_obj);


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

            #import "CSSmsMessage.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSmsMessage *smsMessage1 = [[CSSmsMessage alloc] init];

            smsMessage1.to = @"+0451111111";

            smsMessage1.source = @"objc";

            smsMessage1.body = @"Chocolate bar icing icing oat cake carrot cake
            jelly cotton MWEvciEPIr.";


            CSSmsMessage *smsMessage2 = [[CSSmsMessage alloc] init];

            smsMessage2.listId = @"1234";

            smsMessage2.source = @"objc";

            smsMessage2.body = @"Chocolate bar icing icing oat cake carrot cake
            jelly cotton MWEvciEPIr.";



            CSSmsMessageCollection *smsMessageCollection =
            [[CSSmsMessageCollection alloc] init];

            smsMessageCollection.messages = (NSArray<CSSmsMessage> *)
            @[smsMessage1, smsMessage2];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

            [smsAPI smsPricePostWithSmsMessages:smsMessageCollection
            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 message1 = SmsMessage(
                body: "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.", 
                to: "+0451111111", 
                source: "swift"
            )


            let message2 = SmsMessage(
                body: "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.", 
                source: "swift", 
                listId: 1234, 
            )


            let smsCollection = SmsMessageCollection(messages: [message1,
            message2])


            SMSAPI.smsPricePost(smsMessages: smsCollection) { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/receipts:
    post:
      summary: Create Test SMS Receipt
      operationId: create-test-sms-receipt
      description: >-
        Use this endpoint to generate and send a test <a
        href="https://help.clicksend.com/article/49eq1qdcui-how-do-i-receive-sms-delivery-receipts-delivery-status-updates"
        target="_blank">SMS delivery receipt</a> to your webhook URL. When you
        send an SMS, a delivery receipt is generated and can be received at your
        webhook URL. This test endpoint allows you to verify that the receipt is
        correctly sent to your webhook URL.


        Additionally, you can obtain SMS receipts by setting the webhook URL to
        **poll** and periodically calling the **View SMS Receipt** endpoint to
        check for new receipts. This process is known as _polling_.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  description: >-
                    The webhook URL where the delivery receipt will be sent to.
                    You can set the value to **poll** to send it to the
                    ClickSend  

                    system, and then retrieve it with the **View SMS Receipt**
                    endpoint


                    <div class="info-box">
                      <h4><i class="fas fa-info-circle"></i> Note:</h4>
                      <p>You can create a webhook URL in Pipedream to test receiving the SMS receipt. Follow the instructions <a target="_blank" href="https://help.clicksend.com/article/qu4sdry7al-how-to-create-a-webhook-in-pipedream-and-send-sms-with-click-send">here</a>.</p>
                    </div>
              example:
                url: https://sample_webhook_url.m.pipedream.net/
      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/create-test-sms-receipt'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \

                 --header "Content-Type: application/json" \
                 --data-binary "    {
                    \"url\":\"http://yourdomain.com\"
                }" \
            'https://rest.clicksend.com/v3/sms/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\SMSApi(new
            GuzzleHttp\Client(),$config);

            $url = new \ClickSend\Model\Url(); // \ClickSend\Model\Url | Url
            model

            $url->setUrl("http://example.com");


            try {
                $result = $apiInstance->smsReceiptsPost($url);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsReceiptsPost: ', $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 smsApi = new SMSApi(configuration);
            var response = smsApi.SmsReceiptsPost(new Url("http://domain.com"));
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.SmsApi;
            import ClickSend.Model.Url;

            public class create_sms_receipt {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                SmsApi apiInstance = new SmsApi(defaultClient);
                Url url = new Url(); // Url | Url model
                url.url("http://www.example.com");
                try {
                    String result = apiInstance.smsReceiptsPost(url);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling SmsApi#smsReceiptsPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var payload = new api.Url;

            payload.url = "http://example.com";

            smsApi.smsReceiptsPost(payload).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::SMSApi.new

            # Url | Url model
            url = ClickSendClient::Url.new(
              url: "http://yourdomain.com"
            )

            begin
              # Add a delivery receipt
              result = api_instance.sms_receipts_post(url)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_receipts_post: #{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.SMSApi(clicksend_client.ApiClient(configuration))

            url = 'https://www.example.com' # str | Your url


            try:
                # Add a delivery receipt
                api_response = api_instance.sms_receipts_post({"url" : url})
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_receipts_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $url =
            WWW::ClickSendClient::Object::Url->new('http://yourdomain.com');


            my $json_output = $api->sms_receipts_post($url);


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

            CSUrl *csUrl = [[CSUrl alloc] init];

            csUrl.url = @"https://rest.clicksend.com/v3/sms/receipts";


            [smsAPI smsReceiptsPostWithUrl:csUrl 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 url = Url(url: "https://rest.clicksend.com/v3/sms/receipts")

            SMSAPI.smsReceiptsPost(url: url) { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    get:
      summary: View SMS Receipts
      operationId: view-sms-receipts
      description: >-
        Use this endpoint to retrieve <a
        href="https://help.clicksend.com/article/49eq1qdcui-how-do-i-receive-sms-delivery-receipts-delivery-status-updates"
        target="_blank">SMS delivery receipts</a> sent by your recipient. 

        To be able to view receipts, add a <a
        href="https://help.clicksend.com/article/453o4hjxvl-can-i-be-notified-when-a-message-is-delivered-or-fails"
        target="_blank">delivery report</a> rule with the Action set to **POLL**
        in the Dashboard, or use the [**Create SMS Delivery Receipt
        Rule**](/automations/sms/other/create-sms-delivery-receipt-rule)
        endpoint. 

        Control [pagination](/#pagination) with the _page_ and _limit_ query
        parameters to specify the page of results and the number of items
        returned.
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: page
          description: >-
            The page number to retrieve. Use this parameter to navigate through
            the [pagination](/#pagination) results. The default value is 1.
          in: query
          schema:
            type: integer
            default: 1
          example: 1
        - name: limit
          description: >-
            The number of items to return per page. This parameter controls the
            size of each page of results. The default value is 15.
          in: query
          schema:
            type: integer
            minimum: 15
            maximum: 100
            default: 15
          example: 15
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-sms-receipts'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

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

            $page = 1; // int | Page number

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


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

            import ClickSend.Api.SmsApi;

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

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var page = 1;
            var limit = 10;

            smsApi.smsReceiptsGet(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'

            ClickSendClient.configure do |config|
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::SMSApi.new

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

            begin
              # Get all delivery receipts
              result = api_instance.sms_receipts_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_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.SMSApi(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 delivery receipts
                api_response = api_instance.sms_receipts_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_receipts_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


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


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

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


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


            SMSAPI.smsReceiptsGet(page: 1, limit: 15) { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/receipts/{message_id}:
    get:
      summary: View Specific SMS Receipt
      operationId: view-specific-sms-receipt
      description: >-
        Use this endpoint to retrieve a specific <a
        href="https://help.clicksend.com/article/49eq1qdcui-how-do-i-receive-sms-delivery-receipts-delivery-status-updates"
        target="_blank">SMS delivery receipt</a>, including those that have been
        marked as read. When you send an SMS, a delivery receipt is generated
        and can be received. 

        This endpoint enables you to retrieve those receipts.
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: message_id
          description: The _message_id_ of the SMS delivery reciept to retrieve
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-specific-sms-receipt'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

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

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


            // Configure HTTP basic authorization: BasicAuth

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

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

            $message_id = "messageId_example"; // string | Message ID


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

            import ClickSend.Api.SmsApi;

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


            var smsApi = new api.SMSApi("USERNAME", "API_KEY");


            var messageId = "message_id";


            smsApi.smsReceiptsByMessageIdGet(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::SMSApi.new


            message_id = "56A3964A-DC7D-4455-B56C-101F7A0D86DF" # String |
            Message ID


            begin
              # Get a Specific Delivery Receipt
              result = api_instance.sms_receipts_by_message_id_get(message_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_receipts_by_message_id_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

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

            message_id = 'message_id' # str | Message ID


            try:
                # Get a Specific Delivery Receipt
                api_response = api_instance.sms_receipts_by_message_id_get(message_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_receipts_by_message_id_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output = $api->sms_receipts_by_message_id_get('message_id'
            => 'XXX-XXXXXXX-XXXXX-XXXXX-XXXXXX');


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];



            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

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


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


            SMSAPI.smsReceiptsByMessageIdGet(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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/receipts-read:
    put:
      summary: Mark SMS Receipt As Read
      operationId: mark-sms-receipt-as-read
      description: >-
        Use this endpoint to mark all <a target="_blank"
        href="https://help.clicksend.com/article/49eq1qdcui-how-do-i-receive-sms-delivery-receipts-delivery-status-updates">SMS
        delivery receipts</a> as read. Delivery receipts that have been marked
        as read won’t be shown in the **View SMS Receipts** endpoint. 

        You can still use the **View Specific SMS Receipt** endpoint to view
        delivery receipts marked as read. In the request, you can optionally add
        a _date_before_ parameter to only mark receipts sent before that date as
        read
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                date_before:
                  type: integer
                  description: >-
                    The cutoff date. Receipts sent before this time will be
                    marked as read. It’s in the <a target="_blank"
                    href="http://help.clicksend.com/what-is-a-unix-timestamp">Unix
                    format</a>.
              example:
                date_before: 1722565660
      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/mark-sms-receipt-as-read'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

                 --header "Content-Type: application/json" \
                 --data-binary "{
                \"date_before\": 1441958441
            }" \
            'https://rest.clicksend.com/v3/sms/receipts-read'
        - 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\SMSApi(new
            GuzzleHttp\Client(),$config);

            // \ClickSend\Model\DateBefore | DateBefore model

            $date_before = new \ClickSend\Model\DateBefore(); 

            $date_before->setDateBefore("2018-01-01");


            try {
                $result = $apiInstance->smsReceiptsReadPut($date_before);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsReceiptsReadPut: ', $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 smsApi = new SMSApi(configuration);

            var response = smsApi.SmsReceiptsReadPut(new
            DateBefore(TIME_STAMP));
        - lang: Java
          source: |-
            package ClickSend;

            import java.math.BigDecimal;
            import ClickSend.Api.SmsApi;
            import ClickSend.Model.DateBefore;

            public class mark_sms_receipt_as_read {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                SmsApi apiInstance = new SmsApi(defaultClient);
                DateBefore dateBefore = new DateBefore(); // DateBefore | DateBefore model
                dateBefore.dateBefore(new BigDecimal(1441958441));
                try {
                    String result = apiInstance.smsReceiptsReadPut(dateBefore);

                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling SmsApi#smsReceiptsReadPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var dateBefore = new api.DateBefore();

            dateBefore.dateBefore = 1545477061;

            smsApi.smsReceiptsReadPut(dateBefore).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::SMSApi.new

            opts = {
              "date_before": "1543604472" # String | Mark all as read before this timestamp
            }

            begin
              # Mark delivery receipts as read
              result = api_instance.sms_receipts_read_put(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_receipts_read_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.SMSApi(clicksend_client.ApiClient(configuration))

            # str | Mark all as read before this timestamp (optional)

            date_before = 'date_before_example' 


            try:
                # Mark delivery receipts as read
                api_response = api_instance.sms_receipts_read_put(date_before=date_before)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_receipts_read_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output =
            $api->sms_receipts_read_put(WWW::ClickSendClient::Object::DateBefore->new(TIME_STAMP));


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

            #import "CSDateBefore.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];


            CSDateBefore *dateBefore = [[CSDateBefore alloc] init];


            [smsAPI smsReceiptsReadPutWithDateBefore:dateBefore
            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]
            }


            SMSAPI.smsReceiptsReadPut(dateBefore: nil) { (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("bad json")
                    }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/inbound:
    post:
      summary: Create Test Inbound SMS
      operationId: create-test-inbound-sms
      description: >-
        Use this endpoint to generate and send a test <a
        href="https://help.clicksend.com/article/ik4hw5xu35-can-i-receive-inbound-sms-to-my-url"
        target="_blank">inbound SMS</a> to your webhook URL. Inbound SMS are
        messages sent by your recipient to you. 

        This test endpoint allows you to verify that the inbound SMS is
        correctly sent to your webhook URL.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: |-
                    The webhook URL where the inbound SMS will be sent to.

                    <div class="info-box">
                      <h4><i class="fas fa-info-circle"></i> Note:</h4>
                      <p>You can create a webhook URL in <em>Pipedream</em> to test receiving the inbound SMS. Follow the instructions <a href="https://help.clicksend.com/article/qu4sdry7al-how-to-create-a-webhook-in-pipedream-and-send-sms-with-click-send" target="_blank">here.</a></p>
                    </div>  
                webhook_type:
                  type: string
                  description: >-
                    Specifies the HTTP method used when the webhook sends a
                    request to the URL. The available options are:


                    - **post** (Default): Sends the event data using an HTTP
                    POST request.
                        
                    - **get**: Sends the event data as query parameters in an
                    HTTP GET request.
                        
                    - **json**: Sends the event data using a custom JSON format
                    (via a POST request).
                        
                    This parameter is used to determine how the data will be
                    transmitted, depending on your preferred method and how the
                    receiving system is designed to process incoming requests.
              required:
                - url
              example:
                url: https://sample_webhook_url.m.pipedream.net/
      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/create-test-inbound-sms'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \

                 --header "Content-Type: application/json" \
                 --data-binary "    {
                    \"url\":\"http://yourdomain.com\"
                }" \
            'https://rest.clicksend.com/v3/sms/inbound'
        - 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\SMSApi(new
            GuzzleHttp\Client(),$config);

            $url = new \ClickSend\Model\Url(); // \ClickSend\Model\Url | Url
            model

            $url->setUrl("http://example.com");


            try {
                $result = $apiInstance->smsInboundPost($url);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsInboundPost: ', $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 smsApi = new SMSApi(configuration);

            var response = smsApi.SmsInboundPost(new
            Url("https://yourdomain.com"));
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.SmsApi;
            import ClickSend.Model.Url;

            public class create_inbound_sms {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                SmsApi apiInstance = new SmsApi(defaultClient);
                Url url = new Url(); // Url | Url model
                url.url("http://www.example.com");
                try {
                    String result = apiInstance.smsInboundPost(url);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling SmsApi#smsInboundPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var payload = new api.Url;

            payload.url = "http://example.com";

            smsApi.smsInboundPost(payload).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::SMSApi.new

            # Url | Url model
            url = ClickSendClient::Url.new(
              url: "http://yourdomain.com"
            )

            begin
              # Create inbound sms
              result = api_instance.sms_inbound_post(url)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_inbound_post: #{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.SMSApi(clicksend_client.ApiClient(configuration))

            url = 'http://www.example.com' # str | Your url

            payload = {"url" : url}


            try:
                # Create inbound sms
                api_response = api_instance.sms_inbound_post(payload)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_inbound_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output = $api->sms_inbound_post('url' =>
            'http://yourdomain.com');


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

            #import "CSUrl.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];


            CSUrl *csUrl = [[CSUrl alloc] init];

            csUrl.url = @"http://yourdomain.com";


            [smsAPI smsInboundPostWithUrl:csUrl 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 url = Url(url: "https://yourdomiansample.com")

            SMSAPI.smsInboundPost(url: url) { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    get:
      summary: View Inbound SMS
      operationId: view-inbound-sms
      description: >-
        Use this endpoint to retrieve <a
        href="https://help.clicksend.com/article/49eq1qdcui-how-do-i-receive-sms-delivery-receipts-delivery-status-updates"
        target="_blank">SMS delivery receipts</a> sent by your recipient. 

        To be able to view receipts, add a <a
        href="https://help.clicksend.com/article/ut4ttdrrai-incoming-reply-sms-options">inbound
        rule</a> with the Action set to **POLL** in the Dashboard, or use the
        [**Create SMS Inbound
        Automation**](/automations/sms/other/create-sms-inbound-automation)
        endpoint. 

        Control [pagination](/#pagination) with the _page_ and _limit_ query
        parameters to specify the page of results and the number of items
        returned.


        <div class="info-box">
          <h4><i class="fas fa-info-circle"></i> Note:</h4>
          <p>If you have multiple inbound rules set to <strong>POLL</strong>, you will receive the inbound message multiple times.</p>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: page
          in: query
          description: >-
            The page number to retrieve. Use this parameter to navigate through
            the [pagination](/#pagination) results. The default value is 1.
          schema:
            type: integer
            default: 1
            example: 1
        - name: limit
          in: query
          description: >-
            The number of items to return per page. This parameter controls the
            size of each page of results. The default value is 15.
          schema:
            type: integer
            minimum: 15
            maximum: 100
            default: 15
            example: 15
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-inbound-sms'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

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

            $q = "q_example"; // string | Your keyword or query.

            $page = 1; // int | Page number

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


            try {
                $result = $apiInstance->smsInboundGet($q, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsInboundGet: ', $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 smsApi = new SMSApi(configuration);

            var q = "q_example";
            var page = 1;
            var limit = 10;

            var response = smsApi.SmsInboundGet(q, page, limit);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.SmsApi;

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

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var q = "q_example";
            var page = 1;
            var limit = 10;

            smsApi.smsInboundGet(q, 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::SMSApi.new

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

            begin
              # Get all inbound sms
              result = api_instance.sms_inbound_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_inbound_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.SMSApi(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 inbound sms
                api_response = api_instance.sms_inbound_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_inbound_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output = $api->sms_inbound_get('page' => '1', 'limit' =>
            '3');


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];


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


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


            SMSAPI.smsInboundGet { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/inbound/{original_message_id}:
    get:
      summary: View a specific inbound SMS message
      operationId: view-a-specific-inbound-sms-message
      description: >-
        Use this endpoint to retrieve a specific inbound SMS, including those
        that have been marked as read. 

        Inbound SMS are messages sent by your recipient to you. This endpoint
        enables you to retrieve those inbound SMS.
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: original_message_id
          description: >-
            The _original_message_id_ of the inbound SMS to view. If the
            recipient replied with multiple messages, this endpoint returns the
            first inbound SMS received.


            <div class="info-box">
              <h4><i class="fas fa-info-circle"></i> Note:</h4>
              <p>
                When you receive an inbound message, you will get two parameters: <em>original_message_id</em> and <em>message_id</em>:
              </p>
              <ul>
                <li><em>original_message_id</em>: This is the ID of the outbound message sent to the recipient</li>
                <li><em>message_id</em>: This is the ID of the inbound message sent by the recipient.</li>
              </ul>
            </div>
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-a-specific-inbound-sms-message'
      x-codeSamples:
        - lang: curl
          source: >
            curl --location
            'https://rest.clicksend.com/v3/sms/inbound/{original_message_id}' \

            --header 'Content-Type: application/json' \

            --header 'Authorization: API_KEY'
        - lang: PHP
          source: >
            <?php

            require_once 'HTTP/Request2.php';

            $request = new HTTP_Request2();

            $request->setUrl('https://rest.clicksend.com/v3/sms/inbound/{original_message_id');

            $request->setMethod(HTTP_Request2::METHOD_GET);

            $request->setConfig(array(
                'follow_redirects' => TRUE
            ));

            $request->setHeader(array(
                'Content-Type' => 'application/json',
                'Authorization' => 'API_KEY'
            ));

            try {
                $response = $request->send();
                if ($response->getStatus() == 200) {
                    echo $response->getBody();
                } else {
                    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
                        $response->getReasonPhrase();
                }
            } catch (HTTP_Request2_Exception $e) {
                echo 'Error: ' . $e->getMessage();
            }
        - lang: C#
          source: >
            var client = new HttpClient();

            var request = new HttpRequestMessage(HttpMethod.Get,
            "https://rest.clicksend.com/v3/sms/inbound/{original_message_id");

            request.Headers.Add("Authorization", "API_KEY");

            var content = new StringContent(string.Empty);

            content.Headers.ContentType = new
            MediaTypeHeaderValue("application/json");

            request.Content = content;

            var response = await client.SendAsync(request);

            response.EnsureSuccessStatusCode();

            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: Java
          source: >-
            const myHeaders = new Headers();

            myHeaders.append("Content-Type", "application/json");

            myHeaders.append("Authorization", "API_KEY");


            const requestOptions = {
              method: "GET",
              headers: myHeaders,
              redirect: "follow"
            };


            fetch("https://rest.clicksend.com/v3/sms/inbound/{original_message_id}",
            requestOptions)
              .then((response) => response.text())
              .then((result) => console.log(result))
              .catch((error) => console.error(error));
        - lang: Node.js
          source: |
            var request = require("request");
            var options = {
              method: "GET",
              url: "https://rest.clicksend.com/v3/sms/inbound/{original_message_id}",
              headers: {
                "Content-Type": "application/json",
                Authorization: "API_KEY",
              },
            };
            request(options, function (error, response) {
              if (error) throw new Error(error);
              console.log(response.body);
            });
        - lang: Ruby
          source: >-
            require "uri"

            require "json"

            require "net/http"


            url =
            URI("https://rest.clicksend.com/v3/sms/inbound/{original_message_id}")


            https = Net::HTTP.new(url.host, url.port)

            https.use_ssl = true


            request = Net::HTTP::Get.new(url)

            request["Content-Type"] = "application/json"

            request["Authorization"] = "API_KEY"


            response = https.request(request)

            puts response.read_body
        - lang: Python
          source: >-
            import http.client

            import json


            conn = http.client.HTTPSConnection("rest.clicksend.com")

            payload = ''

            headers = {
              'Content-Type': 'application/json',
              'Authorization': 'API_KEY'
            }

            conn.request("GET", "/v3/sms/inbound/{original_message_id}",
            payload, headers)

            res = conn.getresponse()

            data = res.read()

            print(data.decode("utf-8"))
        - lang: objc
          source: >
            #import <Foundation/Foundation.h>


            dispatch_semaphore_t sema = dispatch_semaphore_create(0);


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://rest.clicksend.com/v3/sms/inbound/%7Boriginal_message_id%7D"]
              cachePolicy:NSURLRequestUseProtocolCachePolicy
              timeoutInterval:10.0];
            NSDictionary *headers = @{
              @"Content-Type": @"application/json",
              @"Authorization": @"API_KEY"
            };


            [request setAllHTTPHeaderFields:headers];


            [request setHTTPMethod:@"GET"];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request

            completionHandler:^(NSData *data, NSURLResponse *response, NSError
            *error) {
              if (error) {
                NSLog(@"%@", error);
                dispatch_semaphore_signal(sema);
              } else {
                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                NSError *parseError = nil;
                NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
                NSLog(@"%@",responseDictionary);
                dispatch_semaphore_signal(sema);
              }
            }];

            [dataTask resume];

            dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
        - lang: swift
          source: >-
            var request = URLRequest(url: URL(string:
            "https://rest.clicksend.com/v3/sms/inbound/{original_message_id}")!,timeoutInterval:
            Double.infinity)

            request.addValue("application/json", forHTTPHeaderField:
            "Content-Type")

            request.addValue("API_KEY", forHTTPHeaderField: "Authorization")


            request.httpMethod = "GET"


            let task = URLSession.shared.dataTask(with: request) { data,
            response, error in 
              guard let data = data else {
                print(String(describing: error))
                return
              }
              print(String(data: data, encoding: .utf8)!)
            }


            task.resume()
  /v3/sms/inbound-read:
    put:
      summary: Mark Inbound SMS as Read
      operationId: mark-inbound-sms-as-read
      description: >-
        Use this endpoint to mark all <a
        href="https://help.clicksend.com/article/ik4hw5xu35-can-i-receive-inbound-sms-to-my-url"
        target="_blank">inbound SMS</a> as read. Inbound SMS that has been
        marked as read won’t be shown in the **View Inbound SMS** endpoint. You
        can still use the **View Specific Inbound SMS** endpoint to view inbound
        SMS marked as read. 

        In the request, you can optionally add a _date_before_ parameter to only
        mark inbound SMS sent before that date as read.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                date_before:
                  type: integer
                  description: >-
                    The cutoff date. Inbound SMS sent before this time will be
                    marked as read. It’s in the <a
                    href="http://help.clicksend.com/what-is-a-unix-timestamp"
                    target="_blank">Unix format.</a>
              example:
                date_before: '1961900166'
      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/mark-inbound-sms-as-read'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

                 --header "Content-Type: application/json" \
                 --data-binary "    {
                    \"date_before\":1442398100
                }" \
            'https://rest.clicksend.com/v3/sms/inbound-read'
        - 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\SMSApi(new
            GuzzleHttp\Client(),$config);

            // \ClickSend\Model\DateBefore | DateBefore model

            $date_before = new \ClickSend\Model\DateBefore(); 

            $date_before->setDateBefore("2019-01-01");


            try {
                $result = $apiInstance->smsInboundReadPut($date_before);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsInboundReadPut: ', $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 smsApi = new SMSApi(configuration);
            var response = smsApi.SmsInboundReadPut(TIME_STAMP);
        - lang: Java
          source: |-
            package ClickSend;

            import java.math.BigDecimal;
            import ClickSend.Api.SmsApi;
            import ClickSend.Model.DateBefore;

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


            var smsApi = new api.SMSApi("USERNAME", "API_KEY");


            var messageId = "message_id";


            smsApi.smsInboundReadByMessageIdPut(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::SMSApi.new

            opts = {
              # Integer | An optional timestamp - mark all as read before this timestamp.
              # If not given, all messages will be marked as read.
              "date_before": "1543606584"
            }

            begin
              # Mark inbound SMS as read
              result = api_instance.sms_inbound_read_put(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_inbound_read_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.SMSApi(clicksend_client.ApiClient(configuration))

            date_before = 'date_before_example' 

            # str | An optional timestamp - mark all as read before this
            timestamp.

            # If not given, all messages will be marked as read. (optional)


            try:
                # Mark inbound SMS as read
                api_response = api_instance.sms_inbound_read_put(date_before=date_before)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_inbound_read_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output = $api->sms_inbound_read_put('date_before' =>
            1442398100);


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

            #import "CSDateBefore.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];



            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];


            CSDateBefore *dateBefore = [[CSDateBefore alloc] init];


            [smsAPI smsInboundReadPutWithDateBefore:dateBefore
            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]
            }


            SMSAPI.smsInboundReadPut { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/inbound-read/{message_id}:
    put:
      summary: Mark Specific Inbound SMS Message As Read
      operationId: mark-specific-inbound-sms-message-as-read
      description: >-
        Use this endpoint to mark a specific <a
        href="https://help.clicksend.com/article/ik4hw5xu35-can-i-receive-inbound-sms-to-my-url"
        target="_blank">inbound SMS</a> as read. Unlike the **View Inbound SMS**
        endpoint, which marks all inbound SMS as read, 

        this endpoint only marks one specified inbound SMS. Specify the SMS to
        be marked as read by providing its _message_id_.
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: message_id
          description: |-
            The message_id of the inbound SMS to mark as read.

            <div class="info-box">
              <h4><i class="fas fa-info-circle"></i> Note:</h4>
              <p>
                When you receive an inbound message, you will get two parameters: <em>original_message_id</em> and <em>message_id</em>:
              </p>
              <ul>
                <li><em>original_message_id</em>: This is the ID of the outbound message sent to the recipient</li>
                <li><em>message_id</em>: This is the ID of the inbound message sent by the recipient.</li>
              </ul>
            </div>
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/mark-specific-inbound-sms-message-as-read'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \
            'https://rest.clicksend.com/v3/sms/inbound-read/{message_id}'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

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

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


            $message_id = "{message_id}";


            try {
                $result = $apiInstance->smsInboundReadByMessageIdPut($message_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsInboundReadByMessageIdPut: ', $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 messageId = 'message_id';
            var smsApi = new SMSApi(configuration);
            var response = smsApi.SmsInboundReadByMessageIdPut(messageId);
        - lang: Java
          source: |+
            package ClickSend;

            import java.math.BigDecimal;
            import ClickSend.Api.SmsApi;

            public class mark_specific_inbound_sms_as_read {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                SmsApi apiInstance = new SmsApi(defaultClient);

                try {
                    String result = apiInstance.smsInboundReadByMessageIdPut(messageId);

                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling SmsApi#smsInboundReadByMessageIdPut");
                    e.printStackTrace();
                }
              }
            }

        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var smsApi = new api.SMSApi("USERNAME", "API_KEY");


            smsApi.smsInboundReadByMessageIdPut(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::SMSApi.new

            message_id = 'message_id';

            begin
              # Mark an inbound sms as read
              result = api_instance.sms_inbound_read_by_message_id_put(message_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_inbound_read_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.SMSApi(clicksend_client.ApiClient(configuration))


            message_id = 'message_id' 


            try:
                # Mark specific inbound sms as read
                api_response = api_instance.sms_inbound_read_by_message_id_put(message_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_inbound_read_by_message_id_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $message_id = 'message_id';


            my $json_output =
            $api->sms_inbound_read_by_message_id_put($message_id);


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];


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


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


            SMSAPI.smsInboundReadByMessageIdPut(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("bad json")
                    }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/{message_id}/cancel:
    put:
      summary: Cancel SMS
      operationId: cancel-sms
      description: >-
        Use this endpoint to cancel a specific scheduled SMS. Unlike the
        **Cancel All SMS** endpoint, which cancels all scheduled SMS, this
        endpoint only cancels one specified scheduled SMS. 

        Specify the scheduled SMS to cancel by providing its _message_id_.
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: message_id
          description: The _message_id_ of the scheduled SMS to cancel.
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cancel-sms'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

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

            $message_id = "messageId_example"; // string | The message ID you
            want to cancel


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

            import ClickSend.Api.SmsApi;

            public class cancel_sms {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                SmsApi apiInstance = new SmsApi(defaultClient);
                // String | The message ID you want to cancel
                String messageId = "messageId_example"; 
                try {
                    String result = apiInstance.smsCancelByMessageIdPut(messageId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling SmsApi#smsCancelByMessageIdPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var messageId = "message_id";

            smsApi.smsCancelByMessageIdPut(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::SMSApi.new


            message_id = "307EF035-B7CE-4321-93CD-0753597B7293" # String | The
            message ID you want to cancel


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

            message_id = 'F2E5C026-24C2-4D9F-B87C-6E78E0E8535D' # str | The
            message ID you want to cancel


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


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output = $api->sms_cancel_by_message_id_put('message_id' =>
            'XXXXXXXXX-XX-XX-XX-XXXXXX');


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

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


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


            SMSAPI.smsCancelByMessageIdPut(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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/cancel-all:
    put:
      summary: Cancel All SMS
      operationId: cancel-all-sms
      description: >-
        Use this endpoint to cancel all scheduled SMS. To cancel only one
        scheduled SMS, use the **Cancel SMS** endpoint.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                custom_string:
                  type: string
                  description: >-
                    The scheduled messages to cancel with the specified
                    _custom_string_. When you send an SMS, you can add an
                    optional _custom_string_ to it. This parameter allows you to
                    cancel messages that have this _custom_string_.


                    It's commonly used for canceling scheduled [SMS
                    campaigns](/messaging/sms-campaigns/). When you send an SMS
                    campaign, the system automatically adds a _custom_string_ to
                    each message, and this parameter lets you cancel only those
                    specific messages.
      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/cancel-all-sms'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

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


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

            import ClickSend.Api.SmsApi;

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

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            smsApi.smsCancelAllPut().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::SMSApi.new

            begin
              # Update all scheduled message as cancelled
              result = api_instance.sms_cancel_all_put
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_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.SMSApi(clicksend_client.ApiClient(configuration))


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


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


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


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc]init];

            [smsAPI smsCancelAllPutWithCompletionHandler:^(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]
            }


            SMSAPI.smsCancelAllPut { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/templates:
    get:
      summary: View SMS Templates
      operationId: view-sms-templates
      description: >-
        Use this endpoint to retrieve <a
        href="https://help.clicksend.com/article/9z9uloaz8y-sms-templates-for-different-industries"
        target="_blank">SMS templates</a>. You can filter the SMS templates
        result using the query parameters.
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: page
          in: query
          description: >-
            The page number to retrieve. Use this parameter to navigate through
            the [pagination](/#pagination) results. The default value is 1.
          schema:
            type: integer
            default: 1
            example: 1
        - name: limit
          in: query
          description: >-
            The number of items to return per page. This parameter controls the
            size of each page of results. The default value is 15.
          schema:
            type: integer
            minimum: 15
            maximum: 100
            default: 15
            example: 15
        - name: q
          in: query
          schema:
            type: string
            default: field_name
          description: >-
            Allows filtering of results based on your search criteria. The query
            should be in the format `field_name:value`.


            1. **Field Name**: The field within the SMS history you want to
            filter by. You can use the following fields:

              - _template_id_ : The ID of the template
              - _template_name_ : The name of the template
              - _body_ : The body content of the template.
                    
            2. **Value**: The text or keyword you're searching for within the
            specified field. If left empty after the colon, the filter will look
            for all templates with any value in the **Field Name**.    


            For example, if you are searching for the template with the name of
            _sample_name_, the final query would look like this: 

              `q=template_name:sample_name`

            <div class="info-box">
              <h4><i class="fas fa-info-circle"></i> Note:</h4>
              <div>
               <p>Some characters have to be encoded. For example, if you are searching for SMS sent from the phone number +61437085284, your search query q would be:<br/></p>
                <ul>
                  <li>q=from:%2B61437085284</li>
                </ul>
                <p>You can use the <a href="https://www.urlencoder.org/" target="_blank">URL encoder</a> to encode the text. If a character is not an alphanumeric character (A-Z, a-z, 0-9), it is typically either reserved or unsafe and should be encoded.</p>
              </div>
            </div>
        - name: order_by
          in: query
          schema:
            type: string
            default: template_id:asc
          description: >-
            Specifies the field and order to sort the results by. 

            The value is composed of the field name followed by a colon and the
            sort direction (_asc_ for ascending or _desc_ for descending). 

            The default sort order is by _template_id_ in ascending order. You
            can use the following fields:    


            - _template_id_ : The ID of the Template

            - _template_name_ : The name of the Template

            - _body_ : The body content of the Template


            For example, if you want to order by the _template_id_ in descending
            order, the query would look like this:

              `order_by=template_id:desc`
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-sms-templates'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

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

            $page = 1; // int | Page number

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


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

            import ClickSend.Api.SmsApi;

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

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var page = 1;
            var limit = 10;

            smsApi.smsTemplatesGet(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::SMSApi.new

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

            begin
              # Get lists of all sms templates
              result = api_instance.sms_templates_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_templates_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.SMSApi(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 lists of all sms templates
                api_response = api_instance.sms_templates_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_templates_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output = $api->sms_templates_get('page' => '1', 'limit' =>
            '2');


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc]init];

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


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


            SMSAPI.smsTemplatesGet { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    post:
      summary: Create SMS Template
      operationId: create-sms-template
      description: >-
        Use this endpoint to create a SMS template that you can use for sending
        SMS.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                template_name:
                  type: string
                  description: The name of the template.
                  example: Template 501916
                body:
                  type: string
                  description: "body\tString\tThe main content of your template."
              example:
                template_name: Template 501916
                body: "This is a test template.\r\nnew line 漢字 here."
      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/create-sms-template'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \

                 --data-binary "    {
                    \"template_name\":\"Template 501916\",
                    \"body\":\"This is a sample content: H7YI68B3yk for this template.\"
                }" \
            'https://rest.clicksend.com/v3/sms/templates'
        - 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\SMSApi(new
            GuzzleHttp\Client(),$config);

            $sms_template = new \ClickSend\Model\SmsTemplate(); //
            \ClickSend\Model\SmsTemplate | SmsTemplate model

            $sms_template->setTemplateName("Template 501916");

            $sms_template->setBody("This is a sample content: H7YI68B3yk for
            this template.");


            try {
                $result = $apiInstance->smsTemplatesPost($sms_template);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsTemplatesPost: ', $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 smsApi = new SMSApi(configuration);
            var response = smsApi.SmsTemplatesPost(new SmsTemplate(
                templateName: "Template Name",
                body: "This is body"
            ));
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.SmsApi;
            import ClickSend.Model.SmsTemplate;

            public class create_sms_template {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                SmsApi apiInstance = new SmsApi(defaultClient);
                SmsTemplate smsTemplate = new SmsTemplate(); // SmsTemplate | SmsTemplate model
                smsTemplate.body("body");
                smsTemplate.templateName("name");
                try {
                    String result = apiInstance.smsTemplatesPost(smsTemplate);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling SmsApi#smsTemplatesPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var smsTemplate = new api.SmsTemplate();

            smsTemplate.templateName = "Template 501916";
            smsTemplate.body = "template body";

            smsApi.smsTemplatesPost(smsTemplate).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::SMSApi.new

            # SmsTemplate | SmsTemplate model
            sms_template = ClickSendClient::SmsTemplate.new(
              "template_name": "template_name",
              "body": "body"
            )

            begin
              # Create sms template
              result = api_instance.sms_templates_post(sms_template)
              p result
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_templates_post: #{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.SMSApi(clicksend_client.ApiClient(configuration))

            # SmsTemplate | SmsTemplate model

            sms_template = clicksend_client.SmsTemplate(
                              template_name="Template 501916",
                              body="This is a sample content: H7YI68B3yk for this template.") 

            try:
                # Create sms template
                api_response = api_instance.sms_templates_post(sms_template)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_templates_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;

            use WWW::ClickSendClient::Object::SmsTemplate;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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

            my %params = (
                'template_name' => 'template_name',
                'body'          => 'body'
            );


            my $sms_template_obj =
            WWW::ClickSendClient::Object::SmsTemplate->new(%params);

            my $json_output = $api->sms_templates_post('sms_template' =>
            $sms_template_obj);


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

            #import "CSSmsTemplate.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

            CSSmsTemplate *smsTemplate =  [[CSSmsTemplate alloc] init];

            smsTemplate.templateName = @"Template Chocolate";

            smsTemplate.body = @"Chocolate bar icing icing oat cake carrot cake
            jelly cotton MWEvciEPIr.";


            [smsAPI smsTemplatesPostWithSmsTemplate:smsTemplate
            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]
            }


            SMSAPI.smsTemplatesPost(smsTemplate: smsTemplate) { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/templates/{template_id}:
    get:
      summary: View a Specific SMS Template
      operationId: view-a-specific-sms-template
      description: >-
        Use this endpoint to retrieve a <a
        href="https://help.clicksend.com/article/9z9uloaz8y-sms-templates-for-different-industries"
        target="_blank">SMS template</a>. Specify which template to retrieve
        using the template ID.
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: template_id
          in: path
          description: The ID of the template to retrieve
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-a-specific-sms-template'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --location --globoff
            'https://rest.clicksend.com/v3/sms/templates/{{templateId}}' \

            --header 'Content-Type: application/json' \

            --header 'Authorization: [API_KEY]'
        - lang: PHP
          source: |
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, array(
                CURLOPT_URL => 'https://rest.clicksend.com/v3/sms/templates/{{templateId}}',
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'GET',
                CURLOPT_HTTPHEADER => array(
                    'Content-Type: application/json',
                    'Authorization: [API_KEY]'
                ),
            ));

            $response = curl_exec($curl);

            curl_close($curl);
            echo $response;
        - lang: C#
          source: >-
            var client = new HttpClient();

            var request = new HttpRequestMessage(HttpMethod.Get,
            "https://rest.clicksend.com/v3/sms/templates/{{templateId}}");

            request.Headers.Add("Authorization", [API_KEY]);

            var content = new StringContent(string.Empty);

            content.Headers.ContentType = new
            MediaTypeHeaderValue("application/json");

            request.Content = content;

            var response = await client.SendAsync(request);

            response.EnsureSuccessStatusCode();

            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: Java
          source: |
            OkHttpClient client = new OkHttpClient().newBuilder()
              .build();
            MediaType mediaType = MediaType.parse("application/json");
            RequestBody body = RequestBody.create(mediaType, "");
            Request request = new Request.Builder()
              .url("https://rest.clicksend.com/v3/sms/templates/{{templateId}}")
              .method("GET", body)
              .addHeader("Content-Type", "application/json")
              .addHeader("Authorization", [API_KEY])
              .build();
            Response response = client.newCall(request).execute();
        - lang: Node.js
          source: |
            const axios = require("axios");

            let config = {
              method: "get",
              maxBodyLength: Infinity,
              url: "https://rest.clicksend.com/v3/sms/templates/{{templateId}}",
              headers: {
                "Content-Type": "application/json",
                Authorization: [API_KEY],
              },
            };

            axios
              .request(config)
              .then((response) => {
                console.log(JSON.stringify(response.data));
              })
              .catch((error) => {
                console.log(error);
              });
        - lang: Ruby
          source: >
            require "uri"

            require "json"

            require "net/http"


            url =
            URI("https://rest.clicksend.com/v3/sms/templates/{{templateId}}")


            https = Net::HTTP.new(url.host, url.port)

            https.use_ssl = true


            request = Net::HTTP::Get.new(url)

            request["Content-Type"] = "application/json"

            request["Authorization"] = [API_KEY]


            response = https.request(request)

            puts response.read_body
        - lang: Python
          source: >
            import http.client

            import json


            conn = http.client.HTTPSConnection("rest.clicksend.com")

            payload = ''

            headers = {
              'Content-Type': 'application/json',
              'Authorization': [API_KEY]
            }

            conn.request("GET", "/v3/sms/templates/{{templateId}}", payload,
            headers)

            res = conn.getresponse()

            data = res.read()

            print(data.decode("utf-8"))
        - lang: objc
          source: >
            #import <Foundation/Foundation.h>


            dispatch_semaphore_t sema = dispatch_semaphore_create(0);


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://rest.clicksend.com/v3/sms/templates/%7B%7BtemplateId%7D%7D"]
              cachePolicy:NSURLRequestUseProtocolCachePolicy
              timeoutInterval:10.0];
            NSDictionary *headers = @{
              @"Content-Type": @"application/json",
              @"Authorization": @[API_KEY]
            };


            [request setAllHTTPHeaderFields:headers];


            [request setHTTPMethod:@"GET"];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request

            completionHandler:^(NSData *data, NSURLResponse *response, NSError
            *error) {
              if (error) {
                NSLog(@"%@", error);
                dispatch_semaphore_signal(sema);
              } else {
                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                NSError *parseError = nil;
                NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
                NSLog(@"%@",responseDictionary);
                dispatch_semaphore_signal(sema);
              }
            }];

            [dataTask resume];

            dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
    put:
      summary: Update SMS Template
      operationId: update-sms-template
      description: >-
        Use this endpoint to update a <a
        href="https://help.clicksend.com/article/9z9uloaz8y-sms-templates-for-different-industries"
        target="_blank">SMS template</a>.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                template_name:
                  type: string
                  description: The new name of the template.
                  example: Template 501916
                body:
                  type: string
                  description: The new content of your template.
              example:
                template_name: Template XYZ
                body: This is a new update template
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: template_id
          description: The ID of the template to update.
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-sms-template'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \
                 --header "Content-Type: application/json" \

                 --data-binary "    {
                    \"template_name\":\"I am updated\",
                    \"body\":\"This is a sample content: Sc0KNWgSMG for this template.\"
                }" \
            'https://rest.clicksend.com/v3/sms/templates/{template_id}'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

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

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

            $template_id = 26030; // int | Template id

            $sms_template = new \ClickSend\Model\SmsTemplate(); //
            \ClickSend\Model\SmsTemplate | Template item

            $sms_template->setTemplateName("Template 501916");

            $sms_template->setBody("This is a sample content: H7YI68B3yk for
            this template.");


            try {
                $result = $apiInstance->smsTemplatesByTemplateIdPut($template_id, $sms_template);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsTemplatesByTemplateIdPut: ', $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 smsApi = new SMSApi(configuration);

            var response = smsApi.SmsTemplatesByTemplateIdPut(TEMPLATE_ID,new
            SmsTemplate(
                templateName: "Template Name",
                body: "This is body"
            ));
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.SmsApi;
            import ClickSend.Model.SmsTemplate;

            public class update_sms_template {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                SmsApi apiInstance = new SmsApi(defaultClient);
                Integer templateId = 24868; // Integer | Template id
                SmsTemplate smsTemplate = new SmsTemplate(); // SmsTemplate | Template item
                smsTemplate.body("template body");
                smsTemplate.templateName("template name");
                try {
                    String result = apiInstance.smsTemplatesByTemplateIdPut(templateId, smsTemplate);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling SmsApi#smsTemplatesByTemplateIdPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var smsApi = new api.SMSApi("USERNAME", "API_KEY");


            var smsTemplate = new api.SmsTemplate();


            smsTemplate.template_name = "Template 501916";

            smsTemplate.body = "template body";


            templateId = 25411;


            smsApi.smsTemplatesByTemplateIdPut(templateId,
            smsTemplate).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::SMSApi.new

            template_id = 56 # Integer | Template id

            # SmsTemplate | SmsTemplate model
            sms_template = ClickSendClient::SmsTemplate.new(
              "template_name": "template_name",
              "body": "body"
            )

            begin
              # Update sms template
              result = api_instance.sms_templates_by_template_id_put(template_id, sms_template)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_templates_by_template_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.SMSApi(clicksend_client.ApiClient(configuration))

            template_id = 24140 # int | Template id

            sms_template = clicksend_client.SmsTemplate(
                            template_name="I am updated",
                            body="This is a sample content: Sc0KNWgSMG for this template.") # SmsTemplate | Template item

            try:
                # Update sms template
                api_response = api_instance.sms_templates_by_template_id_put(template_id, sms_template)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_templates_by_template_id_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;

            use WWW::ClickSendClient::Object::SmsTemplate;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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

            my %params = (
                'template_name' => 'template_name',
                'body'          => 'body'
            );


            my $sms_template_obj =
            WWW::ClickSendClient::Object::SmsTemplate->new(%params);

            my $json_output =
            $api->sms_templates_by_template_id_put('sms_template' =>
            $sms_template_obj ,'template_id' => '12345');


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

            #import "CSSmsTemplate.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];



            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];


            NSNumber *templateId = [NSNumber numberWithInt:0];


            CSSmsTemplate *smsTemplate =  [[CSSmsTemplate alloc] init];

            smsTemplate.templateName = @"Template Chocolate";

            smsTemplate.body = @"Chocolate bar icing icing oat cake carrot cake
            jelly cotton MWEvciEPIr.";


            [smsAPI smsTemplatesByTemplateIdPutWithTemplateId:templateId
            smsTemplate:smsTemplate 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 smsTemplate = SmsTemplate(
                templateName: "Template Chocolate", 
                body: "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr."
            )


            SMSAPI.smsTemplatesByTemplateIdPut(templateId: 25212, smsTemplate:
            smsTemplate) { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    delete:
      summary: Delete SMS Template
      operationId: delete-sms-template
      description: >-
        Use this endpoint to delete a <a
        href="https://help.clicksend.com/article/9z9uloaz8y-sms-templates-for-different-industries"
        target="_blank">SMS template</a>. Specify the SMS template to delete by
        providing its _template_id_.
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: template_id
          in: path
          description: The ID of the template to delete.
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-sms-template'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request DELETE \

            'https://rest.clicksend.com/v3/sms/templates/{template_id}'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

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

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

            $template_id = 24140; // int | Template id


            try {
                $result = $apiInstance->smsTemplatesByTemplateIdDelete($template_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsTemplatesByTemplateIdDelete: ', $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 smsApi = new SMSApi(configuration);
            var response = smsApi.SmsTemplatesByTemplateIdDelete(TEMPLATE_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.SmsApi;

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


            var smsApi = new api.SMSApi("USERNAME", "API_KEY");


            templateId = 25411;


            smsApi.smsTemplatesByTemplateIdDelete(templateId).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::SMSApi.new

            template_id = 25 # Integer | Template id

            begin
              # Delete sms template
              result = api_instance.sms_templates_by_template_id_delete(template_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_templates_by_template_id_delete: #{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.SMSApi(clicksend_client.ApiClient(configuration))

            template_id = 24490 # int | Template id


            try:
                # Delete sms template
                api_response = api_instance.sms_templates_by_template_id_delete(template_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SMSApi->sms_templates_by_template_id_delete: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output =
            $api->sms_templates_by_template_id_delete('template_id' => '12345');


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];



            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];


            NSNumber *templateId = [NSNumber numberWithInt:0];


            [smsAPI smsTemplatesByTemplateIdDeleteWithTemplateId:templateId
            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]
            }


            SMSAPI.smsTemplatesByTemplateIdDelete(templateId: 25212) {
            (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/sms/history:
    get:
      summary: View SMS History
      operationId: view-sms-history
      description: >-
        Use this endpoint to view previously sent SMS. You can filter the SMS
        history result using the query parameters.
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: page
          in: query
          description: >-
            The page number to retrieve. Use this parameter to navigate through
            the [pagination](/#pagination) results. The default value is 1.
          schema:
            type: integer
            default: 1
            example: 1
        - name: limit
          in: query
          description: >-
            The number of items to return per page. This parameter controls the
            size of each page of results. The default value is 15.
          schema:
            type: integer
            minimum: 15
            maximum: 100
            default: 15
            example: 15
        - name: q
          in: query
          description: >-
            Allows filtering of results based on your search criteria. The query
            should be in the format `field_name:value`.


            1. **Field Name**: The field within the SMS history you want to
            filter by. You can use the following fields:
                
                - _Status_: The status of the SMS. Available values for status are: Queued, Completed, Scheduled, WaitApproval, Failed, Cancelled, CancelledAfterReview, Received, Sent.
                    
                - _To_: The recipient of the SMS.
                    
                - _from_: The sender of the SMS.
                    
                - _subaccount_id_: The sub-account identifier.
                    
                - _message_id_: The ID of your SMS.
                    
            2. **Value**: The text or keyword you're searching for within the
            specified field. If left empty after the colon, the filter will look
            for all templates with any value in the **Field Name**.           


            For example, if you are searching for a SMS with the status of
            Scheduled, the final query would look like this:

              `q=status:Scheduled`

            <div class="info-box">
              <h4><i class="fas fa-info-circle"></i> Note:</h4>
              <div>
               <p>Some characters have to be encoded. For example, if you are searching for SMS sent from the phone number +61437085284, your search query q would be:<br/></p>
                <ul>
                  <li>q=from:%2B61437085284</li>
                </ul>
                <p>You can use the <a href="https://www.urlencoder.org/" target="_blank">URL encoder</a> to encode the text. If a character is not an alphanumeric character (A-Z, a-z, 0-9), it is typically either reserved or unsafe and should be encoded.</p>
              </div>
            </div>
          schema:
            type: string
            default: field_name
        - name: order_by
          in: query
          schema:
            type: string
            default: date:asc
          description: >-
            Specifies the field and order to sort the results by. The value is
            composed of the field name followed by a colon and the sort
            direction (_asc_ for ascending or _desc_ for descending). 

            The default sort order is by _date_ in ascending order. You can use
            the following fields:

              - _date_
              - _username_
              - _from_ 
              - _to_
              - _status_
              - _body_

            For example, if you want to order by the most recently sent SMS, you
            should sort by date in descending order. The query would look like
            this:

              `order_by=date:desc`
        - name: date_from
          in: query
          schema:
            type: integer
          description: >-
            Start date to filter results. It should be in <a
            href="http://help.clicksend.com/what-is-a-unix-timestamp"
            target="_blank">Unix format</a>.
        - name: date_to
          in: query
          schema:
            type: integer
          description: >-
            End date to filter results. It should be in <a
            href="http://help.clicksend.com/what-is-a-unix-timestamp"
            target="_blank">Unix format</a>.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-sms-history'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

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

            $q = "q_example"; // string | Custom query Example:
            from:{number},status_code:201.

            $date_from = '1436879372'; // int | Start date

            $date_to = '1436879372'; // int | End date

            $page = 1; // int | Page number

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


            try {
                $result = $apiInstance->smsHistoryGet($q, $date_from, $date_to, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsHistoryGet: ', $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 smsApi = new SMSApi(configuration);


            var q = "q_example";

            var dateFrom = '1436879372';

            var dateTo = '1436879372';

            var page = 1;

            var limit = 10;


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

            import ClickSend.Api.SmsApi;

            public class view_sms_history {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                SmsApi apiInstance = new SmsApi(defaultClient);
                // String | Custom query Example: from:{number},status_code:201.
                String q = "q_example"; 
                Integer dateFrom = 1436879372; // Integer | Start date
                Integer dateTo = 1436879372; // Integer | End date
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                  String result = apiInstance.smsHistoryGet(q, dateFrom, dateTo, page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling SmsApi#smsHistoryGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var smsApi = new api.SMSApi("USERNAME", "API_KEY");


            var q = "q_example";

            var dateFrom = '1436879372';

            var dateTo = '1436879372';

            var page = 1;

            var limit = 10;


            smsApi.smsHistoryGet(q, 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::SMSApi.new

            opts = {
              date_from: 1436849372, # Integer | Start date
              date_to: 1436879372,   # Integer | End date
              page: 1,       # Integer | Page number
              limit: 10      # Integer | Number of records per page
            }

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

            date_from = 1436879372 # int | Start date (optional)

            date_to = 1436879372 # int | End 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 sms history
                api_response = api_instance.sms_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 SMSApi->sms_history_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SMSApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my $json_output = $api->sms_history_get('date_from' =>
            '1436879372','date_to' => '1446879372' , 'page'  => '1','limit'=>
            '20');


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];



            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];


            NSNumber *dateFromTimestamp = [NSNumber numberWithInt:1436849372];

            NSNumber *dateToTimestamp = [NSNumber numberWithInt:1436879372];


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


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


            SMSAPI.smsHistoryGet { (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/sms/history/export:
    get:
      summary: Export SMS History
      operationId: export-sms-history
      description: >-
        Use this endpoint to create a download link of your SMS history. You can
        filter the SMS history result using the query parameters.
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: filename
          description: The filename of the result. It should be in the .csv format.
          in: query
          schema:
            type: string
            default: export.csv
        - name: page
          in: query
          description: >-
            The page number to retrieve. Use this parameter to navigate through
            the [pagination](/#pagination) results. The default value is 1.
          schema:
            type: integer
            default: 1
            example: 1
        - name: limit
          in: query
          description: >-
            The number of items to return per page. This parameter controls the
            size of each page of results. The default value is 15.
          schema:
            type: integer
            minimum: 15
            maximum: 100
            default: 15
            example: 15
        - name: q
          in: query
          description: >-
            Allows filtering of results based on your search criteria. The query
            should be in the format `field_name:value`.


            1. **Field Name**: The field within the SMS history you want to
            filter by. You can use the following fields:
                
                - _Status_: The status of the SMS. Available values for status are: Queued, Completed, Scheduled, WaitApproval, Failed, Cancelled, CancelledAfterReview, Received, Sent.
                    
                - _To_: The recipient of the SMS.
                    
                - _from_: The sender of the SMS.
                    
                - _subaccount_id_: The sub-account identifier.
                    
                - _message_id_: The ID of your SMS.
                    
            2. **Value**: The text or keyword you're searching for within the
            specified field. If left empty after the colon, the filter will look
            for all templates with any value in the **Field Name**.           


            For example, if you are searching for a SMS with the status of
            _Scheduled_, the final query would look like this:

              `q=status:Scheduled`

            <div class="info-box">
              <h4><i class="fas fa-info-circle"></i> Note:</h4>
              <div>
              <p>Some characters have to be encoded. For example, if you are searching for SMS sent from the phone number +61437085284, your search query q would be:<br/></p>
                <ul>
                  <li>q=from:%2B61437085284</li>
                </ul>
                <p>You can use the <a href="https://www.urlencoder.org/" target="_blank">URL encoder</a> to encode the text. If a character is not an alphanumeric character (A-Z, a-z, 0-9), it is typically either reserved or unsafe and should be encoded.</p>
              </div>
            </div>
          schema:
            type: string
            default: field_name
        - name: order_by
          in: query
          schema:
            type: string
            default: date:asc
          description: >-
            Specifies the field and order to sort the results by. The value is
            composed of the field name followed by a colon and the sort
            direction (asc for ascending or desc for descending). 

            The default sort order is by date in ascending order. You can use
            the following fields:

              - _date_ 
              - _username_
              - _from_ 
              - _to_
              - _status_ 
              - _body_

            For example, if you want to order by the most recently sent SMS, you
            should sort by date in descending order. The query would look like
            this:

              `order_by=date:desc`
        - name: date_from
          in: query
          schema:
            type: integer
          description: >-
            Start date to filter results. It should be in <a
            href="http://help.clicksend.com/what-is-a-unix-timestamp"
            target="_blank">Unix format</a>.
        - name: date_to
          in: query
          schema:
            type: integer
          description: >-
            End date to filter results. It should be in <a
            href="http://help.clicksend.com/what-is-a-unix-timestamp"
            target="_blank">Unix format</a>.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/export-sms-history'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

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

            $filename = "filename_example"; // string | Filename to download
            history as


            try {
                $result = $apiInstance->smsHistoryExportGet($filename);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SMSApi->smsHistoryExportGet: ', $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 smsApi = new SMSApi(configuration);
            var response = smsApi.SmsHistoryExportGet("File Name");
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.SmsApi;

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

            var smsApi = new api.SMSApi("USERNAME", "API_KEY");

            var filename = "filename";

            smsApi.smsHistoryExportGet(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
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
            end


            api_instance = ClickSendClient::SMSApi.new


            filename = "filename_example" # String | Filename to download
            history as


            begin
              # Export all sms history
              result = api_instance.sms_history_export_get(filename)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SMSApi->sms_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.SMSApi(clicksend_client.ApiClient(configuration))

            filename = 'sms_history' # str | Filename to download history as


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


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


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


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

            [smsAPI smsHistoryExportGetWithFilename:@"string"
            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]
            }


            SMSAPI.smsHistoryExportGet(filename: "test.csv") { (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("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
