{
  "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.\n\nRelevant 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/en/articles/42195-unicode-vs-plain-text\" 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>.\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note :</h4>\n  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.\n</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.\n- **Want to leverage the default sender settings:**\n  - If the `senders` property is missing or left empty, the system uses the default sender settings configured for each recipient country.\n\n- **Want to override the default sender settings:**\n  - 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.\n  - 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.\n",
        "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`. \n\nIf the sender ID is an **alpha tag**, it must be between 3 and 11 characters long and contains only letters, numbers, and pluses.\n"
            },
            "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.\nThis is affected only when `sender_type` is set to `shared_longcode` to determine the appropriate number based on the sender’s geographic location.\nIf this field is not provided or left empty, it will default to the recipient's country code.\n"
            }
          }
        }
      },
      "shorten_urls": {
        "type": "boolean",
        "description": "This controls whether URLs are automatically shortened. This affects all messages in the request. You can either specify:\n\n- **True** - Automatically detects and shortens one URL on each message.\n- **False** - Leaves all URLs in their original form. This is the default value.\n\nYou 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>.\n\nMore info about shortening URLs <a href=\"/messaging/url-shortening/\"> here</a>.\n"
      },
      "sms_send_sms": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "description": "It can either be **in** or **out**:\n\n- **in** - You received a message. it has to do with inbound messages.\n    \n- **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:\n\n- 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.\n    \n- 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.\n    \n\nLonger 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": "string",
            "description": "The price of this message. This depends on the total number of parts of the message.",
            "example": "0.07"
          },
          "from_email": {
            "type": "string",
            "nullable": true,
            "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",
            "nullable": true,
            "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",
            "nullable": true,
            "description": "A note that was sent from the request.",
            "example": "this is a test"
          },
          "contact_id": {
            "type": "string",
            "nullable": true,
            "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:\n\n- **True** \\- if the sender is randomly selected.\n    \n- **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"
          },
          "min_recharge_amount": {
            "type": "string",
            "description": "The minimum amount that can be used to recharge the account, in this currency.",
            "example": "20.00"
          },
          "max_recharge_amount": {
            "type": "string",
            "description": "The maximum amount that can be used to recharge the account, in this currency.",
            "example": "10000.00"
          }
        }
      },
      "send-sms": {
        "type": "object",
        "properties": {
          "http_code": {
            "type": "integer",
            "description": "The HTTP code of the response. Visit [this page](/#status-codes) for more information.\n\nThis 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.\n\nMessages 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:\n\n- Receipient’s country not enabled for <a href=\"https://help.clicksend.com/article/qdavyt16qs-global-sending\">global sending</a>.\n    \n- **Sender ID** resitriction.\n    \n- Number registration restrcition.",
                "example": 0
              }
            }
          }
        }
      },
      "sms": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "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>.\nReturned as a string since it may be an empty string in price-calculation responses where\nno message has actually been sent yet.",
            "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:\n\n- 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.\n    \n- 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.\n    \n\nLonger 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": "string",
            "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": "string",
            "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:\n\n- **True** \\- if the sender is randomly selected.\n    \n- **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": "integer",
            "description": "The HTTP code of the response. Visit [this page](/#status-codes) for more information.\n\nThis 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.\n\nMessages 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:\n\n- **0:** No number or account registration required.\n    \n- **1:** Number registration required. You can purchase a registered number from ClickSend. Examples: US and CA.\n    \n- **2:** Account registration required. You can register your company details or business details to register your account. Examples: NZ, SG and UAE.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <p>This parameter is fixed and can't be changed based on your settings.</p>\n</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:\n\n- **True:** A **Sender ID** is available for you to use.\n    \n- **False:** No **Sender ID** is available for you to use.\n\n<div class=\"info-box\">\n    <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n    <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>\n</div>"
                            },
                            "selected": {
                              "type": "boolean",
                              "description": "Indicates whether you have enabled the global sending for this country:\n\n- **True:** You have selected this country for global sending and can send messages here.\n    \n- **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:\n\n- **0:** No number or account registration required.\n    \n- **1:** Number registration required. You can purchase a registered number from ClickSend. Examples: US and CA.\n    \n- **2:** Account registration required. You can register your company details or business details to register your account. Examples: NZ, SG and UAE.\n\nThis parameter is a duplicate of registration_type.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <p>This parameter is fixed and can't be changed based on your settings.</p>\n</div>"
                                },
                                "restricted_sending": {
                                  "type": "boolean",
                                  "description": "Indicates whether you have any restriction for sending the message to this country:\n\n- **True:** You're restricted from sending messages to this country, possibly due to not having a registered number.\n    \n- **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:\n\n- **True:** This country supports trial sending\n    \n- **False:** This country doesn’t support trial sending\n\nCountries with restricted sending typically offers trial sending. With trial sending, you can send messages to the country without registering your number or account.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <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>\n</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:\n\n- **0:** No number or account registration required.\n    \n- **1:** Number registration required. You can purchase a registered number from ClickSend. Examples: US and CA.\n    \n- **2:** Account registration required. You can register your company details or business details to register your account. Examples: NZ, SG and UAE.\n  \nThis parameter is a duplicate of registration_type. It determines which form you need for the global sending registration process.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <p>This parameter is static. Its value can’t change based on your settings.</p>\n</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:\n\n- Receipient’s country not enabled for global sending.\n    \n- Sender ID resitriction.\n    \n- 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.🚀\n\nwww.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:\n\n • No gambling or betting messages\n • No cryptocurrency messages\n • No messages relating to drugs, cannabis or CBD\n • No adult content, including personal ads, or messages related to sex work or prostitution\n • No personal messaging (commercial/business messaging only)\n",
                    "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.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <p>This parameter is only relevant to <a target=\"_blank\" href=\"/messaging/voice-messaging/\"><strong>Voice Messaging</strong></a> receipts.</p>\n</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.\n\nThis 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.\n\nThis 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.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <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>\n</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.\n\n<div class=\"warning-box\">\n  <h4><i class=\"fas fa-exclamation-triangle\"></i> Warning:</h4>\n  <p>This parameter is deprecated and will return <strong>null.</strong></p>\n</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.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <p>This parameter is only relevant to <a href=\"/messaging/voice-messaging/\"><strong>Voice Messaging</strong></a> receipts.</p>\n</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.\n\nThis 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.\n\n<div class=\"warning-box\">\n  <h4><i class=\"fas fa-exclamation-triangle\"></i> Warning:</h4>\n  <p>This parameter is deprecated and will return <strong>null</strong/>.</p>\n</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.\n\n<div class=\"warning-box\">\n  <h4><i class=\"fas fa-exclamation-triangle\"></i> Warning:</h4>\n  <p>This parameter is deprecated and will return the first word of the body message.</p>\n</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.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <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>\n</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.\n\n<div class=\"warning-box\">\n  <h4><i class=\"fas fa-exclamation-triangle\"></i> Warning:</h4>\n  <p>This parameter is deprecated and will return <strong>null.</strong></p>\n</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.\n\n<div class=\"warning-box\">\n  <h4><i class=\"fas fa-exclamation-triangle\"></i> Warning:</h4>\n  <p>This parameter is deprecated and will return <strong>null</strong/>.</p>\n</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.\n\nIf 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": "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."
          },
          "data": {
            "type": "object",
            "description": "The parameters related to the scheduled SMS.\n\n<div class=\"warning-box\">\n  <h4><i class=\"fas fa-exclamation-triangle\"></i> Warning:</h4>\n  <p>This parameter is deprecated and will return <strong>null</strong/>.</p>\n</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": "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": "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": "integer",
            "description": "The HTTP status code of the response.",
            "example": 200
          },
          "response_code": {
            "type": "string",
            "description": "The response code indicating the status of the operation.",
            "example": "SUCCESS"
          },
          "response_msg": {
            "type": "string",
            "description": "A message describing the outcome of the operation.",
            "example": "Here is your 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": "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 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.\n\n<div class=\"warning-box\">\n  <h4><i class=\"fas fa-exclamation-triangle\"></i> Warning:</h4>\n  <p>This parameter is deprecated and will return <strong>null</strong>.</p>\n</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:\n  - **in** - You received a message. it has to do with inbound messages.\n  - **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:\n\n- _Queued_\n- _Completed_\n- _Scheduled_\n- _WaitApproval_\n- _Failed_\n- _Cancelled_\n- _CancelledAfterReview_\n- _Received_\n- _Sent_\n\nThis parameter reflects the actual status of the SMS. It is based on the \nstatus of the SMS sent from the <a href=\"https://en.wikipedia.org/wiki/SMS_gateway\" target=\"_blank\">SMS gateway</a>, which is different \nfrom 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": "string",
                          "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": "string",
                          "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": "string",
                          "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": "string",
                          "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
                        },
                        "message_price": {
                          "type": "string",
                          "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. \nThe 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. \nYou 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:  \n\n- 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.  \n    \n- 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.  \n    \nLonger 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.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <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>\n</div>\n"
                        },
                        "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:\n- **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.\n- **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>).\n- **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>.\n- **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.\nIf 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.\n\n<div class=\"warning-box\">\n  <h4><i class=\"fas fa-exclamation-triangle\"></i> Warning:</h4>\n  <p>This parameter is no longer in use.</p>\n</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:\n\n- **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.\n    \n- **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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request POST \\\n     --header \"Content-Type: application/json\" \\\n\n     --data-binary \"    {\n        \\\"messages\\\":[\n            {\n                \\\"source\\\":\\\"php\\\",\n                \\\"body\\\":\\\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\\\",\n                \\\"to\\\":\\\"+61411111111\\\"\n            },\n            {\n                \\\"source\\\":\\\"php\\\",\n                \\\"body\\\":\\\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\\\",\n                \\\"to\\\":\\\"+61422222222\\\"\n            }\n        ]\n    }\" \\\n'https://rest.clicksend.com/v3/sms/send'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$msg = new \\ClickSend\\Model\\SmsMessage();\n$msg->setBody(\"test body\"); \n$msg->setTo(\"0451111111\");\n$msg->setSource(\"sdk\");\n\n// \\ClickSend\\Model\\SmsMessageCollection | SmsMessageCollection model\n$sms_messages = new \\ClickSend\\Model\\SmsMessageCollection(); \n$sms_messages->setMessages([$msg]);\n\ntry {\n    $result = $apiInstance->smsSendPost($sms_messages);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsSendPost: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\n\nvar listOfSms = new List<SmsMessage>\n{\n    new SmsMessage(\n        to: \"+61411111111\", \n        body: \"test message\", \n        source: \"sdk\"\n    )\n};\n\nvar smsCollection = new SmsMessageCollection(listOfSms);\nvar response = smsApi.SmsSendPost(smsCollection);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport ClickSend.Api.SmsApi;\nimport ClickSend.Model.SmsMessage;\nimport ClickSend.Model.SmsMessageCollection;\n\npublic class send_sms {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n\n    SmsMessage smsMessage=new SmsMessage();\n    smsMessage.body(\"body\");\n    smsMessage.to(\"to\");\n    smsMessage.source(\"source\");\n\n    List<SmsMessage> smsMessageList=Arrays.asList(smsMessage);\n    // SmsMessageCollection | SmsMessageCollection model\n    SmsMessageCollection smsMessages = new SmsMessageCollection();\n    smsMessages.messages(smsMessageList);\n    try {\n        String result = apiInstance.smsSendPost(smsMessages);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsSendPost\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar smsMessage = new api.SmsMessage();\n\nsmsMessage.source = \"sdk\";\nsmsMessage.to = \"+0451111111\";\nsmsMessage.body = \"test message\";\n\nvar smsCollection = new api.SmsMessageCollection();\n\nsmsCollection.messages = [smsMessage];\n\nsmsApi.smsSendPost(smsCollection).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\n# SmsMessageCollection | SmsMessageCollection model\nsms_messages = ClickSendClient::SmsMessageCollection.new\n\nsms_messages.messages = [\n  ClickSendClient::SmsMessage.new(\n    \"to\": \"+61411111111\",\n    \"source\": \"sdk\",\n    \"body\": \"body\"\n  ),\n  ClickSendClient::SmsMessage.new(\n    \"to\": \"+61422222222\",\n    \"source\": \"sdk\",\n    \"body\": \"body\"\n  )\n]\n\nbegin\n  # Send sms message(s)\n  result = api_instance.sms_send_post(sms_messages)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_send_post: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client import SmsMessage\nfrom clicksend_client.rest import ApiException\n\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\n\n# If you want to explictly set from, add the key _from to the message.\nsms_message = SmsMessage(source=\"php\",\n                        body=\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\",\n                        to=\"+61411111111\",\n                        schedule=1436874701)\n\nsms_messages = clicksend_client.SmsMessageCollection(messages=[sms_message])\n\ntry:\n    # Send sms message(s)\n    api_response = api_instance.sms_send_post(sms_messages)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_send_post: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\nuse WWW::ClickSendClient::Object::SmsMessageCollection;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy %params = (\n    'messages' => [\n        {\n            'source'        => 'perl',\n            'body'          => 'Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.',\n            'to'            => '+61411111111'\n        },\n        {\n            'source'        => 'perl',\n            'body'          => 'Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.',\n            'to'            => '+61422222222'\n        }\n    ]\n);\n\n#You can post up to 1000 messages\n\nmy $messages_obj = WWW::ClickSendClient::Object::SmsMessageCollection->new(%params);\nmy $json_output = $api->sms_send_post('sms_messages' => $messages_obj);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n#import \"CSSmsMessage.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSmsMessage *smsMessage1 = [[CSSmsMessage alloc] init];\nsmsMessage1.to = @\"+0451111111\";\nsmsMessage1.source = @\"objc\";\nsmsMessage1.body = @\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\";\n\nCSSmsMessage *smsMessage2 = [[CSSmsMessage alloc] init];\nsmsMessage2.listId = @\"1234\";\nsmsMessage2.source = @\"objc\";\nsmsMessage2.body = @\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\";\n\n\nCSSmsMessageCollection *smsMessageCollection = [[CSSmsMessageCollection alloc] init];\nsmsMessageCollection.messages = (NSArray<CSSmsMessage> *) @[smsMessage1, smsMessage2];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n[smsAPI smsSendPostWithSmsMessages:smsMessageCollection completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nlet message1 = SmsMessage(body: \"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\", \n                        to: \"+0451111111\", \n                        source: \"swift\")\n\nlet message2 = SmsMessage(body: \"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\", \n                        source: \"swift\", \n                        listId: 1234)\n\nlet smsCollection = SmsMessageCollection(messages: [message1, message2])\nSMSAPI.smsSendPost(smsMessages: smsCollection) { (dataString, error) in\n\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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:\n\n- 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.\n    \n- 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.\n    \nLonger 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.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <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>\n</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:\n\n- 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.\n    \n- 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>).\n    \n- 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>.\n    \n- 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.\n    \nIf 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.\n\n<div class=\"warning-box\">\n  <h4><i class=\"fas fa-exclamation-triangle\"></i> Warning:</h4>\n  <p>This parameter is no longer in use.</p>\n</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:\n\n - **True:** It will show the additional information.\n     \n - **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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request POST \\\n     --header \"Content-Type: application/json\" \\\n\n     --data-binary \"    {\n        \\\"messages\\\":[\n            {\n                \\\"source\\\":\\\"php\\\",\n                \\\"body\\\":\\\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\\\",\n                \\\"to\\\":\\\"+61411111111\\\"\n            },\n            {\n                \\\"source\\\":\\\"php\\\",\n                \\\"body\\\":\\\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\\\",\n                \\\"to\\\":\"+61422222222\"\n            }\n        ]\n    }\" \\\n'https://rest.clicksend.com/v3/sms/price'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$msg = new \\ClickSend\\Model\\SmsMessage();\n\n$msg->setBody(\"test body\"); \n$msg->setTo(\"0451111111\"); \n$msg->setSource(\"php-sdk\");\n\n// \\ClickSend\\Model\\SmsMessageCollection | SmsMessageCollection model\n$sms_messages = new \\ClickSend\\Model\\SmsMessageCollection(); \n$sms_messages->setMessages([$msg]);\n\ntry {\n    $result = $apiInstance->smsPricePost($sms_messages);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsPricePost: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\n\nvar listOfSms = new List<SmsMessage>\n{\n    new SmsMessage(\n        to: \"+61411111111\", \n        body: \"test message\", \n        source: \"sdk\"\n    )\n};\n\nvar smsCollection = new SmsMessageCollection(listOfSms);\nvar response = smsApi.SmsPricePost(smsCollection);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport ClickSend.Api.SmsApi;\nimport ClickSend.Model.SmsMessage;\nimport ClickSend.Model.SmsMessageCollection;\n\npublic class calculate_sms_price {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    SmsMessage smsMessage=new SmsMessage();\n    smsMessage.body(\"body\");\n    smsMessage.to(\"to\");\n    smsMessage.source(\"source\");\n\n    List<SmsMessage> smsMessageList=Arrays.asList(smsMessage);\n    // SmsMessageCollection | SmsMessageCollection model\n    SmsMessageCollection smsMessages = new SmsMessageCollection();\n    smsMessages.messages(smsMessageList);\n    try {\n        String result = apiInstance.smsPricePost(smsMessages);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsPricePost\");\n        e.printStackTrace();\n    }\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar smsMessage = new api.SmsMessage();\n\nsmsMessage.from = \"myNumber\";\nsmsMessage.to = \"+0451111111\";\nsmsMessage.body = \"test message\";\n\nvar smsCollection = new api.SmsMessageCollection();\n\nsmsCollection.messages = [smsMessage];\n\nsmsApi.smsPricePost(smsCollection).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nsms_messages = ClickSendClient::SmsMessageCollection.new # SmsMessageCollection | SmsMessageCollection model\n\nsms_messages.messages = [\n  ClickSendClient::SmsMessage.new(\n    \"source\": \"sdk\",\n    \"to\": \"+61411111111\",\n    \"body\": \"body\"\n  ),\n  ClickSendClient::SmsMessage.new(\n    \"source\": \"sdk\",\n    \"to\": \"+61422222222\",\n    \"body\": \"body\"\n  )\n]\n\nbegin\n  # Calculate sms price\n  result = api_instance.sms_price_post(sms_messages)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_price_post: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client import SmsMessage\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(\n  clicksend_client.ApiClient(configuration))\nsms_message = SmsMessage(source=\"php\",\n                        body=\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\",\n                        to=\"+61411111111\")\n# SmsMessageCollection | SmsMessageCollection model\nsms_messages = clicksend_client.SmsMessageCollection(messages=[sms_message]) \n\ntry:\n    # Calculate sms price\n    api_response = api_instance.sms_price_post(sms_messages)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_price_post: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\nuse WWW::ClickSendClient::Object::SmsMessageCollection;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy %params = (\n    'messages' => [\n        {\n            'source'        => 'perl',\n            'body'          => 'Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.',\n            'to'            => '+61411111111'\n        },\n        {\n            'source'        => 'perl',\n            'body'          => 'Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.',\n            'to'            => '+61422222222'\n        }\n    ]\n);\n\nmy $messages_obj = WWW::ClickSendClient::Object::SmsMessageCollection->new(%params);\nmy $json_output = $api->sms_price_post('sms_messages' => $messages_obj);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n#import \"CSSmsMessage.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSmsMessage *smsMessage1 = [[CSSmsMessage alloc] init];\nsmsMessage1.to = @\"+0451111111\";\nsmsMessage1.source = @\"objc\";\nsmsMessage1.body = @\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\";\n\nCSSmsMessage *smsMessage2 = [[CSSmsMessage alloc] init];\nsmsMessage2.listId = @\"1234\";\nsmsMessage2.source = @\"objc\";\nsmsMessage2.body = @\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\";\n\n\nCSSmsMessageCollection *smsMessageCollection = [[CSSmsMessageCollection alloc] init];\nsmsMessageCollection.messages = (NSArray<CSSmsMessage> *) @[smsMessage1, smsMessage2];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n[smsAPI smsPricePostWithSmsMessages:smsMessageCollection completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nlet message1 = SmsMessage(\n    body: \"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\", \n    to: \"+0451111111\", \n    source: \"swift\"\n)\n\nlet message2 = SmsMessage(\n    body: \"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\", \n    source: \"swift\", \n    listId: 1234, \n)\n\nlet smsCollection = SmsMessageCollection(messages: [message1, message2])\n\nSMSAPI.smsPricePost(smsMessages: smsCollection) { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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.\n\nAdditionally, 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  \nsystem, and then retrieve it with the **View SMS Receipt** endpoint\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <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/en/articles/43703-integration-guide-pipedream\">here</a>.</p>\n</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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request POST \\\n\n     --header \"Content-Type: application/json\" \\\n     --data-binary \"    {\n        \\\"url\\\":\\\"http://yourdomain.com\\\"\n    }\" \\\n'https://rest.clicksend.com/v3/sms/receipts'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$url = new \\ClickSend\\Model\\Url(); // \\ClickSend\\Model\\Url | Url model\n$url->setUrl(\"http://example.com\");\n\ntry {\n    $result = $apiInstance->smsReceiptsPost($url);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsReceiptsPost: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsReceiptsPost(new Url(\"http://domain.com\"));"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\nimport ClickSend.Model.Url;\n\npublic class create_sms_receipt {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    Url url = new Url(); // Url | Url model\n    url.url(\"http://www.example.com\");\n    try {\n        String result = apiInstance.smsReceiptsPost(url);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsReceiptsPost\");\n        e.printStackTrace();\n    }\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar payload = new api.Url;\n\npayload.url = \"http://example.com\";\n\nsmsApi.smsReceiptsPost(payload).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\n# Url | Url model\nurl = ClickSendClient::Url.new(\n  url: \"http://yourdomain.com\"\n)\n\nbegin\n  # Add a delivery receipt\n  result = api_instance.sms_receipts_post(url)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_receipts_post: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\nurl = 'https://www.example.com' # str | Your url\n\ntry:\n    # Add a delivery receipt\n    api_response = api_instance.sms_receipts_post({\"url\" : url})\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_receipts_post: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $url = WWW::ClickSendClient::Object::Url->new('http://yourdomain.com');\n\nmy $json_output = $api->sms_receipts_post($url);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\nCSUrl *csUrl = [[CSUrl alloc] init];\ncsUrl.url = @\"https://rest.clicksend.com/v3/sms/receipts\";\n\n[smsAPI smsReceiptsPostWithUrl:csUrl completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nlet url = Url(url: \"https://rest.clicksend.com/v3/sms/receipts\")\nSMSAPI.smsReceiptsPost(url: url) { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      },
      "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. \nTo be able to view receipts, add a <a href=\"https://help.clicksend.com/en/articles/42317-delivery-notifications-reports\" 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. \nControl [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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/sms/receipts'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$page = 1; // int | Page number\n$limit = 10; // int | Number of records per page\n\ntry {\n    $result = $apiInstance->smsReceiptsGet($page, $limit);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsReceiptsGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsReceiptsGet();"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\n\npublic class view_all_sms_receipt {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    Integer page = 1; // Integer | Page number\n    Integer limit = 10; // Integer | Number of records per page\n    try {\n        String result = apiInstance.smsReceiptsGet(page, limit);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsReceiptsGet\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar page = 1;\nvar limit = 10;\n\nsmsApi.smsReceiptsGet(page, limit).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\nClickSendClient.configure do |config|\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nopts = {\n  page: 1,  # Integer | Page number\n  limit: 10 # Integer | Number of records per page\n}\n\nbegin\n  # Get all delivery receipts\n  result = api_instance.sms_receipts_get(opts)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_receipts_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\npage = 1 # int | Page number (optional) (default to 1)\nlimit = 10 # int | Number of records per page (optional) (default to 10)\n\ntry:\n    # Get all delivery receipts\n    api_response = api_instance.sms_receipts_get(page=page, limit=limit)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_receipts_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_receipts_get('page' => '1', 'limit' => '1');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n[smsAPI smsReceiptsGetWithPage:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsReceiptsGet(page: 1, limit: 15) { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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. \nThis 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 receipt 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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/sms/receipts/{message_id}'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$message_id = \"messageId_example\"; // string | Message ID\n\ntry {\n    $result = $apiInstance->smsReceiptsByMessageIdGet($message_id);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsReceiptsByMessageIdGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsReceiptsByMessageIdGet(\"MESSAGE_ID\");"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\n\npublic class view_specific_sms_receipt {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    String messageId = \"message_id\"; // String | Message ID\n    try {\n        String result = apiInstance.smsReceiptsByMessageIdGet(messageId);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsReceiptsByMessageIdGet\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar messageId = \"message_id\";\n\nsmsApi.smsReceiptsByMessageIdGet(messageId).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nmessage_id = \"56A3964A-DC7D-4455-B56C-101F7A0D86DF\" # String | Message ID\n\nbegin\n  # Get a Specific Delivery Receipt\n  result = api_instance.sms_receipts_by_message_id_get(message_id)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_receipts_by_message_id_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\nmessage_id = 'message_id' # str | Message ID\n\ntry:\n    # Get a Specific Delivery Receipt\n    api_response = api_instance.sms_receipts_by_message_id_get(message_id)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_receipts_by_message_id_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_receipts_by_message_id_get('message_id' => 'XXX-XXXXXXX-XXXXX-XXXXX-XXXXXX');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n[apiInstance smsReceiptsByMessageIdGetWithMessageId:@\"{message_id}\" completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsReceiptsByMessageIdGet(messageId: \"{message_id}\") { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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. \nYou 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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request PUT \\\n\n     --header \"Content-Type: application/json\" \\\n     --data-binary \"{\n    \\\"date_before\\\": 1441958441\n}\" \\\n'https://rest.clicksend.com/v3/sms/receipts-read'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n// \\ClickSend\\Model\\DateBefore | DateBefore model\n$date_before = new \\ClickSend\\Model\\DateBefore(); \n$date_before->setDateBefore(\"2018-01-01\");\n\ntry {\n    $result = $apiInstance->smsReceiptsReadPut($date_before);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsReceiptsReadPut: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsReceiptsReadPut(new DateBefore(TIME_STAMP));"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport java.math.BigDecimal;\nimport ClickSend.Api.SmsApi;\nimport ClickSend.Model.DateBefore;\n\npublic class mark_sms_receipt_as_read {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    DateBefore dateBefore = new DateBefore(); // DateBefore | DateBefore model\n    dateBefore.dateBefore(new BigDecimal(1441958441));\n    try {\n        String result = apiInstance.smsReceiptsReadPut(dateBefore);\n\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsReceiptsReadPut\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar dateBefore = new api.DateBefore();\n\ndateBefore.dateBefore = 1545477061;\n\nsmsApi.smsReceiptsReadPut(dateBefore).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nopts = {\n  \"date_before\": \"1543604472\" # String | Mark all as read before this timestamp\n}\n\nbegin\n  # Mark delivery receipts as read\n  result = api_instance.sms_receipts_read_put(opts)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_receipts_read_put: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\n# str | Mark all as read before this timestamp (optional)\ndate_before = 'date_before_example' \n\ntry:\n    # Mark delivery receipts as read\n    api_response = api_instance.sms_receipts_read_put(date_before=date_before)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_receipts_read_put: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_receipts_read_put(WWW::ClickSendClient::Object::DateBefore->new(TIME_STAMP));\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n#import \"CSDateBefore.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n\nCSDateBefore *dateBefore = [[CSDateBefore alloc] init];\n\n[smsAPI smsReceiptsReadPutWithDateBefore:dateBefore completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsReceiptsReadPut(dateBefore: nil) { (dataString, error) in\nguard let dataString = dataString else {\n    print(error!)\n    return\n}\n\nif let data = dataString.data(using: String.Encoding.utf8) {\n    do {\n        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n            print(dictonary)\n        } else {\n            print(\"bad json\")\n        }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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. \nThis 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.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <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/en/articles/43703-integration-guide-pipedream\" target=\"_blank\">here.</a></p>\n</div>  "
                  },
                  "webhook_type": {
                    "type": "string",
                    "description": "Specifies the HTTP method used when the webhook sends a request to the URL. The available options are:\n\n- **post** (Default): Sends the event data using an HTTP POST request.\n    \n- **get**: Sends the event data as query parameters in an HTTP GET request.\n    \n- **json**: Sends the event data using a custom JSON format (via a POST request).\n    \nThis 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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request POST \\\n\n     --header \"Content-Type: application/json\" \\\n     --data-binary \"    {\n        \\\"url\\\":\\\"http://yourdomain.com\\\"\n    }\" \\\n'https://rest.clicksend.com/v3/sms/inbound'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$url = new \\ClickSend\\Model\\Url(); // \\ClickSend\\Model\\Url | Url model\n$url->setUrl(\"http://example.com\");\n\ntry {\n    $result = $apiInstance->smsInboundPost($url);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsInboundPost: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsInboundPost(new Url(\"https://yourdomain.com\"));"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\nimport ClickSend.Model.Url;\n\npublic class create_inbound_sms {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    Url url = new Url(); // Url | Url model\n    url.url(\"http://www.example.com\");\n    try {\n        String result = apiInstance.smsInboundPost(url);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsInboundPost\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar payload = new api.Url;\n\npayload.url = \"http://example.com\";\n\nsmsApi.smsInboundPost(payload).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\n# Url | Url model\nurl = ClickSendClient::Url.new(\n  url: \"http://yourdomain.com\"\n)\n\nbegin\n  # Create inbound sms\n  result = api_instance.sms_inbound_post(url)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_inbound_post: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\nurl = 'http://www.example.com' # str | Your url\npayload = {\"url\" : url}\n\ntry:\n    # Create inbound sms\n    api_response = api_instance.sms_inbound_post(payload)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_inbound_post: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_inbound_post('url' => 'http://yourdomain.com');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n#import \"CSUrl.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n\nCSUrl *csUrl = [[CSUrl alloc] init];\ncsUrl.url = @\"http://yourdomain.com\";\n\n[smsAPI smsInboundPostWithUrl:csUrl completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nlet url = Url(url: \"https://yourdomiansample.com\")\nSMSAPI.smsInboundPost(url: url) { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      },
      "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. \nTo 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. \nControl [pagination](/#pagination) with the _page_ and _limit_ query parameters to specify the page of results and the number of items returned.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <p>If you have multiple inbound rules set to <strong>POLL</strong>, you will receive the inbound message multiple times.</p>\n</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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/sms/inbound'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$q = \"q_example\"; // string | Your keyword or query.\n$page = 1; // int | Page number\n$limit = 10; // int | Number of records per page\n\ntry {\n    $result = $apiInstance->smsInboundGet($q, $page, $limit);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsInboundGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\n\nvar smsApi = new SMSApi(configuration);\n\nvar q = \"q_example\";\nvar page = 1;\nvar limit = 10;\n\nvar response = smsApi.SmsInboundGet(q, page, limit);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\n\npublic class view_inbound_sms {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    String q = \"q_example\"; // String | Your keyword or query\n    Integer page = 1; // Integer | Page number\n    Integer limit = 10; // Integer | Number of records per page\n    try {\n      String result = apiInstance.smsInboundGet(q, page, limit);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsInboundGet\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar q = \"q_example\";\nvar page = 1;\nvar limit = 10;\n\nsmsApi.smsInboundGet(q, page, limit).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nopts = {\n  page: 1,  # Integer | Page number\n  limit: 10 # Integer | Number of records per page\n}\n\nbegin\n  # Get all inbound sms\n  result = api_instance.sms_inbound_get(opts)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_inbound_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\npage = 1 # int | Page number (optional) (default to 1)\nlimit = 10 # int | Number of records per page (optional) (default to 10)\n\ntry:\n    # Get all inbound sms\n    api_response = api_instance.sms_inbound_get(page=page, limit=limit)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_inbound_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_inbound_get('page' => '1', 'limit' => '3');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n\n[smsAPI smsInboundGetWithQ:@\"\" page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsInboundGet { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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. \nInbound 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.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <p>\n    When you receive an inbound message, you will get two parameters: <em>original_message_id</em> and <em>message_id</em>:\n  </p>\n  <ul>\n    <li><em>original_message_id</em>: This is the ID of the outbound message sent to the recipient</li>\n    <li><em>message_id</em>: This is the ID of the inbound message sent by the recipient.</li>\n  </ul>\n</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}' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: API_KEY'\n"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once 'HTTP/Request2.php';\n$request = new HTTP_Request2();\n$request->setUrl('https://rest.clicksend.com/v3/sms/inbound/{original_message_id');\n$request->setMethod(HTTP_Request2::METHOD_GET);\n$request->setConfig(array(\n    'follow_redirects' => TRUE\n));\n$request->setHeader(array(\n    'Content-Type' => 'application/json',\n    'Authorization' => 'API_KEY'\n));\ntry {\n    $response = $request->send();\n    if ($response->getStatus() == 200) {\n        echo $response->getBody();\n    } else {\n        echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .\n            $response->getReasonPhrase();\n    }\n} catch (HTTP_Request2_Exception $e) {\n    echo 'Error: ' . $e->getMessage();\n}\n"
          },
          {
            "lang": "C#",
            "source": "var client = new HttpClient();\nvar request = new HttpRequestMessage(HttpMethod.Get, \"https://rest.clicksend.com/v3/sms/inbound/{original_message_id\");\nrequest.Headers.Add(\"Authorization\", \"API_KEY\");\nvar content = new StringContent(string.Empty);\ncontent.Headers.ContentType = new MediaTypeHeaderValue(\"application/json\");\nrequest.Content = content;\nvar response = await client.SendAsync(request);\nresponse.EnsureSuccessStatusCode();\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\n"
          },
          {
            "lang": "Java",
            "source": "const myHeaders = new Headers();\nmyHeaders.append(\"Content-Type\", \"application/json\");\nmyHeaders.append(\"Authorization\", \"API_KEY\");\n\nconst requestOptions = {\n  method: \"GET\",\n  headers: myHeaders,\n  redirect: \"follow\"\n};\n\nfetch(\"https://rest.clicksend.com/v3/sms/inbound/{original_message_id}\", requestOptions)\n  .then((response) => response.text())\n  .then((result) => console.log(result))\n  .catch((error) => console.error(error));"
          },
          {
            "lang": "Node.js",
            "source": "var request = require(\"request\");\nvar options = {\n  method: \"GET\",\n  url: \"https://rest.clicksend.com/v3/sms/inbound/{original_message_id}\",\n  headers: {\n    \"Content-Type\": \"application/json\",\n    Authorization: \"API_KEY\",\n  },\n};\nrequest(options, function (error, response) {\n  if (error) throw new Error(error);\n  console.log(response.body);\n});\n"
          },
          {
            "lang": "Ruby",
            "source": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://rest.clicksend.com/v3/sms/inbound/{original_message_id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"Content-Type\"] = \"application/json\"\nrequest[\"Authorization\"] = \"API_KEY\"\n\nresponse = https.request(request)\nputs response.read_body"
          },
          {
            "lang": "Python",
            "source": "import http.client\nimport json\n\nconn = http.client.HTTPSConnection(\"rest.clicksend.com\")\npayload = ''\nheaders = {\n  'Content-Type': 'application/json',\n  'Authorization': 'API_KEY'\n}\nconn.request(\"GET\", \"/v3/sms/inbound/{original_message_id}\", payload, headers)\nres = conn.getresponse()\ndata = res.read()\nprint(data.decode(\"utf-8\"))"
          },
          {
            "lang": "objc",
            "source": "#import <Foundation/Foundation.h>\n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://rest.clicksend.com/v3/sms/inbound/%7Boriginal_message_id%7D\"]\n  cachePolicy:NSURLRequestUseProtocolCachePolicy\n  timeoutInterval:10.0];\nNSDictionary *headers = @{\n  @\"Content-Type\": @\"application/json\",\n  @\"Authorization\": @\"API_KEY\"\n};\n\n[request setAllHTTPHeaderFields:headers];\n\n[request setHTTPMethod:@\"GET\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n  if (error) {\n    NSLog(@\"%@\", error);\n    dispatch_semaphore_signal(sema);\n  } else {\n    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n    NSError *parseError = nil;\n    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n    NSLog(@\"%@\",responseDictionary);\n    dispatch_semaphore_signal(sema);\n  }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);\n"
          },
          {
            "lang": "swift",
            "source": "var request = URLRequest(url: URL(string: \"https://rest.clicksend.com/v3/sms/inbound/{original_message_id}\")!,timeoutInterval: Double.infinity)\nrequest.addValue(\"application/json\", forHTTPHeaderField: \"Content-Type\")\nrequest.addValue(\"API_KEY\", forHTTPHeaderField: \"Authorization\")\n\nrequest.httpMethod = \"GET\"\n\nlet task = URLSession.shared.dataTask(with: request) { data, response, error in \n  guard let data = data else {\n    print(String(describing: error))\n    return\n  }\n  print(String(data: data, encoding: .utf8)!)\n}\n\ntask.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. \nIn 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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request PUT \\\n\n     --header \"Content-Type: application/json\" \\\n     --data-binary \"    {\n        \\\"date_before\\\":1442398100\n    }\" \\\n'https://rest.clicksend.com/v3/sms/inbound-read'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n// \\ClickSend\\Model\\DateBefore | DateBefore model\n$date_before = new \\ClickSend\\Model\\DateBefore(); \n$date_before->setDateBefore(\"2019-01-01\");\n\ntry {\n    $result = $apiInstance->smsInboundReadPut($date_before);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsInboundReadPut: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsInboundReadPut(TIME_STAMP);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport java.math.BigDecimal;\nimport ClickSend.Api.SmsApi;\nimport ClickSend.Model.DateBefore;\n\npublic class mark_inbound_sms_as_read {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    DateBefore dateBefore = new DateBefore(); // DateBefore | DateBefore model\n    dateBefore.dateBefore(new BigDecimal(1441958441));\n    try {\n        String result = apiInstance.smsInboundReadPut(dateBefore);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsInboundReadPut\");\n        e.printStackTrace();\n    } \n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar messageId = \"message_id\";\n\nsmsApi.smsInboundReadByMessageIdPut(messageId).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nopts = {\n  # Integer | An optional timestamp - mark all as read before this timestamp.\n  # If not given, all messages will be marked as read.\n  \"date_before\": \"1543606584\"\n}\n\nbegin\n  # Mark inbound SMS as read\n  result = api_instance.sms_inbound_read_put(opts)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_inbound_read_put: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\ndate_before = 'date_before_example' \n# str | An optional timestamp - mark all as read before this timestamp.\n# If not given, all messages will be marked as read. (optional)\n\ntry:\n    # Mark inbound SMS as read\n    api_response = api_instance.sms_inbound_read_put(date_before=date_before)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_inbound_read_put: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_inbound_read_put('date_before' => 1442398100);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n#import \"CSDateBefore.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n\nCSDateBefore *dateBefore = [[CSDateBefore alloc] init];\n\n[smsAPI smsInboundReadPutWithDateBefore:dateBefore completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsInboundReadPut { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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, \nthis 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.\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <p>\n    When you receive an inbound message, you will get two parameters: <em>original_message_id</em> and <em>message_id</em>:\n  </p>\n  <ul>\n    <li><em>original_message_id</em>: This is the ID of the outbound message sent to the recipient</li>\n    <li><em>message_id</em>: This is the ID of the inbound message sent by the recipient.</li>\n  </ul>\n</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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request PUT \\\n'https://rest.clicksend.com/v3/sms/inbound-read/{message_id}'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n\n$message_id = \"{message_id}\";\n\ntry {\n    $result = $apiInstance->smsInboundReadByMessageIdPut($message_id);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsInboundReadByMessageIdPut: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar messageId = 'message_id';\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsInboundReadByMessageIdPut(messageId);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport java.math.BigDecimal;\nimport ClickSend.Api.SmsApi;\n\npublic class mark_specific_inbound_sms_as_read {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n\n    try {\n        String result = apiInstance.smsInboundReadByMessageIdPut(messageId);\n\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsInboundReadByMessageIdPut\");\n        e.printStackTrace();\n    }\n  }\n}\n\n"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nsmsApi.smsInboundReadByMessageIdPut(messageId).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nmessage_id = 'message_id';\n\nbegin\n  # Mark an inbound sms as read\n  result = api_instance.sms_inbound_read_by_message_id_put(message_id)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_inbound_read_by_message_id_put: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\n\nmessage_id = 'message_id' \n\ntry:\n    # Mark specific inbound sms as read\n    api_response = api_instance.sms_inbound_read_by_message_id_put(message_id)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_inbound_read_by_message_id_put: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $message_id = 'message_id';\n\nmy $json_output = $api->sms_inbound_read_by_message_id_put($message_id);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n\n[smsAPI smsInboundReadByMessageIdPutWithMessageId:@\"message_id\" completionHandler:^(NSString *output, NSError *error) {\n   if (error) {\n       NSLog(@\"Error: %@\", error);\n   } else {\n       NSLog(@\"%@\", output);\n   }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsInboundReadByMessageIdPut(messageId: \"message_id\") { (dataString, error) in\nguard let dataString = dataString else {\n    print(error!)\n    return\n}\n\nif let data = dataString.data(using: String.Encoding.utf8) {\n    do {\n        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n            print(dictonary)\n        } else {\n            print(\"bad json\")\n        }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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. \nSpecify 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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request PUT \\\n\n'https://rest.clicksend.com/v3/sms/{message_id}/cancel'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$message_id = \"messageId_example\"; // string | The message ID you want to cancel\n\ntry {\n    $result = $apiInstance->smsCancelByMessageIdPut($message_id);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsCancelByMessageIdPut: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsCancelByMessageIdPut(\"MESSAGE_ID\");"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\n\npublic class cancel_sms {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    // String | The message ID you want to cancel\n    String messageId = \"messageId_example\"; \n    try {\n        String result = apiInstance.smsCancelByMessageIdPut(messageId);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsCancelByMessageIdPut\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar messageId = \"message_id\";\n\nsmsApi.smsCancelByMessageIdPut(messageId).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nmessage_id = \"307EF035-B7CE-4321-93CD-0753597B7293\" # String | The message ID you want to cancel\n\nbegin\n  # Update scheduled message as cancelled\n  result = api_instance.sms_cancel_by_message_id_put(message_id)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_cancel_by_message_id_put: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\nmessage_id = 'F2E5C026-24C2-4D9F-B87C-6E78E0E8535D' # str | The message ID you want to cancel\n\ntry:\n    # Update scheduled message as cancelled\n    api_response = api_instance.sms_cancel_by_message_id_put(message_id)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_cancel_by_message_id_put: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_cancel_by_message_id_put('message_id' => 'XXXXXXXXX-XX-XX-XX-XXXXXX');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n[smsAPI smsCancelByMessageIdPutWithMessageId:@\"{message_id}\" completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsCancelByMessageIdPut(messageId: \"{message_id}\") { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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_.\n\nIt'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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request PUT \\\n\n'https://rest.clicksend.com/v3/sms/cancel-all'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n\ntry {\n    $result = $apiInstance->smsCancelAllPut();\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsCancelAllPut: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsCancelAllPut();"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\n\npublic class cancel_all_sms {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    try {\n        String result = apiInstance.smsCancelAllPut();\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsCancelAllPut\");\n        e.printStackTrace();\n    }\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nsmsApi.smsCancelAllPut().then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nbegin\n  # Update all scheduled message as cancelled\n  result = api_instance.sms_cancel_all_put\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_cancel_all_put: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\n\ntry:\n    # Update all scheduled message as cancelled\n    api_response = api_instance.sms_cancel_all_put()\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_cancel_all_put: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_cancel_all_put();\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc]init];\n[smsAPI smsCancelAllPutWithCompletionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsCancelAllPut { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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`.\n\n1. **Field Name**: The field within the SMS history you want to filter by. You can use the following fields:\n\n  - _template_id_ : The ID of the template\n  - _template_name_ : The name of the template\n  - _body_ : The body content of the template.\n        \n2. **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**.    \n\nFor example, if you are searching for the template with the name of _sample_name_, the final query would look like this: \n\n  `q=template_name:sample_name`\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <div>\n   <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>\n    <ul>\n      <li>q=from:%2B61437085284</li>\n    </ul>\n    <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>\n  </div>\n</div>"
          },
          {
            "name": "order_by",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "template_id:asc"
            },
            "description": "Specifies the field and order to sort the results by. \nThe value is composed of the field name followed by a colon and the sort direction (_asc_ for ascending or _desc_ for descending). \nThe default sort order is by _template_id_ in ascending order. You can use the following fields:    \n\n- _template_id_ : The ID of the Template\n- _template_name_ : The name of the Template\n- _body_ : The body content of the Template\n\nFor example, if you want to order by the _template_id_ in descending order, the query would look like this:\n\n  `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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/sms/templates'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$page = 1; // int | Page number\n$limit = 10; // int | Number of records per page\n\ntry {\n    $result = $apiInstance->smsTemplatesGet($page, $limit);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsTemplatesGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsTemplatesGet();"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\n\npublic class view_sms_template {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    Integer page = 1; // Integer | Page number\n    Integer limit = 10; // Integer | Number of records per page\n    try {\n        String result = apiInstance.smsTemplatesGet(page, limit);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsTemplatesGet\");\n        e.printStackTrace();\n    }\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar page = 1;\nvar limit = 10;\n\nsmsApi.smsTemplatesGet(page, limit).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nopts = {\n  page: 1,  # Integer | Page number\n  limit: 10 # Integer | Number of records per page\n}\n\nbegin\n  # Get lists of all sms templates\n  result = api_instance.sms_templates_get(opts)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_templates_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\npage = 1 # int | Page number (optional) (default to 1)\nlimit = 10 # int | Number of records per page (optional) (default to 10)\n\ntry:\n    # Get lists of all sms templates\n    api_response = api_instance.sms_templates_get(page=page, limit=limit)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_templates_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_templates_get('page' => '1', 'limit' => '2');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc]init];\n[smsAPI smsTemplatesGetWithPage:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsTemplatesGet { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      },
      "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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request POST \\\n     --header \"Content-Type: application/json\" \\\n\n     --data-binary \"    {\n        \\\"template_name\\\":\\\"Template 501916\\\",\n        \\\"body\\\":\\\"This is a sample content: H7YI68B3yk for this template.\\\"\n    }\" \\\n'https://rest.clicksend.com/v3/sms/templates'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$sms_template = new \\ClickSend\\Model\\SmsTemplate(); // \\ClickSend\\Model\\SmsTemplate | SmsTemplate model\n$sms_template->setTemplateName(\"Template 501916\");\n$sms_template->setBody(\"This is a sample content: H7YI68B3yk for this template.\");\n\ntry {\n    $result = $apiInstance->smsTemplatesPost($sms_template);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsTemplatesPost: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsTemplatesPost(new SmsTemplate(\n    templateName: \"Template Name\",\n    body: \"This is body\"\n));"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\nimport ClickSend.Model.SmsTemplate;\n\npublic class create_sms_template {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    SmsTemplate smsTemplate = new SmsTemplate(); // SmsTemplate | SmsTemplate model\n    smsTemplate.body(\"body\");\n    smsTemplate.templateName(\"name\");\n    try {\n        String result = apiInstance.smsTemplatesPost(smsTemplate);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsTemplatesPost\");\n        e.printStackTrace();\n    }\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar smsTemplate = new api.SmsTemplate();\n\nsmsTemplate.templateName = \"Template 501916\";\nsmsTemplate.body = \"template body\";\n\nsmsApi.smsTemplatesPost(smsTemplate).then(function(response) {\nconsole.log(response.body);\n}).catch(function(err){\nconsole.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\n# SmsTemplate | SmsTemplate model\nsms_template = ClickSendClient::SmsTemplate.new(\n  \"template_name\": \"template_name\",\n  \"body\": \"body\"\n)\n\nbegin\n  # Create sms template\n  result = api_instance.sms_templates_post(sms_template)\n  p result\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_templates_post: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\n# SmsTemplate | SmsTemplate model\nsms_template = clicksend_client.SmsTemplate(\n                  template_name=\"Template 501916\",\n                  body=\"This is a sample content: H7YI68B3yk for this template.\") \n\ntry:\n    # Create sms template\n    api_response = api_instance.sms_templates_post(sms_template)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_templates_post: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\nuse WWW::ClickSendClient::Object::SmsTemplate;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\nmy %params = (\n    'template_name' => 'template_name',\n    'body'          => 'body'\n);\n\nmy $sms_template_obj = WWW::ClickSendClient::Object::SmsTemplate->new(%params);\nmy $json_output = $api->sms_templates_post('sms_template' => $sms_template_obj);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n#import \"CSSmsTemplate.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\nCSSmsTemplate *smsTemplate =  [[CSSmsTemplate alloc] init];\nsmsTemplate.templateName = @\"Template Chocolate\";\nsmsTemplate.body = @\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\";\n\n[smsAPI smsTemplatesPostWithSmsTemplate:smsTemplate completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsTemplatesPost(smsTemplate: smsTemplate) { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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}}' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: [API_KEY]'"
          },
          {
            "lang": "PHP",
            "source": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n    CURLOPT_URL => 'https://rest.clicksend.com/v3/sms/templates/{{templateId}}',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_ENCODING => '',\n    CURLOPT_MAXREDIRS => 10,\n    CURLOPT_TIMEOUT => 0,\n    CURLOPT_FOLLOWLOCATION => true,\n    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_HTTPHEADER => array(\n        'Content-Type: application/json',\n        'Authorization: [API_KEY]'\n    ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n"
          },
          {
            "lang": "C#",
            "source": "var client = new HttpClient();\nvar request = new HttpRequestMessage(HttpMethod.Get, \"https://rest.clicksend.com/v3/sms/templates/{{templateId}}\");\nrequest.Headers.Add(\"Authorization\", [API_KEY]);\nvar content = new StringContent(string.Empty);\ncontent.Headers.ContentType = new MediaTypeHeaderValue(\"application/json\");\nrequest.Content = content;\nvar response = await client.SendAsync(request);\nresponse.EnsureSuccessStatusCode();\nConsole.WriteLine(await response.Content.ReadAsStringAsync());"
          },
          {
            "lang": "Java",
            "source": "OkHttpClient client = new OkHttpClient().newBuilder()\n  .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"\");\nRequest request = new Request.Builder()\n  .url(\"https://rest.clicksend.com/v3/sms/templates/{{templateId}}\")\n  .method(\"GET\", body)\n  .addHeader(\"Content-Type\", \"application/json\")\n  .addHeader(\"Authorization\", [API_KEY])\n  .build();\nResponse response = client.newCall(request).execute();\n"
          },
          {
            "lang": "Node.js",
            "source": "const axios = require(\"axios\");\n\nlet config = {\n  method: \"get\",\n  maxBodyLength: Infinity,\n  url: \"https://rest.clicksend.com/v3/sms/templates/{{templateId}}\",\n  headers: {\n    \"Content-Type\": \"application/json\",\n    Authorization: [API_KEY],\n  },\n};\n\naxios\n  .request(config)\n  .then((response) => {\n    console.log(JSON.stringify(response.data));\n  })\n  .catch((error) => {\n    console.log(error);\n  });\n"
          },
          {
            "lang": "Ruby",
            "source": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://rest.clicksend.com/v3/sms/templates/{{templateId}}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"Content-Type\"] = \"application/json\"\nrequest[\"Authorization\"] = [API_KEY]\n\nresponse = https.request(request)\nputs response.read_body\n"
          },
          {
            "lang": "Python",
            "source": "import http.client\nimport json\n\nconn = http.client.HTTPSConnection(\"rest.clicksend.com\")\npayload = ''\nheaders = {\n  'Content-Type': 'application/json',\n  'Authorization': [API_KEY]\n}\nconn.request(\"GET\", \"/v3/sms/templates/{{templateId}}\", payload, headers)\nres = conn.getresponse()\ndata = res.read()\nprint(data.decode(\"utf-8\"))\n"
          },
          {
            "lang": "objc",
            "source": "#import <Foundation/Foundation.h>\n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://rest.clicksend.com/v3/sms/templates/%7B%7BtemplateId%7D%7D\"]\n  cachePolicy:NSURLRequestUseProtocolCachePolicy\n  timeoutInterval:10.0];\nNSDictionary *headers = @{\n  @\"Content-Type\": @\"application/json\",\n  @\"Authorization\": @[API_KEY]\n};\n\n[request setAllHTTPHeaderFields:headers];\n\n[request setHTTPMethod:@\"GET\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n  if (error) {\n    NSLog(@\"%@\", error);\n    dispatch_semaphore_signal(sema);\n  } else {\n    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n    NSError *parseError = nil;\n    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n    NSLog(@\"%@\",responseDictionary);\n    dispatch_semaphore_signal(sema);\n  }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);\n"
          }
        ]
      },
      "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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request PUT \\\n     --header \"Content-Type: application/json\" \\\n\n     --data-binary \"    {\n        \\\"template_name\\\":\\\"I am updated\\\",\n        \\\"body\\\":\\\"This is a sample content: Sc0KNWgSMG for this template.\\\"\n    }\" \\\n'https://rest.clicksend.com/v3/sms/templates/{template_id}'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$template_id = 26030; // int | Template id\n$sms_template = new \\ClickSend\\Model\\SmsTemplate(); // \\ClickSend\\Model\\SmsTemplate | Template item\n$sms_template->setTemplateName(\"Template 501916\");\n$sms_template->setBody(\"This is a sample content: H7YI68B3yk for this template.\");\n\ntry {\n    $result = $apiInstance->smsTemplatesByTemplateIdPut($template_id, $sms_template);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsTemplatesByTemplateIdPut: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsTemplatesByTemplateIdPut(TEMPLATE_ID,new SmsTemplate(\n    templateName: \"Template Name\",\n    body: \"This is body\"\n));"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\nimport ClickSend.Model.SmsTemplate;\n\npublic class update_sms_template {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    Integer templateId = 24868; // Integer | Template id\n    SmsTemplate smsTemplate = new SmsTemplate(); // SmsTemplate | Template item\n    smsTemplate.body(\"template body\");\n    smsTemplate.templateName(\"template name\");\n    try {\n        String result = apiInstance.smsTemplatesByTemplateIdPut(templateId, smsTemplate);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsTemplatesByTemplateIdPut\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar smsTemplate = new api.SmsTemplate();\n\nsmsTemplate.template_name = \"Template 501916\";\nsmsTemplate.body = \"template body\";\n\ntemplateId = 25411;\n\nsmsApi.smsTemplatesByTemplateIdPut(templateId, smsTemplate).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\ntemplate_id = 56 # Integer | Template id\n\n# SmsTemplate | SmsTemplate model\nsms_template = ClickSendClient::SmsTemplate.new(\n  \"template_name\": \"template_name\",\n  \"body\": \"body\"\n)\n\nbegin\n  # Update sms template\n  result = api_instance.sms_templates_by_template_id_put(template_id, sms_template)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_templates_by_template_id_put: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\ntemplate_id = 24140 # int | Template id\nsms_template = clicksend_client.SmsTemplate(\n                template_name=\"I am updated\",\n                body=\"This is a sample content: Sc0KNWgSMG for this template.\") # SmsTemplate | Template item\n\ntry:\n    # Update sms template\n    api_response = api_instance.sms_templates_by_template_id_put(template_id, sms_template)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_templates_by_template_id_put: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\nuse WWW::ClickSendClient::Object::SmsTemplate;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\nmy %params = (\n    'template_name' => 'template_name',\n    'body'          => 'body'\n);\n\nmy $sms_template_obj = WWW::ClickSendClient::Object::SmsTemplate->new(%params);\nmy $json_output = $api->sms_templates_by_template_id_put('sms_template' => $sms_template_obj ,'template_id' => '12345');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n#import \"CSSmsTemplate.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n\nNSNumber *templateId = [NSNumber numberWithInt:0];\n\nCSSmsTemplate *smsTemplate =  [[CSSmsTemplate alloc] init];\nsmsTemplate.templateName = @\"Template Chocolate\";\nsmsTemplate.body = @\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\";\n\n[smsAPI smsTemplatesByTemplateIdPutWithTemplateId:templateId smsTemplate:smsTemplate completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nlet smsTemplate = SmsTemplate(\n    templateName: \"Template Chocolate\", \n    body: \"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\"\n)\n\nSMSAPI.smsTemplatesByTemplateIdPut(templateId: 25212, smsTemplate: smsTemplate) { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      },
      "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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request DELETE \\\n\n'https://rest.clicksend.com/v3/sms/templates/{template_id}'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$template_id = 24140; // int | Template id\n\ntry {\n    $result = $apiInstance->smsTemplatesByTemplateIdDelete($template_id);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsTemplatesByTemplateIdDelete: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsTemplatesByTemplateIdDelete(TEMPLATE_ID);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\n\npublic class delete_sms_template {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    Integer templateId = 24868; // Integer | Template id\n    try {\n        String result = apiInstance.smsTemplatesByTemplateIdDelete(templateId);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsTemplatesByTemplateIdDelete\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\ntemplateId = 25411;\n\nsmsApi.smsTemplatesByTemplateIdDelete(templateId).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\ntemplate_id = 25 # Integer | Template id\n\nbegin\n  # Delete sms template\n  result = api_instance.sms_templates_by_template_id_delete(template_id)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_templates_by_template_id_delete: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\ntemplate_id = 24490 # int | Template id\n\ntry:\n    # Delete sms template\n    api_response = api_instance.sms_templates_by_template_id_delete(template_id)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_templates_by_template_id_delete: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_templates_by_template_id_delete('template_id' => '12345');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n\nNSNumber *templateId = [NSNumber numberWithInt:0];\n\n[smsAPI smsTemplatesByTemplateIdDeleteWithTemplateId:templateId completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsTemplatesByTemplateIdDelete(templateId: 25212) { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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`.\n\n1. **Field Name**: The field within the SMS history you want to filter by. You can use the following fields:\n    \n    - _Status_: The status of the SMS. Available values for status are: Queued, Completed, Scheduled, WaitApproval, Failed, Cancelled, CancelledAfterReview, Received, Sent.\n        \n    - _To_: The recipient of the SMS.\n        \n    - _from_: The sender of the SMS.\n        \n    - _subaccount_id_: The sub-account identifier.\n        \n    - _message_id_: The ID of your SMS.\n        \n2. **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**.           \n\nFor example, if you are searching for a SMS with the status of Scheduled, the final query would look like this:\n\n  `q=status:Scheduled`\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <div>\n   <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>\n    <ul>\n      <li>q=from:%2B61437085284</li>\n    </ul>\n    <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>\n  </div>\n</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). \nThe default sort order is by _date_ in ascending order. You can use the following fields:\n\n  - _date_\n  - _username_\n  - _from_ \n  - _to_\n  - _status_\n  - _body_\n\nFor 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:\n\n  `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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/sms/history?date_from=&date_to='"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$q = \"q_example\"; // string | Custom query Example: from:{number},status_code:201.\n$date_from = '1436879372'; // int | Start date\n$date_to = '1436879372'; // int | End date\n$page = 1; // int | Page number\n$limit = 10; // int | Number of records per page\n\ntry {\n    $result = $apiInstance->smsHistoryGet($q, $date_from, $date_to, $page, $limit);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsHistoryGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\n\nvar q = \"q_example\";\nvar dateFrom = '1436879372';\nvar dateTo = '1436879372';\nvar page = 1;\nvar limit = 10;\n\nvar response = smsApi.SmsHistoryGet(q, dateFrom, dateTo, page, limit);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\n\npublic class view_sms_history {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    // String | Custom query Example: from:{number},status_code:201.\n    String q = \"q_example\"; \n    Integer dateFrom = 1436879372; // Integer | Start date\n    Integer dateTo = 1436879372; // Integer | End date\n    Integer page = 1; // Integer | Page number\n    Integer limit = 10; // Integer | Number of records per page\n    try {\n      String result = apiInstance.smsHistoryGet(q, dateFrom, dateTo, page, limit);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsHistoryGet\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar q = \"q_example\";\nvar dateFrom = '1436879372';\nvar dateTo = '1436879372';\nvar page = 1;\nvar limit = 10;\n\nsmsApi.smsHistoryGet(q, dateFrom, dateTo, page, limit).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nopts = {\n  date_from: 1436849372, # Integer | Start date\n  date_to: 1436879372,   # Integer | End date\n  page: 1,       # Integer | Page number\n  limit: 10      # Integer | Number of records per page\n}\n\nbegin\n  # Get all sms history\n  result = api_instance.sms_history_get(opts)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_history_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\ndate_from = 1436879372 # int | Start date (optional)\ndate_to = 1436879372 # int | End date (optional)\npage = 1 # int | Page number (optional) (default to 1)\nlimit = 10 # int | Number of records per page (optional) (default to 10)\n\ntry:\n    # Get all sms history\n    api_response = api_instance.sms_history_get(date_from=date_from, date_to=date_to, page=page, limit=limit)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_history_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_history_get('date_from' => '1436879372','date_to' => '1446879372' , 'page'  => '1','limit'=> '20');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n\nNSNumber *dateFromTimestamp = [NSNumber numberWithInt:1436849372];\nNSNumber *dateToTimestamp = [NSNumber numberWithInt:1436879372];\n\n[smsAPI smsHistoryGetWithQ:@\"\" dateFrom:dateFromTimestamp dateTo:dateToTimestamp page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsHistoryGet { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"Cannot convert the String value to JSON\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/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`.\n\n1. **Field Name**: The field within the SMS history you want to filter by. You can use the following fields:\n    \n    - _Status_: The status of the SMS. Available values for status are: Queued, Completed, Scheduled, WaitApproval, Failed, Cancelled, CancelledAfterReview, Received, Sent.\n        \n    - _To_: The recipient of the SMS.\n        \n    - _from_: The sender of the SMS.\n        \n    - _subaccount_id_: The sub-account identifier.\n        \n    - _message_id_: The ID of your SMS.\n        \n2. **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**.           \n\nFor example, if you are searching for a SMS with the status of _Scheduled_, the final query would look like this:\n\n  `q=status:Scheduled`\n\n<div class=\"info-box\">\n  <h4><i class=\"fas fa-info-circle\"></i> Note:</h4>\n  <div>\n  <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>\n    <ul>\n      <li>q=from:%2B61437085284</li>\n    </ul>\n    <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>\n  </div>\n</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). \nThe default sort order is by date in ascending order. You can use the following fields:\n\n  - _date_ \n  - _username_\n  - _from_ \n  - _to_\n  - _status_ \n  - _body_\n\nFor 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:\n\n  `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 \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/sms/history/export?filename={filename}'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\SMSApi(new GuzzleHttp\\Client(),$config);\n$filename = \"filename_example\"; // string | Filename to download history as\n\ntry {\n    $result = $apiInstance->smsHistoryExportGet($filename);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling SMSApi->smsHistoryExportGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar smsApi = new SMSApi(configuration);\nvar response = smsApi.SmsHistoryExportGet(\"File Name\");"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.SmsApi;\n\npublic class export_sms_history {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    SmsApi apiInstance = new SmsApi(defaultClient);\n    // String | Filename to download history as\n    String filename = \"filename_example\"; \n    try {\n        String result = apiInstance.smsHistoryExportGet(filename);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling SmsApi#smsHistoryExportGet\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar smsApi = new api.SMSApi(\"USERNAME\", \"API_KEY\");\n\nvar filename = \"filename\";\n\nsmsApi.smsHistoryExportGet(filename).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\nend\n\napi_instance = ClickSendClient::SMSApi.new\n\nfilename = \"filename_example\" # String | Filename to download history as\n\nbegin\n  # Export all sms history\n  result = api_instance.sms_history_export_get(filename)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling SMSApi->sms_history_export_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))\nfilename = 'sms_history' # str | Filename to download history as\n\ntry:\n    # Export all sms history\n    api_response = api_instance.sms_history_export_get(filename)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling SMSApi->sms_history_export_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::SMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->sms_history_export_get('filename' => 'test_file');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSSMSApi *smsAPI = [[CSSMSApi alloc] init];\n[smsAPI smsHistoryExportGetWithFilename:@\"string\" completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nSMSAPI.smsHistoryExportGet(filename: \"test.csv\") { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    }
  }
}