{
  "swagger": "2.0",
  "info": {
    "title": "Textmagic API",
    "version": "2",
    "x-logo": {
      "url": "https://investor.textmagic.com/src/assets/img/logo-blue.svg",
      "altText": "Textmagic"
    },
    "description": ""
  },
  "host": "rest.textmagic.com",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "security": [
    {
      "BasicAuth": []
    }
  ],
  "tags": [
    {
      "name": "Getting started",
      "x-virtual": true,
      "description": "Get Started with the TextMagic REST API\nTo start sending text messages using the TextMagic REST API, just follow these steps:\n1. Generate the API credentials\n1. Connect to our API endpoint\n\n## How to obtain the API credentials\nTo start sending text messages, you need to create an API key. An API key is similar to an account password; the difference is that an API key only provides access to the API; you cannot log in to TextMagic Online using the API key.\n\nYour program sends the login credentials with each API request as HTTP headers: **X-TM-Username** is your TextMagic username, while **X-TM-Key** is your API key.\n\nAnother way is to send credentials using **BasicAuth** method. See [Basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication).\n\nHow to obtain an API key:\n\n1.  [Log in](https://my.textmagic.com/login) to TextMagic (or [start a free trial](https://my.textmagic.com/register/) if you haven’t registered yet).\n2.  Go to the [API settings page](https://my.textmagic.com/online/api/rest-api/keys).\n3.  Click the **Add new API key** button.\n4.  Enter an app name for this key. Note, it’s just a label, so pick any name.\n5.  Click **Generate new key**.\n6.  You should now see your new API key in the green notification banner above the table:\n\n![alt text](images/credentials.png)\n\n> **Note for API v1 users**<br/>\nV1 keys are not compatible with the V2 version of the TextMagic REST API, so you will need to generate a new API key to use the V2 endpoint.\n\n\n## The API endpoint\nThe TextMagic REST API endpoint is:\n```\nhttps://rest.textmagic.com/api/v2\n```\nAll the URLs referenced in this documentation should use this base URL.\n\n## How the REST API works\nREST APIs use the HTTP protocol to send and receive messages. REST messages are usually encoded as JSON documents and are an improvement over \nolder methods such as the XML-based SOAP protocol. REST APIs use the same set of methods that web browsers use: **POST, GET, PUT** or **DELETE**. \nThese correspond to the CRUD operations **create, read, update** and **delete**. Often, REST URIs provide direct CRUD access to entities or \ncollections of entities, for example https://rest.textmagic.com/api/v2/lists. In this instance, to delete a list’s endpoint, you might simply call the \nendpoint DELETE https://rest.textmagic.com/api/v2/lists/{id}. REST makes these types of operations simple.\n\n> **Example**\n>\n> Let’s take the entity most often used in messaging: contacts. Imagine you want to perform operations on your contacts list: well, it’s only a matter of calling the following endpoints:\n> *   **GET** /api/v2/contacts (get all of your contacts)\n> *   **GET** /api/v2/contacts/{id} (get a specific contact)\n> *   **POST** /api/v2/contacts (create a new contact)\n> *   **PUT** /api/v2/contacts/{id} (update an existing contact)\n> *   **DELETE** /api/v2/contacts/{id} (delete an existing contact)\nIt’s that simple! In fact, that’s all you need to do to manage the contacts in your TextMagic account!"
    },
    {
      "name": "Sandbox",
      "x-virtual": true,
      "description": "Sandbox is a tool to test TextMagic REST API requests without the need to install any applications or write any code.\n\n<a href=\"https://sandbox.textmagic.com\" target=\"_blank\">Go to TextMagic Sandbox</a>\n\n## The credentials area\nTo make requests using your TextMagic account, you need to enter your account `username` and your `API key` into\nthe corresponding fields. To enter them, click the **Authorize** button which you can find at the top-right corner of the page.\n\nThe credentials modal window will be shown. Put your `username` and `API key` in and press the **Authorize** button, as shown in the image below:\n\n<p style=\"text-align: center\">\n\t<img srcset=\"images/sandbox_auth_modal_x1.png 1x, images/sandbox_auth_modal_x2.png 2x\" style=\"width:600px;\">\n<p>\n\n## Command documentation\n\nTo view the documentation for a command, i.e. its parameters, filters, output format and return codes, simply click on its name:\n\n<img srcset=\"images/sandbox_try_1_x1.png 1x, images/sandbox_try_1_x2.png 2x\">\n\n## How it works\n\nSandbox allows you to test the TextMagic REST API directly from your browser. No programming skills are required. To use Sandbox, simply click on the entry for the command you want to test and then press on the \"Try it out\" button, which is underlined in the image above.\n\nAs an example, let's look at a **create template** request:\n\n<img srcset=\"images/sandbox_try_2_x1.png 1x, images/sandbox_try_2_x2.png 2x\">\n\nEnter the required parameters by editing the input JSON structure (just use the provided example) and then click **Execute** to make a request. The URL corresponds to the command you wish to use, e.g. `/api/v2/templates` corresponds to the templates command.\n\nYou will receive an HTTP response code along with a JSON response body showing whether the request was successful or not. You will find additional information provided in the HTTP response headers **Response Body** and the **Response Header** section.\n\n<img srcset=\"images/sandbox_try_3_x1.png 1x, images/sandbox_try_3_x2.png 2x\">\n\nWe have now **successfully created** a new message template and saved it to the TextMagic database. It was created with an `ID` value of `631`. Now we can send a message using this template via API or TextMagic Online.\n\nLet’s retrieve the template now to verify that its content was saved correctly. To do this, use the GET `/api/v2/templates/{id}` command. Open it, enter the **template id** you obtained in the previous step and click **Execute**.\n\n<img srcset=\"images/sandbox_try_4_x1.png 1x, images/sandbox_try_4_x2.png 2x\">"
    },
    {
      "name": "Outbound Messages",
      "x-displayName": "Messages: Send\n",
      "description": "The primary reason for using the TextMagic API is to send SMS text messages.\n\n# Tutorials\n\n## How to send a single text message\n\nTo send a simple text message to one recipient, you should set only the `text` and the `phones` parameters. `text` should\ncontain that desired text and `phones` should be set to the recipient’s international phone number.\n\nFor example, to send an SMS message with the text “I love TextMagic” to the phone number +44 (0) 7 860021130, use the command:\n\n> POST https://rest.textmagic.com/api/v2/messages\n\nwith the following parameters:\n\n| Parameter | Value |\n| --------- | ----- |\n| text |I love TextMagic (don’t forget to urlencode your string!) |\n| phones | 447860021130 |\n\nYou will receive a result like this:\n\n| Parameter | Example |\n| --------- | ------- |\n| id | 49576009 |\n| href | /api/v2/messages/49576009 |\n| type | message |\n| sessionId | 34436600 |\n| bulkId | null |\n| messageId | 49576009 |\n| scheduleId | null |\n\nAs long as you have sent a message to at least one recipient, the TextMagic API will return not only the session ID,\nbut also the single message ID. Also, you can watch for the delivery status changes using this ID without\nfetching session messages first. Since this is not a bulk session or scheduled message,\n`bulkId` and `scheduleId` are null.\n\n## How to send bulk text messages\nYou can also send a message to many recipients simultaneously. Let’s see how it’s done in the example below.\n\nAssuming that you have a list ID 55314 (with 100 recipients), write:\n\n> POST https://rest.textmagic.com/api/v2/messages\n\n| Parameter | Value |\n|-----------|-------|\n| **text** | `Hello, how are you?` |\n| **lists** | `55314` |\n| **phones** | `447860021130,447860021131,447860021132,447860021134` |\n| **contacts** | `318,395,3348015` |\n\nYou will receive a result like this:\n\n|Parameter|Example|\n|---------|-------|\n|**id**|`357122`|\n|**href**|`/api/v2/sessions/357122`|\n|**type**|`session`|\n|**sessionId**|`357122`|\n|**bulkId**|`null`|\n|**messageId**|`null`|\n|**scheduleId**|`null`|\n\n## Sending more than 1,000 messages in one session\nA **Bulk session** in TextMagic is when you send a message to more than 1,000 recipients. Since processing such a large session could take a long time (i.e. more than a few seconds), the messages are stored in a queue temporarily. You can check the progress of the messages by sending a **GET **to:\n> GET /api/v2/bulks/{id}\n\nAssuming that you have list ID 55315 with more than 1,000 recipients, call:\n\n> POST https://rest.textmagic.com/api/v2/messages\n\nwith the following parameters:\n\n|Parameter|Value|\n|---------|-----|\n|**templateId**|`10541`|\n|**lists**|`55315`|\n\nYou will receive a result like this:\n\n|Parameter|Example|\n|---------|-------|\n|**id**|`357122`|\n|**href**|`/api/v2/bulks/357122`|\n|**type**|`bulk`|\n|**sessionId**|`null`|\n|**bulkId**|`357122`|\n|**messageId**|`null`|\n|**scheduleId**|`null`|\n\nAs you can see, the **session** has not been created yet; it will be created after processing all the contacts you supplied during the request.\n\n## How to send a text message using an SMS template\n\nNext, let’s try to send an SMS to a contact list using a message template instead of specifying the message text. An extra feature we can use is the [Custom fields](https://docs.textmagic.com/#tag/Custom-Fields) dynamic fields, which we can apply to send personalized texts to all recipients.\n\nLet’s assume that you have these items:\n\n*   a contact list with ID 10541 (with two or more contacts) – you can use test number 999;\n*   the message template with ID 55313 (with **First name** and **Last name** dynamic fields) – when you sign up for a TextMagic account, you automatically receive several message templates, such as **Callback request** or **Booking confirmation**, and you can use any of them;\n*   a sufficient balance in your account to send this SMS message to the contact list.\n\n> POST https://rest.textmagic.com/api/v2/messages\n\nwith the following parameters:\n\n|Parameter|Value|\n|---------|-----|\n|**templateId**|`10541`|\n|**lists**|`55313`|\n\nYou will receive a result like this:\n\n|Parameter|Example|\n|---------|-------|\n|**id**|`34436613`|\n|**href**|`/api/v2/sessions/34436613`|\n|**type**|`session`|\n|**sessionId**|`34436613`|\n|**bulkId**|`null`|\n|**messageId**|`null`|\n|**scheduleId**|`null`|\n\nThis is a sending session with more than one recipient (but fewer than 1,000); see the notes above about sending bulk messages. We cannot select just one message from this session, so the **messageId** is also empty. However, you can [get the session for the messages](https://docs.textmagic.com/#tag/Outbound-Message-Sessions) and then fetch the messages one by one.\n\n## How to send a text message with an attachment\n\nText messages can include only text symbols. If you need to send a PDF document or an image, you need to upload it to a cloud storage service first and then insert a link to this document it into your text message. TextMagic offers an Attachments feature which allows you to upload your document to the TextMagic servers and get a relatively short download link. After that, you just need to insert the link into your message text.\n\nTo upload an attachment, use:\n\n> POST https://rest.textmagic.com/api/v2/messages/attachment\n\nwith a single parameter:\n\n|Parameter|Value|Description|\n|---------|-----|-----------|\n|**file**|`[multipart/form-data]`|Your request with attachment should be sent in `multipart/form-data` format.**Note:** Only .jpg, .gif, .png, .pdf, .txt, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx & .vcf attachment files up to 10 MB are supported.|\n\nYou will receive a result like this:\n\n|Parameter|Example|Description|\n|---------|-------|-----------|\n|**href**|`click/Zwcj9`|This is a relative link to your file. To construct a full link, just add “https://my.textmagic.com/” to the beginning (like this: [https://my.textmagic.com/click/Zwcj9](https://my.textmagic.com/click/Zwcj9)). For most modern devices, you can omit “https://” part and write just [my.textmagic.com/click/Zwcj9](https://my.textmagic.com/click/Zwcj9), it will save you 8 characters.|\n|**chars**|`/api/v2/sessions/11`|`href` field characters count.|**name**|`screen.png`|Original file name that will be displayed on the download/preview page.|\n|**size**|`1094`|Attachment size in bytes.|\n\nIt's as simple as that. Now you can send a text message with this link as described above.\n\n## How to send a MMS message\n\nText messages can include only text symbols. TextMagic offers an MMS feature that allows you to upload your document or picture to the TextMagic servers and get a short resource name to use it. To send MMS you just need to pass the resource name into special param in sending request [see more](https://docs.textmagic.com/#operation/sendMessage).\n\nTo upload an mms attachment, use:\n\n> POST https://rest.textmagic.com/api/v2/messages/mms/attachment\n\nwith a single parameter:\n\n|Parameter|Value|Description|\n|---------|-----|-----------|\n|**file**|`[multipart/form-data]`|Your request with attachment should be sent in `multipart/form-data` format.**Note:** Only .jpg, .gif, .png, .pdf, .txt, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx & .vcf attachment files up to 10 MB are supported.|\n\nYou will receive a result like this:\n\n|Parameter|Example|Description|\n|---------|-------|-----------|\n|**href**|`click/Zwcj9`|This is a relative link to your file. To construct a full link, just add “https://my.textmagic.com/” to the beginning (like this: [https://my.textmagic.com/click/Zwcj9](https://my.textmagic.com/click/Zwcj9)). For most modern devices, you can omit “https://” part and write just [my.textmagic.com/click/Zwcj9](https://my.textmagic.com/click/Zwcj9), it will save you 8 characters.|\n|**chars**|`/api/v2/sessions/11`|`href` field characters count.|**name**|`screen.png`|Original file name that will be displayed on the download/preview page.|\n|**size**|`1094`|Attachment size in bytes.|\n|**resource**|`dasgfdsgdfdfgdfgdf.jpeg`|Internal file name will use in message sending request [see more](https://docs.textmagic.com/#operation/sendMessage).\n\nIt's as simple as that. Now you can send an MMS message.\n\n# Delivery status callback\n\nA callback is a mechanism that posts the JSON body of a sent message to the URL on a server that you specify. The server application which receives the callback can check the message status and trigger actions based on that data.\n\nDelivery status callback is triggered when SMS receives a final status. This is a complete list of final statuses:\n* **d** - delivered;\n* **f** - failed;\n* **j** - rejected;\n* **u** - unknown.\n\nHere is how to set up the delivery status callback URL:\n\n1.  [Log in](https://my.textmagic.com/) to TextMagic (or [start a free trial](https://my.textmagic.com/register/) if you haven’t registered yet).\n2.  Go to the [API](https://my.textmagic.com/online/api/rest-api/keys) page.\n3.  Enter your callback URL into the **Callback URL for delivery notifications** field.\n4.  Click the **Test** button to test your URL.\n5.  If it’s successful, click **Save changes**.\n\nYour server should reply with an **200 OK** response at this URL. If it does not, your callback URL will be treated as invalid and the inbound messages will not be passed to your application.\n\n### Call parameters\n\nYour callback URL will be triggered immediately when the sent message status changes. The parameters are passed by the **POST** method and contain the following information (i.e. exact copy of the **message** resource plus custom **referenceId**, if you have specified it when sending the message via **POST /api/v2/messages**). The Resource format is basically the format of the reply when making the request to the specific API resource.\n\n| Parameter                                                 | Example                    | Description                                                                                                                                                    |\n|-----------------------------------------------------------|----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **id**                                                    | `4991`                     | Message ID.                                                                                                                                                    |**sender**|\n| **sender**                                                | `447624800500`             | Message sender (phone number or alphanumeric Sender ID).                                                                                                       |\n| **receiver**                                              | `447860021130`             |                                                                                                                                                                |\n| Recipient phone number.                                   | **text**                   | `Hello John!`                                                                                                                                                  |\n| Message text (after dynamic fields substitution, if any). |                            |                                                                                                                                                                |\n| **price**                                                 | `0.25`                     |                                                                                                                                                                |Message cost (in account currency).|\n| **status**                                                | `d`                        | Delivery status of the message. Please see the table at the [Sessions](https://docs.textmagic.com/#section/Delivery-status-codes) section to see different delivery statuses. |\n| **partsCount**                                            | `2`                        | Message parts (multiples of 160 characters) count.                                                                                                             |\n| **messageTime**                                           | `2015-06-19T09:48:24+0000` | Sending time.                                                                                                                                                  |\n| **charset**                                               | `UTF-16BE`                 | Message charset. Could be:*   **ISO-8859-1** for plaintext SMS*   **UTF-16BE** for Unicode SMS                                                                 |\n| **firstName**                                             | `John`                     | Contact first name. Could be substituted from your [Contacts](https://docs.textmagic.com/#tag/Contacts) (even if you submitted phone number instead of contact ID).           |\n| **lastName**                                              | `Conway`                   | Contact last name.                                                                                                                                             |\n| **country**                                               | `DK`                       | Two-letter ISO country code of the recipient phone number.                                                                                                     |\n| **referenceId**                                           | `my-reference-id-319`      | Custom message reference ID. You can use your internal IDs to identify the DLRs more easily when doing **POST /api/v2/messages**.                              |\n\n# Delivery status codes\n\nBelow you’ll find several delivery statuses for sent messages, which are divided into two types:\n*   **intermediate** – temporary statuses that can change as the messages are processed;\n*   **final** – these statuses that are final and will not change.\n\n| Delivery status | Type                                                               | Description                                                                            |\n|-----------------|--------------------------------------------------------------------|----------------------------------------------------------------------------------------|\n| **a**           | intermediate                                                       | The mobile operator has acknowledged the message.                                      |\n| **b**           | intermediate                                                       | The mobile operator has queued the message.                                            |\n| **d**           | final                                                              | The message has been successfully delivered to the handset.                            |\n| **e**           | final                                                              | An error occurred while sending the message.                                           |\n| **f**           | final                                                              | An error occurred while delivering the message.                                        |\n| **j**           | final                                                              | The mobile operator has rejected the message.                                          |\n| **g**           | rejected – Contact has unsubscribed (Textmagic internal rejection) | The message was rejected because it was sent to a contact who previously unsubscribed. |\n| **q**           | intermediate                                                       | The message is queued on the TextMagic server.                                         |\n| **r**           | intermediate                                                       | The message has been sent to the mobile operator.                                      |\n| **s**           | intermediate                                                       | This message is scheduled to be sent later.                                            |\n| **u**           | final                                                              | The status is unknown.                                                                 |\n"
    },
    {
      "name": "Inbound Messages",
      "x-displayName": "Messages: Receive\n",
      "description": "With the TextMagic API, you can establish a full two-way communication pipeline for sending and receiving text messages within your application.\n\n## Incoming messages callback\n\nA callback is a mechanism that posts the JSON body of a received message to the URL on a server that you specify. The server application which receives the callback\ncan save the message data into a database, send user notifications, etc.\n\nHere is how to set up the incoming messages callback URL:\n\n1.  [Log in](https://my.textmagic.com/) to TextMagic (or [start a free trial](https://my.textmagic.com/register/) if you haven’t registered yet).\n2.  Go to the [API](https://my.textmagic.com/online/api/settings) page.\n3.  Enter your callback URL into the **Callback URL for incoming messages** field.\n4.  Click the **Test** button to test your URL.\n5.  If it’s successful, click **Save changes**.\n\nYour server should reply with an **200 OK** response at this URL. If it does not, your callback URL will be treated as invalid and the inbound messages will not be passed to\nyour application.\n\n### Call parameters\n\nYour callback URL will be triggered immediately after a message reaches the TextMagic server. The parameters are passed by the **POST** method and contain the following\ninformation (i.e. an exact copy of the **reply** resource). The Resource format is basically the format of the reply when making the request to the specific API resource.\n\n| Parameter | Example | Description |\n| --------- | ------- | ----------- |\n| **id**    | `1782832`| Inbound message ID. |\n| **sender** | `447860021130` | Sender phone number. |\n| **receiver** | `447624800500` | Receiver phone number (i.e. **your** dedicated or shared reply number). |\n| **messageTime** | `2012-11-28T18:38:28+0000` | The time when the message reached the TextMagic server. |\n| **text** | `Test reply` | Inbound message text. |\n"
    },
    {
      "name": "Scheduled Messages",
      "x-displayName": "Messages: Schedule\n",
      "description": "You can schedule text messages to be sent at a later date or time, or you can create recurring text message sessions with TextMagic API. Below is a detailed overview of how to do both.\n"
    },
    {
      "name": "Outbound Message Sessions",
      "x-displayName": "Sessions",
      "description": "When you send an SMS to more than one recipient, it is collected as one **message session**. However, the text in your messages (in one session) \nmay vary and you can send personalized texts using [Templates](https://docs.textmagic.com/#tag/Templates). But first, let’s learn how to manage SMS sessions \nvia the TextMagic API."
    },
    {
      "name": "Lists",
      "x-displayName": "Lists",
      "description": "With the Lists API, you can arrange your database contacts into different lists for sending targeted bulk text messages."
    },
    {
      "name": "Contacts",
      "x-displayName": "Contacts",
      "description": "To make sending messages easier, you can use contacts instead of phone numbers. Your contacts will be safely kept on TextMagic servers and will be available from any location. This page shows how to create, edit and delete contacts."
    },
    {
      "name": "Custom Fields",
      "description": "With custom fields, you can store custom data in contacts and use the data with [Templates](https://docs.textmagic.com/#tag/Templates)."
    },
    {
      "name": "Contact Notes",
      "description": ""
    },
    {
      "name": "Tags",
      "description": "# Tags API\n\nThe Tags API allows you to create and manage tags for organizing and categorizing your contacts in the TextMagic platform. Tags provide a flexible way to segment your contact database.\n\n## Key Features\n\n- **Contact Organization**: Categorize contacts with custom tags for better organization\n- **Flexible Segmentation**: Create unlimited tags to segment your contact database\n- **Custom Categorization**: Define your own tag names to match your business needs\n- **Multi-tag Support**: Apply multiple tags to a single contact for complex segmentation\n\n## Tag Management\n\n### Creating Tags\nCreate new tags with descriptive names to categorize your contacts. Tag names must be unique within your account and can be up to 50 characters long.\n\n### Applying Tags to Contacts\nOnce created, tags can be assigned to contacts individually or in bulk. A single contact can have multiple tags for flexible organization.\n\n## Getting Started\n\n1. Create tags using the Create Tag endpoint with descriptive names\n2. Apply tags to your contacts through the contact management endpoints\n3. Use tags to filter and target contacts\n4. Monitor and manage your tags through the Tags API endpoints\n\nFor detailed endpoint documentation, see the individual endpoint descriptions below.\n"
    },
    {
      "name": "Chats",
      "x-displayName": "Chats",
      "description": "In TextMagic, an SMS chat is a convenient grouping of inbound and outbound messages, addressed to specified recipients and arranged as a sorted list. Take a look at the [SMS Chat](https://docs.textmagic.com/#tag/Chats) feature in TextMagic Online. Under the hood, this feature is represented by the **chat** resource.\n"
    },
    {
      "name": "Templates",
      "x-displayName": "Templates",
      "description": "Templates can save time and effort when the same message format is required. Furthermore,\nyour customers will receive personalized messages even when you’ve applied templates.\nAll you have to do is insert the embed **dynamic fields** into the template text.\n\n## Custom fields list (Merge dynamic fields)\n\nAll dynamic fields should be inputted inside curly braces (e.g., `{First name}` for **First name**).\n\n| Dynamic field | Description |\n|---------------|-------------|\n| **First name** | Contact first name. |\n| **Last name** | Contact last name. |\n| **Company name** | Contact company. |\n| **Phone** | Contact phone number. |\n| **Email** | Email. |\n| [Custom fields](https://docs.textmagic.com/#tag/Custom-Fields) | Contact custom field values. |\n"
    },
    {
      "name": "Send Email to SMS",
      "x-virtual": true,
      "description": "Mobile marketing (for product promotion) is a very powerful tool for your business – and this is where sending SMS messages using email stands out.\n\nYou can set up a two-way communication without needing to write even one line of code: all you need is an email client and a TextMagic account. With this system, you can send ordinary emails, and your recipients will receive SMS messages (and vice versa, when they reply to you, you will receive their text through email).\n\n## Getting started\n\nTo start sending text messages from your email, you first need to configure your Email to SMS settings.\n\nTo add email addresses for sending an SMS:\n\n1.  [Log in](https://my.textmagic.com/) to TextMagic (or [start a free trial](https://my.textmagic.com/register/) if you haven’t registered yet).\n2.  Go to [Allowed emails](https://my.textmagic.com/online/emailtosms/emails).    \n3.  Add the email addresses that you own or control, one per line.\n4.  Click **Save**.\n\n> Please note, if an email address does not belong to you, we recommend you use a [Distribution List](https://docs.textmagic.com/#tag/Distribution-Lists).\n\n## Send SMS from an email\n\nThe following example email will send **The Free Encyclopedia** in an SMS to the two mobile phones with the numbers listed.\n\n| Variable | Value |\n|-------|-------|\n|From:|`your_registered_email@yourdomain.com` ([Add your allowed emails](https://www.textmagic.com/app/wt/messages/esms)).|\n|To: |`4412345678@textmagic.com, 4912345678@textmagic.com` |\n|Subject: |You can leave the subject blank. |\n|Body: |`The Free Encyclopedia` |\n\nThe recipients (+4412345678 and +4912345678) will receive this email as an SMS.\n\n## Send and Receive Settings\n\nThe **Send and Receive Settings** lets you control the amount of each email you send as an SMS. They also limit the number of texts per message. These settings will help you control your budget.\n\n1.  [Log in](https://my.textmagic.com/) to TextMagic (or [start a free trial](https://my.textmagic.com/register/) if you haven’t registered yet).\n2.  Go to [Send & Receive Settings](https://my.textmagic.com/online/emailtosms/settings).\n3.  Edit your message content and length settings as needed.\n4.  Click **Save**.\n\n> Please note, you are charged according to [the length of the text message](https://support.textmagic.com/faq/how-many-characters-can-i-include-in-a-text-message/) you send.\n\nYou’re now ready to send and receive SMS messages via email.\n"
    },
    {
      "name": "Receive SMS to Email",
      "x-virtual": true,
      "description": "When someone replies to an SMS you’ve sent via email to the SMS service, the reply will be sent to the originating email address. This means that you can simply reply to all incoming emails from the TextMagic service and the recipient will receive the reply as an SMS.\n\n## How to set up incoming SMS alerts\n\nTo set up an incoming messages notification:\n\n1.  [Log in](https://my.textmagic.com/) to TextMagic (or [start a free trial](https://my.textmagic.com/register/) if you haven’t registered yet).\n2.  Go to [Incoming SMS alerts](https://my.textmagic.com/online/account/notifications/incoming).\n3.  To turn on the receiving **SMS to Email** service, enable the **New incoming SMS** option.\n4.  If you want the last ten messages from your conversation included in the email reply, turn on the **Recent Chat History** feature.\n\n> Normally, the reply is sent to the email address that started the conversation. For example, if you sent an email from **charles@example.com** to [447971001234@textmagic.com](mailto:447971001234@textmagic.com) and the recipient replied to that address, that reply will be sent to **charles@example.com** by default. However, you can also nominate up to three additional email addresses to receive a copy of that email. Add them into the **Forward incoming SMS to email 1**, **2** or **3** fields.\n\n## Incoming SMS email alert (example)\n\nWhen someone replies to a message you sent using **Email To SMS**, TextMagic will forward the reply to your email.\n\n| Variable | Value |\n|-------|-------|\n| From: | 4912345678@textmagic.com |\n| Body: | Hi, I just received your message. Phil. |\n"
    },
    {
      "name": "Distribution Lists",
      "description": "In this section, you’ll learn how to forward your emails as text messages to one or even to hundreds of people and learn how to never miss another alert or notification.\n\n## How distribution lists work\n\nAll emails sent to your SMS distribution list email addresses will be immediately forwarded as text messages to all the mobile phone numbers in that distribution list. You can read more about distribution lists from our [marketing site](https://www.textmagic.com/sms-distribution-lists/) or [help center](https://support.textmagic.com/article/how-to-forward-to-distribution-list-members-via-email-to-sms/).\n\n## How to create a distribution list\n\nTo create a distribution list:\n\n1.  Go to [Distribution lists](https://my.textmagic.com/online/emailtosms/distribution-lists).\n2.  Click **New distribution list**.\n3.  Give your list a name.\n4.  Add recipients (phone numbers, contacts or lists).\n5.  Choose the content and message length settings.\n6.  Choose what phone number will be sent with the messages. Click here to learn more about [sender settings](https://support.textmagic.com/article/how-to-manage-sender-settings/).\n7.  Click **Continue**.\n\nNow you can set up forwarding in your email application or send emails to the distribution address.\n\n> Anyone who knows the email address associated with your distribution list could send an email to it. This could result in several messages being sent from your account. Therefore, it is advised that you don’t use this email address for signing up an account or share it with the public. Keep it secret.\n\n## Distribution list usage (example)\n\nLet’s imagine we’ve created a distribution list `fe5436332432733@textmagic.com` and have added `+447812345678`, `+447812345679`, `+447812345670` numbers as recipients.  \n  \nIn order for all of them to receive the text message, we send an email with following details:\n\n| Variable | Value |\n|-------|-------|\n| From: | `your_email@yourdomain.com` |\n| To: | `fe5436332432733@textmagic.com` |\n| Subject: | You can leave the subject blank. |\n| Body: |  `Server downtime started 10:32:02 UTC. Please react ASAP.`|\n\nAs a result, all three recipients will receive the text message and will be able to react quickly to fix the server issue.\n\n> You can also include TextMagic contact **lists** and separate **contacts** in the distribution list’s recipients field to avoid having to add numbers one by one."
    },
    {
      "name": "Sender Settings",
      "x-displayName": "Overview",
      "description": "In this section, you’ll learn about the different sender settings and how to set the reply number in messages.\n\n## The differences among sender settings\n\nBy default, the SMS you’ve sent will use the reply numbers that are shared among all your customers.* Those can be used for free. However, to personalize the number, there are four different sender settings:\n\n| Feature | Shared reply number | Dedicated number | Alphanumeric Sender ID | Own mobile number | \n|---------|---------------------|------------------|------------------------|-------------------|\n| Can receive replies | Yes | Yes | No | To mobile |\n| Is shared among sub-accounts | Yes | No | Yes | No | \n| Monthly fee | FREE | From £2.40 | FREE | FREE\n\n\\*  Even though the numbers are shared, each customer can see only their own replies. [Read more](https://support.textmagic.com/faq/what-is-the-difference-between-dedicated-number-and-shared-number/)."
    },
    {
      "name": "Sender IDs",
      "description": "Sender ID allows you to show your company name instead of the reply number.\n\n## What is an alphanumeric Sender ID?\nSender IDs allow you to send personalized text messages that do not need a reply. You can apply for Sender IDs that are closely connected to your business; for example, **HotPizza**, **ITDelivery**, **Insurance**. This is the best solution for transactional SMSs with order confirmations or temporary security codes.\n\n> All Sender IDs are reviewed by our support team.\n \n> Note, in [several countries](https://support.textmagic.com/article/how-to-understand-sender-setting-restrictions/) the sender ID feature is not supported. Please test before using it in real sending sessions.\n \n "
    },
    {
      "name": "User",
      "x-displayName": "Account",
      "description": "You can browse and modify your account information via the TextMagic SMS API. This page will explain how to do that."
    },
    {
      "name": "User Subaccounts",
      "x-displayName": "Sub-Accounts",
      "x-internal": true,
      "description": "You can use the TextMagic SMS API to invite other people to become sub-accounts. You can also manage them as and when needed.\n\n## Sub-account roles\n\nThere are two types of sub-account: regular user and administrator.\n\n*   A **regular** **user** sub-account allows the user to do everything except buy SMS credit and manage other sub-accounts.\n*   An **administrator** sub-account gives the user access to all features including buying SMS credit and managing other sub-accounts.\n\n> Only parent users and administrators can manage sub-accounts."
    },
    {
      "name": "Statistic",
      "x-displayName": "Statistics",
      "description": "You can get detailed sent messages reports and user statements for a selected period of time using TextMagic SMS API commands."
    },
    {
      "name": "Billing",
      "x-displayName": "Invoices",
      "description": "With the TextMagic API, you can check the invoices and transactions for your account.\n\n> Only parent users and administrator sub-accounts can view invoices."
    },
    {
      "name": "Response Codes",
      "x-virtual": true,
      "description": "All of the possible response codes you can get from the TextMagic API are described on this page.\n\n## HTTP response codes\n\nWhen you make a request to the TextMagic REST API, you will receive a response that represents the new or modified object state (when you use **GET**/ **POST**/ **PUT** methods) or a success message (when you **DELETE** a resource). But if something goes wrong, instead of **20x,** you will get a different status code. Here are all the possible response codes:\n\n| Code | Explanation|\n|------|----------- |\n| 200 OK| Common OK status code. Request was successful.|\n| 201 Created| A resource has been created or updated successfully.|\n| 202 Accepted| Request accepted and is being processed.|\n| 204 No content| Resource deleted successfully.|\n| 302 Found| Redirect. Your code should follow the address specified in the **Location** header.|\n| 400 Bad request| Invalid parameters specified: some required parameters are missing or malformed. Check the corresponding command documentation.|\n| 401 Unauthorized| Current user has no rights to perform the specified action. For example, regular users cannot view [Invoices](https://docs.textmagic.com/#tag/Billing) or [Sub-Accounts](#tag/User-Subaccounts).|\n| 404 Not found| Resource not found.|\n| 429 Too many requests| Request limit reached. Please try again later.| \n| 500 Internal server error| Internal server error has occurred. Please try again later.|\n| 503 Service unavailable | Service is unavailable due to maintenance.|\n\n## Error responses\nIn case of an error, the TextMagic API responds with one of the HTTP error codes (4xx-5xx as shown below) and returns these common error responses.\n<SchemaDefinition schemaRef=\"#/components/schemas/BadRequestResponse\" />\n\n## Link responses\nWhen you create or update some resource (via  **POST** and  **PUT **requests) you will get a link response:\n\n<SchemaDefinition schemaRef=\"#/components/schemas/ResourceLinkResponse\" />\n\n## Delete responses\nWhen you delete something, a delete response will be returned. The response body will be empty and the HTTP code will show **204 No Content**."
    },
    {
      "name": "Restrictions and Limits",
      "x-virtual": true,
      "description": "The TextMagic SMS API has only one restriction and two limitations. Learn more about them below.\n\n## Number format restriction\nYou must use the [E.164](https://en.wikipedia.org/wiki/E.164) phone number format during the API request as no local phone formats are accepted (i.e. use **447045678945** instead of **070 4567 8945**). This restriction has been applied to ensure delivery to the desired number without any accidental local-to-international phone transformations.\n\n## Maximum “limit” parameter value\nCommands that return an array of resources (e.g. GET /api/v2/messages) can take the **limit** parameter, which can be between `1` and `100`, otherwise it will be replaced with the default value of `10`.\n\n## API request frequency limit\nYou may not execute more than **50 requests per second**. If you do, a `429 Too Many Requests` error will be returned. Please note that you can use contacts, lists and templates for [sending multiple messages](/docs/api/send-sms/#send-bulk-text-messages) simultaneously per request.\n\n**However, the following endpoints are subject to stricter rate limits of 5 requests per second**:\n\n- `DELETE /api/v2/contacts/blocked`\n- `PUT /api/v2/contacts/{id}`\n- `PUT /api/v2/lists/{id}/contacts`\n- `POST /api/v2/lists/{id}/contacts`\n\nPlease ensure your integration respects these limits to avoid service disruptions.\n\n"
    },
    {
      "name": "Encoding",
      "x-virtual": true,
      "description": "The text-message parameters should be encoded in the UTF-8 character set. All non-ASCII characters in command parameters should be [encoded](https://en.wikipedia.org/wiki/Percent-encoding). The primary role of URL encoding is to encode URL strings into a form that can be passed via email or scripted-web links without altering the actual content in any way.\n\n## Supported character sets\n\n### GSM 03.38 encoding\n\nThe standard SMS mobile-phone character set is used universally to send text messages. You can send a longer text message by using only GSM 03.38 characters. The standard character set allows up to 160 characters, and includes the Latin alphabet and the most common accented forms, certain special characters, and the Greek alphabet. It includes the following characters:\n\n<pre style='font-family: Monaco,Monako,Menlo,Consolas,courier new,monospace!important'>\n@   Δ    SP   0    ¡    P    ¿    p\n£   _    !    1    A    Q    a    q\n$   Φ    \"    2    B    R    b    r\n¥   Γ    #    3    C    S    c    s\nè   Λ    ¤    4    D    T    d    t\né   Ω    %    5    E    U    e    u\nù   Π    &    6    F    V    f    v\nì   Ψ    '    7    G    W    g    w\nò   Σ    (    8    H    X    h    x\nÇ   Θ    )    9    I    Y    i    y\nLF  Ξ    *    :    J    Z    j    z\nØ   ESC  +    ;    K    Ä    k    ä\nø   Æ    ,    <    L    Ö    l    ö\n</pre>\n\n**Note**: An escape character always precedes the characters `{ } \\ ~ [ ] | ^ €`, which therefore takes two characters to send.\n\n### Unicode\n\nWhen using non-GSM 03.38 characters, SMS transmits the message as a Unicode message. Unicode character support also provides the capability to send a message in Arabic, Japanese, Russian, Chinese and other alphabets.\n\n## Message length\n\n### GSM 03.38 encoding\n\nSingle text messages are limited to 160 characters, including spaces. However, to get around this restriction, messages can be linked together (up to 6 parts) to form one long message.\n\nIn reality, each concatenated text message is limited to 153 characters rather than 160 due to the need for user-data header (UDH) information. This applies only to messages that contain the standard GSM 03.38 character set. Mobile phones use UDH information to enable them to link long messages together so that they appear as a single SMS message in the recipients’ inboxes.\n\n| Number of SMSs | Total number of characters in the linked message|\n|----------------|-------------------------------------------------|\n| 1| 160|\n| 2| 306|\n| 3| 459|\n| 4| 612|\n| 5| 765|\n| 6| 918|\n\n### Unicode\n\nUsing Unicode (for Russian, Arabic and Chinese languages) restricts messages to a maximum of 70 characters per SMS. You can, however, send longer text messages with our system by splitting them into two or at the most three separate text messages. The table below gives the maximum lengths of two or more parts of a concatenated Unicode text message.\n\n| Number of SMSs|Total number of characters in the linked message|\n|---------------|------------------------------------------------|\n|1|70|\n|2|134|\n|3|201|\n|4|268|\n|5|335|\n|6|402|\n"
    },
    {
      "name": "SDKs",
      "x-virtual": true,
      "x-displayName": "SDK",
      "description": "The TextMagic SMS API PHP wrapper can save you a lot of time, as it includes all the necessary API commands and tests. It only takes a few seconds to download it from GitHub and to install it into your own app or software. After installation, you'll then be able to send text messages.\n\n### License\nThese SDK libraries are available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n### Support\nIf you need help with the wrapper or if you have any suggestions for improvements, please contact us by emailing [support@textmagic.com](mailto:support@textmagic.com).\n# PHP\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-php-v2&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your PHP application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-php-v2)\n\n## Requirements\n\n- **PHP 8.1** or later\n- **Composer** for dependency management\n- **cURL** extension\n- **JSON** extension\n- **mbstring** extension\n\n## Installation\n\n### Via Composer (Recommended)\n\nInstall the SDK using [Composer](https://getcomposer.org/):\n\n```bash\ncomposer require textmagic/textmagic-rest-php-v2\n```\n\nOr add it to your `composer.json`:\n\n```json\n{\n    \"require\": {\n        \"textmagic/textmagic-rest-php-v2\": \"^3.0.50032\"\n    }\n}\n```\n\nThen run:\n\n```bash\ncomposer install\n```\n\n### Manual Installation\n\nDownload the files and include `autoload.php`:\n\n```php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n```\n\n## Quick Start\n\n### Basic Usage\n\n```php\n<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your credentials from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Test connection\ntry {\n    $result = $api->ping();\n    echo \"Ping successful: \" . $result->getPing() . PHP_EOL;\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Error: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n}  catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->ping: ', $e->getMessage(), PHP_EOL;\n}\n```\n\n### Sending Messages\n\n```php\n<?php\nuse TextMagic\\Models\\SendMessageRequest;\n\n$input = new SendMessageRequest();\n$input->setText('Hello from TextMagic PHP SDK!');\n$input->setPhones('+19993322111,+19993322110');\n\ntry {\n    $result = $api->sendMessage($input);\n    echo \"Message sent! Session ID: \" . $result->getId() . PHP_EOL;\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'Failed to send message: ' . $e->getMessage() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->sendMessage: ', $e->getMessage(), PHP_EOL;\n}\n```\n\n### Getting Outgoing Messages\n\n```php\n<?php\ntry {\n    $result = $api->getAllOutboundMessages(1, 10);\n    foreach ($result->getResources() as $message) {\n        echo \"Message ID: \" . $message->getId() . PHP_EOL;\n        echo \"Text: \" . $message->getText() . PHP_EOL;\n        echo \"Status: \" . $message->getStatus() . PHP_EOL;\n    }\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'Error: ' . $e->getMessage() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getAllOutboundMessages: ', $e->getMessage(), PHP_EOL;\n}\n```\n\n### Uploading Files\n\n```php\n<?php\ntry {\n    $file = new \\SplFileObject(\"avatar.jpg\");\n    $result = $api->uploadListAvatar($file, 3223); // 3223 number here it is sample list ID\n    echo \"Avatar uploaded successfully!\" . PHP_EOL;\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'Upload failed: ' . $e->getMessage() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->uploadListAvatar: ', $e->getMessage(), PHP_EOL;\n}\n```\n\n## Migration Guide from v2.x to v3.x\n\n### Breaking Changes\n\n#### PHP Version Requirement\n\n**v2.x:**\n```json\n\"php\": \"^7.2.5 || ^8.0\"\n```\n\n**v3.x:**\n```json\n\"php\": \"^8.1\"\n```\n\n**Action Required:** Upgrade your PHP version to 8.1 or later.\n\n```bash\n# Check your PHP version\nphp -v\n\n# Should output: PHP 8.1.x or higher\n```\n\n#### Dependencies Update\n\n**v2.x:**\n```json\n\"phpunit/phpunit\": \"^4.8\"\n\"guzzlehttp/guzzle\": \"^7.2\"\n```\n\n**v3.x:**\n```json\n\"phpunit/phpunit\": \"^10.0\"\n\"guzzlehttp/guzzle\": \"^7.3\"\n```\n\n**Note:** PHPUnit 10 is required for PHP 8.1 compatibility. PHPUnit 8 and 9 do not support PHP 8.1.\n\n### What Stays the Same\n\n✅ **Namespaces** - No changes required:\n```php\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Models\\SendMessageRequest;\nuse TextMagic\\Configuration;\n```\n\n✅ **API Methods** - All methods remain the same:\n```php\n$api->sendMessage($input);\n$api->getAllOutboundMessages($page, $limit);\n$api->getContact($id);\n// ... all other methods unchanged\n```\n\n✅ **Model Classes** - All models remain the same:\n```php\nnew SendMessageRequest();\nnew CreateContactRequest();\n// ... all other models unchanged\n```\n\n✅ **Configuration** - Configuration setup remains the same:\n```php\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n```\n\n### Step-by-Step Migration\n\n1. **Upgrade PHP to 8.1+**\n   ```bash\n   # macOS (Homebrew)\n   brew install php@8.1\n\n   # Ubuntu/Debian\n   sudo apt-get install php8.1\n\n   # Verify\n   php -v\n   ```\n\n2. **Update Composer Dependencies**\n   ```bash\n   # Update composer.json\n   composer require textmagic/textmagic-rest-php-v2:^3.0\n\n   # Or update all dependencies\n   composer update\n   ```\n\n3. **Test Your Application**\n   ```bash\n   # Run your tests\n   vendor/bin/phpunit\n\n   # Or test manually\n   php your_script.php\n   ```\n\n### Compatibility Matrix\n\n|    Feature    | v2.x | v3.x | Compatible? |\n|---------------|------|------|-------------|\n| PHP 7.2-7.4   |  ✅  |  ❌  |    ❌ No    |\n| PHP 8.0       |  ✅  |  ❌  |    ❌ No    |\n| PHP 8.1+      |  ✅  |  ✅  |    ✅ Yes   |\n| API Methods   | Same | Same |    ✅ Yes   |\n| Models        | Same | Same |    ✅ Yes   |\n| Configuration | Same | Same |    ✅ Yes   |\n\n### Need Help?\n\n- 📖 [Full Documentation](https://docs.textmagic.com/)\n- 💬 [Support](https://www.textmagic.com/support/)\n- 🐛 [Report Issues](https://github.com/textmagic/textmagic-rest-php-v2/issues)\n\n\n\n# Node.js\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-nodejs-v2&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your Node.js application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-nodejs-v2)\n\n## Requirements\n\n- **Node.js 18.0.0** or later\n- **npm** or **yarn** for package management\n\n## Installation\n\n### Via npm (Recommended)\n\n```bash\nnpm install textmagic-client --save\n```\n\n### Via yarn\n\n```bash\nyarn add textmagic-client\n```\n\n## Development\n\nThis SDK uses **Babel** to transpile modern ES6+ code to CommonJS for maximum compatibility.\n\n### Build Process\n\nThe SDK source code is written in ES6+ (located in `src/`) and is automatically transpiled to ES5/CommonJS (in `dist/`) during installation:\n\n```bash\nnpm install  # Automatically runs: npm run build\n```\n\n### Manual Build\n\nIf you need to rebuild the SDK manually:\n\n```bash\nnpm run build\n```\n\nThis will transpile all files from `src/` to `dist/` using Babel.\n\n## Quick Start\n\n### Basic Usage\n\n```javascript\nconst TextMagicClient = require('textmagic-client');\n\n// Get your credentials from: https://app.textmagic.com/settings/api\nconst defaultClient = TextMagicClient.ApiClient.instance;\nconst BasicAuth = defaultClient.authentications['BasicAuth'];\n\nBasicAuth.username = 'YOUR_USERNAME';\nBasicAuth.password = 'YOUR_API_KEY';\n\nconst api = new TextMagicClient.TextMagicApi();\n\n// Test connection\napi.ping()\n  .then(data => {\n    console.log('Ping successful:', data.ping);\n  })\n  .catch(error => {\n    console.error('API Error:', error);\n  });\n```\n\n### Using async/await (Modern Approach)\n\n```javascript\nconst TextMagicClient = require('textmagic-client');\n\nasync function main() {\n  const defaultClient = TextMagicClient.ApiClient.instance;\n  const BasicAuth = defaultClient.authentications['BasicAuth'];\n\n  BasicAuth.username = 'YOUR_USERNAME';\n  BasicAuth.password = 'YOUR_API_KEY';\n\n  const api = new TextMagicClient.TextMagicApi();\n\n  try {\n    // Test connection\n    const pingResult = await api.ping();\n    console.log('Ping successful:', pingResult.ping);\n  } catch (error) {\n    console.error('API Error:', error);\n  }\n}\n\nmain();\n```\n\n### Sending Messages\n\n```javascript\nconst TextMagicClient = require('textmagic-client');\n\nasync function sendMessage() {\n  const defaultClient = TextMagicClient.ApiClient.instance;\n  const BasicAuth = defaultClient.authentications['BasicAuth'];\n\n  BasicAuth.username = 'YOUR_USERNAME';\n  BasicAuth.password = 'YOUR_API_KEY';\n\n  const api = new TextMagicClient.TextMagicApi();\n\n  const sendMessageRequest = new TextMagicClient.SendMessageRequest();\n  sendMessageRequest.text = 'Hello from TextMagic Node.js SDK!';\n  sendMessageRequest.phones = '+19993322111,+19993322110';\n\n  try {\n    const result = await api.sendMessage(sendMessageRequest);\n    console.log('Message sent! Session ID:', result.id);\n  } catch (error) {\n    console.error('Failed to send message:', error);\n  }\n}\n\nsendMessage();\n```\n\n### Getting Outgoing Messages\n\n```javascript\nconst TextMagicClient = require('textmagic-client');\n\nasync function getMessages() {\n  const defaultClient = TextMagicClient.ApiClient.instance;\n  const BasicAuth = defaultClient.authentications['BasicAuth'];\n\n  BasicAuth.username = 'YOUR_USERNAME';\n  BasicAuth.password = 'YOUR_API_KEY';\n\n  const api = new TextMagicClient.TextMagicApi();\n\n  try {\n    const result = await api.getAllOutboundMessages(1, 10);\n\n    result.resources.forEach(message => {\n      console.log('Message ID:', message.id);\n      console.log('Text:', message.text);\n      console.log('Status:', message.status);\n      console.log('---');\n    });\n  } catch (error) {\n    console.error('Error:', error);\n  }\n}\n\ngetMessages();\n```\n\n### Uploading Files\n\n```javascript\nconst TextMagicClient = require('textmagic-client');\nconst fs = require('fs');\n\nasync function uploadAvatar() {\n  const defaultClient = TextMagicClient.ApiClient.instance;\n  const BasicAuth = defaultClient.authentications['BasicAuth'];\n\n  BasicAuth.username = 'YOUR_USERNAME';\n  BasicAuth.password = 'YOUR_API_KEY';\n\n  const api = new TextMagicClient.TextMagicApi();\n\n  try {\n    const fileStream = fs.createReadStream('avatar.jpg');\n    const result = await api.uploadListAvatar(fileStream, 3223); // 3223 is sample list ID\n    console.log('Avatar uploaded successfully!');\n  } catch (error) {\n    console.error('Upload failed:', error);\n  }\n}\n\nuploadAvatar();\n```\n\n## Error Handling\n\nThe SDK uses Promises and can throw errors that should be properly handled:\n\n```javascript\nconst TextMagicClient = require('textmagic-client');\n\nasync function handleErrors() {\n  const defaultClient = TextMagicClient.ApiClient.instance;\n  const BasicAuth = defaultClient.authentications['BasicAuth'];\n\n  BasicAuth.username = 'YOUR_USERNAME';\n  BasicAuth.password = 'YOUR_API_KEY';\n\n  const api = new TextMagicClient.TextMagicApi();\n\n  try {\n    const result = await api.sendMessage({\n      text: 'Test message',\n      phones: '+1234567890'\n    });\n    console.log('Success:', result);\n  } catch (error) {\n    // Handle different types of errors\n    if (error.response) {\n      // API returned an error response\n      console.error('API Error:', error.response.status);\n      console.error('Error details:', error.response.body);\n    } else if (error.request) {\n      // Request was made but no response received\n      console.error('Network Error:', error.message);\n    } else {\n      // Something else went wrong\n      console.error('Error:', error.message);\n    }\n  }\n}\n\nhandleErrors();\n```\n\n### Common Error Codes\n\n- **401 Unauthorized** - Invalid credentials\n- **400 Bad Request** - Invalid parameters\n- **404 Not Found** - Resource not found\n- **429 Too Many Requests** - Rate limit exceeded\n- **500 Internal Server Error** - Server error\n\n## API Documentation\n\nFor complete API documentation, including all available methods, parameters, and response formats, please visit:\n\n- 📖 **[TextMagic API Documentation](https://docs.textmagic.com/)**\n- 🔗 **[API Reference](https://docs.textmagic.com/#tag/TextMagic-API)**\n\n### Available API Methods\n\nThe SDK provides access to all TextMagic API endpoints through the `TextMagicApi` class. Some commonly used methods include:\n\n**Messaging:**\n- `sendMessage(request)` - Send SMS messages\n- `getAllOutboundMessages(page, limit)` - Get sent messages\n- `getAllInboundMessages(page, limit)` - Get received messages\n- `deleteMessage(id)` - Delete a message\n\n**Contacts:**\n- `createContact(request)` - Create a new contact\n- `getContact(id)` - Get contact details\n- `updateContact(id, request)` - Update contact information\n- `deleteContact(id)` - Delete a contact\n- `getAllContacts(page, limit)` - Get all contacts\n\n**Lists:**\n- `createList(request)` - Create a contact list\n- `getList(id)` - Get list details\n- `getAllLists(page, limit)` - Get all lists\n- `assignContactsToList(request)` - Add contacts to a list\n\n**Account:**\n- `ping()` - Test API connection\n- `getUser()` - Get account information\n- `getUserBalance()` - Get account balance\n\nFor a complete list of available methods, please refer to the generated SDK documentation in the `docs/` directory.\n\n## Migration Guide from v2.x to v3.x\n\n### Breaking Changes\n\n#### Node.js Version Requirement\n\n**v2.x:**\n```json\n\"node\": \">=6.0.0\"\n```\n\n**v3.x:**\n```json\n\"node\": \">=18.0.0\"\n```\n\n**Action Required:** Upgrade your Node.js version to 18.0.0 or later.\n\n```bash\n# Check your Node.js version\nnode -v\n\n# Should output: v18.x.x or higher\n```\n\n#### Dependencies Update\n\n**v2.x:**\n```json\n\"superagent\": \"^3.5.2\"\n```\n\n**v3.x:**\n```json\n\"superagent\": \"^10.2.2\",\n\"@babel/cli\": \"^7.24.0\"\n```\n\n**Note:**\n- Superagent 10.x includes modern features, better TypeScript support, and security improvements.\n- Babel is now used to transpile ES6+ code to CommonJS for maximum compatibility.\n\n### What Stays the Same\n\n✅ **Module structure** - No changes required:\n```javascript\nconst TextMagicClient = require('textmagic-client');\nconst api = new TextMagicClient.TextMagicApi();\n```\n\n✅ **Authentication** - Configuration remains the same:\n```javascript\nconst BasicAuth = defaultClient.authentications['BasicAuth'];\nBasicAuth.username = 'YOUR_USERNAME';\nBasicAuth.password = 'YOUR_API_KEY';\n```\n\n✅ **API Methods** - All methods remain the same:\n```javascript\napi.sendMessage(request);\napi.getAllOutboundMessages(page, limit);\napi.getContact(id);\n// ... all other methods unchanged\n```\n\n### Step-by-Step Migration\n\n1. **Upgrade Node.js to 18.0.0+**\n   ```bash\n   # Using nvm (recommended)\n   nvm install 18\n   nvm use 18\n\n   # Verify\n   node -v\n   ```\n\n2. **Update Package Dependencies**\n   ```bash\n   # Update to latest version\n   npm install textmagic-client@latest --save\n\n   # Or update all dependencies\n   npm update\n   ```\n\n3. **Update Your Code to Use async/await (Recommended)**\n\n   **Before (v2.x):**\n   ```javascript\n   api.ping().then(function(data) {\n     console.log(data.ping);\n   }).catch(function(err) {\n     console.error(err);\n   });\n   ```\n\n   **After (v3.x):**\n   ```javascript\n   try {\n     const data = await api.ping();\n     console.log(data.ping);\n   } catch (error) {\n     console.error(error);\n   }\n   ```\n\n4. **Test Your Application**\n   ```bash\n   # Run your tests\n   npm test\n\n   # Or test manually\n   node your_script.js\n   ```\n\n### Compatibility Matrix\n\n|    Feature    | v2.x | v3.x | Compatible? |\n|---------------|------|------|-------------|\n| Node.js 6-16  |  ✅  |  ❌  |    ❌ No    |\n| Node.js 18+   |  ✅  |  ✅  |    ✅ Yes   |\n| API Methods   | Same | Same |    ✅ Yes   |\n| Models        | Same | Same |    ✅ Yes   |\n| Authentication| Same | Same |    ✅ Yes   |\n| Promises      |  ✅  |  ✅  |    ✅ Yes   |\n| async/await   |  ✅  |  ✅  |    ✅ Yes   |\n\n### Need Help?\n\n- 📖 [Full Documentation](https://docs.textmagic.com/)\n- 💬 [Support](https://www.textmagic.com/support/)\n- 🐛 [Report Issues](https://github.com/textmagic/textmagic-rest-nodejs-v2/issues)\n\n# Java\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-java-v2&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your Java application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-java-v2)\n\n\n## Requirements\n\n1. Java 11+\n2. Maven/Gradle\n\n## Migration Guide from v2.x to v3.x\n\nVersion 3.0 introduces several breaking changes to improve performance, security, and maintainability. Please review this guide carefully before upgrading.\n\n### Breaking Changes\n\n#### 1. Java Version Requirement\n\n**Old (v2.x):**\n- Minimum Java version: 1.7+\n\n**New (v3.x):**\n- Minimum Java version: 11+\n\n**Action Required:**\n```xml\n<!-- Update your pom.xml -->\n<properties>\n    <maven.compiler.source>11</maven.compiler.source>\n    <maven.compiler.target>11</maven.compiler.target>\n</properties>\n```\n\n#### 2. Date/Time Types\n\n**Old (v2.x):**\n```java\nimport java.util.Date;\n\nDate createdAt = message.getCreatedAt();\n```\n\n**New (v3.x):**\n```java\nimport java.time.OffsetDateTime;\n\nOffsetDateTime createdAt = message.getCreatedAt();\n```\n\n**Action Required:**\n- Replace all `java.util.Date` with `java.time.OffsetDateTime`\n- Update date formatting logic:\n  ```java\n  // Old\n  SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n  String date = sdf.format(createdAt);\n\n  // New\n  DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd\");\n  String date = createdAt.format(formatter);\n  ```\n\n#### 3. HTTP Client Library\n\n**Old (v2.x):**\n- OkHttp 2.7.5\n\n**New (v3.x):**\n- OkHttp 4.12.0\n\n**Action Required:**\n- If you use custom OkHttp interceptors, update to OkHttp 4.x API:\n  ```java\n  // Old (v2.x)\n  client.interceptors().add(new Interceptor() {\n      @Override\n      public Response intercept(Chain chain) throws IOException {\n          // ...\n      }\n  });\n\n  // New (v3.x)\n  client.addInterceptor(new Interceptor() {\n      @NotNull\n      @Override\n      public Response intercept(@NotNull Chain chain) throws IOException {\n          // ...\n      }\n  });\n\n#### 4. Model Name Changes\n\n**Old (v2.x):**\n```java\nimport com.textmagic.sdk.model.ContactList;\nimport com.textmagic.sdk.model.MessageFile;\n\nContactList list = api.getList(123);\nMessageFile file = api.getFile(456);\n```\n\n**New (v3.x):**\n```java\nimport com.textmagic.sdk.model.ModelList;\nimport com.textmagic.sdk.model.ModelFile;\n\nModelList list = api.getList(123);\nModelFile file = api.getFile(456);\n```\n\n**Action Required:**\n- Replace `ContactList` → `ModelList` in all imports and type declarations\n- Replace `MessageFile` → `ModelFile` in all imports and type declarations\n- Use IDE's \"Find and Replace\" feature:\n  ```\n  Find: import com.textmagic.sdk.model.ContactList;\n  Replace: import com.textmagic.sdk.model.ModelList;\n\n  Find: import com.textmagic.sdk.model.MessageFile;\n  Replace: import com.textmagic.sdk.model.ModelFile;\n\n  Find: ContactList\n  Replace: ModelList\n\n  Find: MessageFile\n  Replace: ModelFile\n  ```\n\n**Why this change?**\n- v2.x used custom names (`ContactList`, `MessageFile`) via preprocessing script\n- v3.x uses OpenAPI Generator's standard naming convention with `Model` prefix\n- This aligns with industry best practices and improves consistency\n\n#### 5. Dependencies\n\n**Updated dependencies:**\n- `com.squareup.okhttp3:okhttp` 2.7.5 → 4.12.0\n- `com.google.code.gson:gson` 2.8.x → 2.10.1\n- `org.apache.commons:commons-lang3` 3.x → 3.18.0\n\n**Action Required:**\n- Review your dependency tree for conflicts:\n  ```bash\n  mvn dependency:tree\n  ```\n- Update any conflicting dependencies in your project\n\n### Migration Steps\n\n1. **Update Java version to 11+**\n   ```bash\n   java -version  # Verify Java 11 or higher\n   ```\n\n2. **Update SDK version in pom.xml**\n   ```xml\n   <dependency>\n       <groupId>com.textmagic.sdk</groupId>\n       <artifactId>textmagic-java-sdk</artifactId>\n       <version>3.0.50055</version>\n   </dependency>\n   ```\n\n3. **Update imports**\n   - Replace `java.util.Date` → `java.time.OffsetDateTime`\n   - Replace `java.util.Calendar` → `java.time.ZonedDateTime`\n   - Replace `com.textmagic.sdk.model.ContactList` → `com.textmagic.sdk.model.ModelList`\n   - Replace `com.textmagic.sdk.model.MessageFile` → `com.textmagic.sdk.model.ModelFile`\n\n4. **Update date/time handling**\n   - Review all date parsing and formatting code\n   - Use `java.time` API instead of `SimpleDateFormat`\n\n5. **Update model references**\n   - Search and replace `ContactList` → `ModelList`\n   - Search and replace `MessageFile` → `ModelFile`\n   - Recommended: Use IDE's \"Find in Path\" with scope limited to your code\n\n6. **Test thoroughly**\n   - Run your test suite\n   - Pay special attention to date/time operations\n   - Verify file upload functionality\n\n### Common Issues\n\n#### Issue: `java.lang.UnsupportedClassVersionError`\n\n**Cause:** Your project is compiled with Java < 11\n\n**Solution:**\n```xml\n<properties>\n    <maven.compiler.source>11</maven.compiler.source>\n    <maven.compiler.target>11</maven.compiler.target>\n</properties>\n```\n\n#### Issue: `cannot find symbol: class Date`\n\n**Cause:** Missing import after migration\n\n**Solution:**\n```java\n// Remove\nimport java.util.Date;\n\n// Add\nimport java.time.OffsetDateTime;\n```\n\n#### Issue: OkHttp compatibility errors\n\n**Cause:** Conflicting OkHttp versions in classpath\n\n**Solution:**\n```xml\n<!-- Exclude old OkHttp from other dependencies -->\n<dependency>\n    <groupId>some.other.library</groupId>\n    <artifactId>library</artifactId>\n    <version>1.0.0</version>\n    <exclusions>\n        <exclusion>\n            <groupId>com.squareup.okhttp</groupId>\n            <artifactId>okhttp</artifactId>\n        </exclusion>\n    </exclusions>\n</dependency>\n```\n\n#### Issue: `cannot find symbol: class ContactList` or `cannot find symbol: class MessageFile`\n\n**Cause:** Model names changed from `ContactList`/`MessageFile` to `ModelList`/`ModelFile`\n\n**Solution:**\n```java\n// Old (v2.x)\nimport com.textmagic.sdk.model.ContactList;\nContactList myList = api.getList(123);\n\n// New (v3.x)\nimport com.textmagic.sdk.model.ModelList;\nModelList myList = api.getList(123);\n```\n\n**Quick fix with sed (Unix/Mac):**\n```bash\n# Backup your files first!\nfind . -name \"*.java\" -type f -exec sed -i.bak 's/import com\\.textmagic\\.sdk\\.model\\.ContactList;/import com.textmagic.sdk.model.ModelList;/g' {} \\;\nfind . -name \"*.java\" -type f -exec sed -i.bak 's/import com\\.textmagic\\.sdk\\.model\\.MessageFile;/import com.textmagic.sdk.model.ModelFile;/g' {} \\;\nfind . -name \"*.java\" -type f -exec sed -i.bak 's/\\bContactList\\b/ModelList/g' {} \\;\nfind . -name \"*.java\" -type f -exec sed -i.bak 's/\\bMessageFile\\b/ModelFile/g' {} \\;\n```\n\n### Need Help?\n\nIf you encounter issues during migration:\n- Check our [GitHub Issues](https://github.com/textmagic/textmagic-rest-java-v2/issues)\n- Review the [API Documentation]()\n- Contact support at support@textmagic.com\n\n## Installation\n\n### Maven\n\nAdd this dependency to your project's POM:\n```xml\n<dependencies>\n    <dependency>\n        <groupId>com.textmagic.sdk</groupId>\n        <artifactId>textmagic-java-sdk</artifactId>\n        <version>3.0.50055</version>\n    </dependency>\n</dependencies>\n\n### Gradle\n\nAdd this dependency to your project's build file:\n```groovy\nimplementation \"com.textmagic.sdk:textmagic-java-sdk:3.0.50055\"\n```\n\n## Usage Example\n\n```java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\nimport java.io.File;\n\npublic class App {\n\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Simple ping request example\n        try {\n            PingResponse response = apiInstance.ping();\n            System.out.println(response.getPing());\n        } catch (ApiException e) {\n        System.err.println(\"Exception when calling ping\");\n            e.printStackTrace();\n        }\n\n        // Send a new message request example\n        SendMessageInputObject sendMessageInputObject = new SendMessageInputObject();\n        sendMessageInputObject.setText(\"I love TextMagic!\");\n        sendMessageInputObject.setPhones(\"+19998887766\");\n\n        try {\n            SendMessageResponse response = apiInstance.sendMessage(sendMessageInputObject, true);\n            System.out.println(response.getId());\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling sendMessage\");\n            e.printStackTrace();\n        }\n\n        // Get all outgoing messages request example\n        try {\n            // Put null if you want to use default values\n            GetAllOutboundMessagesResponse response = apiInstance.getAllOutboundMessages(1, 10, null);\n            System.out.println(response.getResources().get(0).getText());\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getAllOutboundMessages\");\n            e.printStackTrace();\n        }\n\n        // Upload new avatar for contacts list (group) with Id 3223 example\n        File file = new File(\"test.jpg\");\n        try {\n            ResourceLinkResponse response = apiInstance.uploadListAvatar(file, 3223);\n            System.out.println(response.getId());\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling uploadListAvatar\");\n            e.printStackTrace();\n        }\n    }\n}\n```\n\n# C# / VB.NET\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-csharp-v2&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your C# / VB.NET application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-csharp-v2)\n\n## Requirements\n\n- **.NET Standard 2.0** or higher\n- **Compatible with:**\n  - .NET Framework 4.6.1+\n  - .NET Core 2.0+\n  - .NET 5.0+\n  - .NET 6.0+\n  - .NET 7.0+\n  - .NET 8.0+\n  - Mono 5.4+\n  - Xamarin.iOS 10.14+\n  - Xamarin.Android 8.0+\n  - UWP 10.0.16299+\n\n## Dependencies\n\n- **[RestSharp](https://www.nuget.org/packages/RestSharp)** >= 112.0.0\n- **[Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/)** >= 13.0.3\n- **[JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/)** >= 2.0.1\n\nAll dependencies are automatically installed via NuGet when you install the package.\n\n## Installation\n\n### Install from NuGet (Recommended)\n\n#### Using Package Manager Console\n```powershell\nInstall-Package TextMagicClient\n```\n\n#### Using .NET CLI\n```bash\ndotnet add package TextMagicClient\n```\n\n#### Using PackageReference\nAdd this to your `.csproj` file:\n```xml\n<PackageReference Include=\"TextMagicClient\" Version=\"3.0.50038\" />\n```\n\n### Install from GitHub\n\n```bash\ngit clone https://github.com/textmagic/textmagic-rest-csharp-v2.git\ncd textmagic-rest-csharp-v2/src/TextMagicClient\ndotnet build\n```\n\n## Quick Start\n\n### Basic Usage\n\n```csharp\nusing System;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // Configure API credentials\n            // Get your credentials from https://app.textmagic.com/settings/api\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n            Configuration.Default.BasePath = \"https://rest.textmagic.com\";\n\n            var api = new TextMagicApi();\n\n            // Test connection\n            try\n            {\n                var result = api.Ping();\n                Console.WriteLine($\"✅ Connected! Server time: {result.Ping}\");\n            }\n            catch (ApiException e)\n            {\n                Console.WriteLine($\"❌ Error: {e.Message}\");\n            }\n        }\n    }\n}\n```\n\n## Usage Examples\n\n### Sending Messages\n\n```csharp\nusing System;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n            Configuration.Default.BasePath = \"https://rest.textmagic.com\";\n\n            var api = new TextMagicApi();\n\n            // Send SMS to a single number\n            try\n            {\n                var sendMessage = new SendMessageInputObject\n                {\n                    Text = \"Hello from TextMagic C# SDK!\",\n                    Phones = \"+1234567890\"\n                };\n\n                var result = api.SendMessage(sendMessage);\n                Console.WriteLine($\"✅ Message sent! ID: {result.Id}\");\n                Console.WriteLine($\"   Session ID: {result.SessionId}\");\n            }\n            catch (ApiException e)\n            {\n                Console.WriteLine($\"❌ Error sending message: {e.Message}\");\n            }\n\n            // Send SMS to multiple numbers\n            try\n            {\n                var sendMessage = new SendMessageInputObject\n                {\n                    Text = \"Bulk message from TextMagic!\",\n                    Phones = \"+1234567890,+0987654321\"\n                };\n\n                var result = api.SendMessage(sendMessage);\n                Console.WriteLine($\"✅ Bulk message sent! Session ID: {result.SessionId}\");\n            }\n            catch (ApiException e)\n            {\n                Console.WriteLine($\"❌ Error: {e.Message}\");\n            }\n        }\n    }\n}\n```\n\n### Retrieving Messages\n\n```csharp\nusing System;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n            Configuration.Default.BasePath = \"https://rest.textmagic.com\";\n\n            var api = new TextMagicApi();\n\n            // Get all outbound messages with pagination\n            try\n            {\n                int page = 1;\n                int limit = 10;\n                var result = api.GetAllOutboundMessages(page, limit);\n\n                Console.WriteLine($\"📨 Total messages: {result.Page.Count}\");\n                foreach (var message in result.Resources)\n                {\n                    Console.WriteLine($\"   ID: {message.Id}, Text: {message.Text}, Status: {message.Status}\");\n                }\n            }\n            catch (ApiException e)\n            {\n                Console.WriteLine($\"❌ Error: {e.Message}\");\n            }\n\n            // Get a specific message by ID\n            try\n            {\n                int messageId = 12345;\n                var message = api.GetMessage(messageId);\n                Console.WriteLine($\"📨 Message {message.Id}: {message.Text}\");\n                Console.WriteLine($\"   Status: {message.Status}\");\n                Console.WriteLine($\"   Sent at: {message.CreateTime}\");\n            }\n            catch (ApiException e)\n            {\n                Console.WriteLine($\"❌ Error: {e.Message}\");\n            }\n        }\n    }\n}\n```\n\n### Uploading Files\n\n```csharp\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n            Configuration.Default.BasePath = \"https://rest.textmagic.com\";\n\n            var api = new TextMagicApi();\n\n            // Upload list avatar\n            try\n            {\n                int listId = 12345;\n                using (var stream = File.OpenRead(\"path/to/avatar.png\"))\n                {\n                    var result = api.UploadListAvatar(stream, listId);\n                    Console.WriteLine($\"✅ Avatar uploaded! URL: {result.Href}\");\n                }\n            }\n            catch (ApiException e)\n            {\n                Console.WriteLine($\"❌ Error: {e.Message}\");\n            }\n        }\n    }\n}\n```\n\n### Error Handling\n\n```csharp\nusing System;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n            Configuration.Default.BasePath = \"https://rest.textmagic.com\";\n\n            var api = new TextMagicApi();\n\n            try\n            {\n                var sendMessage = new SendMessageInputObject\n                {\n                    Text = \"Test message\",\n                    Phones = \"+1234567890\"\n                };\n\n                var result = api.SendMessage(sendMessage);\n                Console.WriteLine($\"✅ Success! Message ID: {result.Id}\");\n            }\n            catch (ApiException e)\n            {\n                Console.WriteLine($\"❌ API Error:\");\n                Console.WriteLine($\"   Status Code: {e.ErrorCode}\");\n                Console.WriteLine($\"   Message: {e.Message}\");\n                Console.WriteLine($\"   Response: {e.ErrorContent}\");\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine($\"❌ Unexpected Error: {e.Message}\");\n            }\n        }\n    }\n}\n```\n\n## API Documentation\n\nFor detailed information about all available methods, parameters, and response models, please refer to:\n\n- **[TextMagic API Documentation](https://docs.textmagic.com)**\n- **[REST API Reference](https://docs.textmagic.com/api-reference)**\n\n### Available API Methods\n\nThe SDK provides access to all TextMagic REST API endpoints, including:\n\n- **Messages**: Send, retrieve, delete messages\n- **Contacts**: Manage contacts and contact lists\n- **Templates**: Create and manage message templates\n- **Bulk Operations**: Send bulk messages, manage campaigns\n- **Account**: Check balance, get account information\n- **Numbers**: Purchase and manage dedicated numbers\n- **Webhooks**: Configure webhooks for incoming messages\n- **And more...**\n\n## VB.NET Usage Example\n\n```vbnet\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n        Configuration.Default.BasePath = \"https://rest.textmagic.com\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Simple Ping request sample\n        Try\n            Dim result = apiInstance.Ping()\n            Console.WriteLine(result.Ping)\n            Catch ex As Exception\n            Console.WriteLine(\"Exception when calling TextMagicApi.Ping: \" + ex.Message )\n        End Try\n\n        ' Send a new message request sample\n        Try\n            Dim sendMessageInputObject = New SendMessageInputObject With {\n            .Text = \"I love TextMagic!\",\n            .Phones = \"+199988887766\"\n            }\n            Dim result = apiInstance.SendMessage(sendMessageInputObject)\n            Console.WriteLine(result.Id)\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling TextMagicApi.SendMessage: \" & e.Message)\n        End Try\n\n        ' Get all outgoing messages sample\n        Try\n            Dim result = apiInstance.GetAllOutboundMessages(1, 10)\n            Console.WriteLine(result.Resources(0).Id)\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling TextMagicApi.GetAllOutboundMessages: \" & e.Message)\n        End Try\n\n        ' Upload list avatar sample, 3223 here is a sample list id\n        Try\n            Dim stream = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open)\n            Dim result = apiInstance.UploadListAvatar(stream, 3223)\n            Console.WriteLine(result.Href)\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling TextMagicApi.UploadListAvatar: \" & e.Message)\n        End Try\n    End Sub\nEnd Module\n\n```\n\n## Migration Guide: v2.x → v3.x\n\n### Overview\n\nVersion 3.0 represents a major update to the TextMagic C# SDK, migrating from Swagger Codegen to OpenAPI Generator 7.17.0. This brings improved code quality, better .NET Standard support, and enhanced compatibility with modern .NET frameworks.\n\n### Why Upgrade?\n\n- ✅ **Modern .NET Support**: Full .NET Standard 2.0 support, compatible with .NET 6.0, 7.0, 8.0+\n- ✅ **Updated Dependencies**: Latest versions of RestSharp, Newtonsoft.Json, and JsonSubTypes\n- ✅ **Better Code Generation**: OpenAPI Generator 7.17.0 produces cleaner, more maintainable code\n- ✅ **Improved Performance**: Optimized HTTP client and serialization\n- ✅ **Enhanced Security**: Updated dependencies with latest security patches\n- ✅ **Future-Proof**: Active maintenance and regular updates\n\n### Breaking Changes\n\n| Change | Impact | v2.x | v3.x | Notes |\n|--------|--------|------|------|-------|\n| **Generator** | Low | Swagger Codegen 2.4.8 | OpenAPI Generator 7.17.0 | Modern code generation |\n| **Target Framework** | Medium | .NET Framework 4.5 | .NET Standard 2.0+ | Requires .NET Framework 4.6.1+ |\n| **RestSharp** | Medium | 105.1.0 | **112.0.0+** | **+7 major versions!** Improved performance |\n| **Newtonsoft.Json** | Low | 10.0.3 | 13.0.3+ | Latest security patches |\n| **JsonSubTypes** | Low | 1.2.0 | 2.0.1+ | Major version update |\n| **Package Installation** | Low | Manual DLL or NuGet | NuGet (recommended) | Simplified installation |\n\n### What Stays the Same ✅\n\n- ✅ **API Interface**: All method signatures remain unchanged\n- ✅ **Authentication**: Same username/password authentication\n- ✅ **Configuration**: Same `Configuration.Default` pattern\n- ✅ **Model Classes**: Same model structure and properties\n- ✅ **Error Handling**: Same `ApiException` handling\n- ✅ **Base URL**: Same `https://rest.textmagic.com` endpoint\n\n### Step-by-Step Migration Guide\n\n#### Step 1: Backup Your Project\n```bash\n# Create a backup of your project\ngit commit -am \"Backup before TextMagic SDK v3 migration\"\n# or copy your project folder\n```\n\n#### Step 2: Check .NET Framework Version\nEnsure your project targets **.NET Framework 4.6.1+**, **.NET Core 2.0+**, or **.NET 5.0+**.\n\n```xml\n<!-- Check your .csproj file -->\n<TargetFramework>netstandard2.0</TargetFramework>\n<!-- or -->\n<TargetFramework>net6.0</TargetFramework>\n```\n\n#### Step 3: Remove Old SDK\n```powershell\n# Using Package Manager Console\nUninstall-Package TextMagicClient\n\n# Or using .NET CLI\ndotnet remove package TextMagicClient\n```\n\n#### Step 4: Install New SDK\n```powershell\n# Using Package Manager Console\nInstall-Package TextMagicClient -Version 3.0.50038\n\n# Or using .NET CLI\ndotnet add package TextMagicClient --version 3.0.50038\n```\n\n#### Step 5: Update Dependencies (if needed)\nThe new SDK will automatically install compatible versions of:\n- RestSharp >= 112.0.0\n- Newtonsoft.Json >= 13.0.3\n- JsonSubTypes >= 2.0.1\n\n#### Step 6: Rebuild Your Project\n```bash\ndotnet build\n```\n\n#### Step 7: Test Your Application\nRun your test suite to ensure everything works as expected.\n\n```bash\ndotnet test\n```\n\n### Code Migration Examples\n\n#### Example 1: Basic Configuration (No Changes Required)\n\n**v2.x:**\n```csharp\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\n\nConfiguration.Default.Username = \"YOUR_USERNAME\";\nConfiguration.Default.Password = \"YOUR_API_KEY\";\nConfiguration.Default.BasePath = \"https://rest.textmagic.com\";\n\nvar api = new TextMagicApi();\n```\n\n**v3.x:**\n```csharp\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\n\nConfiguration.Default.Username = \"YOUR_USERNAME\";\nConfiguration.Default.Password = \"YOUR_API_KEY\";\nConfiguration.Default.BasePath = \"https://rest.textmagic.com\";\n\nvar api = new TextMagicApi();\n```\n✅ **No changes required!**\n\n#### Example 2: Sending Messages (No Changes Required)\n\n**v2.x:**\n```csharp\nusing TextMagicClient.Model;\n\nvar sendMessage = new SendMessageInputObject\n{\n    Text = \"Hello from TextMagic!\",\n    Phones = \"+1234567890\"\n};\n\nvar result = api.SendMessage(sendMessage);\nConsole.WriteLine($\"Message ID: {result.Id}\");\n```\n\n**v3.x:**\n```csharp\nusing TextMagicClient.Model;\n\nvar sendMessage = new SendMessageInputObject\n{\n    Text = \"Hello from TextMagic!\",\n    Phones = \"+1234567890\"\n};\n\nvar result = api.SendMessage(sendMessage);\nConsole.WriteLine($\"Message ID: {result.Id}\");\n```\n✅ **No changes required!**\n\n#### Example 3: Error Handling (No Changes Required)\n\n**v2.x:**\n```csharp\ntry\n{\n    var result = api.Ping();\n    Console.WriteLine(result.Ping);\n}\ncatch (ApiException e)\n{\n    Console.WriteLine($\"Error: {e.Message}\");\n}\n```\n\n**v3.x:**\n```csharp\ntry\n{\n    var result = api.Ping();\n    Console.WriteLine(result.Ping);\n}\ncatch (ApiException e)\n{\n    Console.WriteLine($\"Error: {e.Message}\");\n}\n```\n✅ **No changes required!**\n\n### Common Migration Issues & Solutions\n\n#### Issue 1: \"Could not load file or assembly 'RestSharp'\"\n\n**Cause**: Version mismatch between old and new RestSharp.\n\n**Solution**:\n```powershell\n# Clean and rebuild\ndotnet clean\ndotnet restore\ndotnet build\n```\n\n#### Issue 2: \"The type or namespace name 'TextMagicClient' could not be found\"\n\n**Cause**: Old package not properly uninstalled.\n\n**Solution**:\n```powershell\n# Remove all TextMagic packages\nUninstall-Package TextMagicClient -Force\n\n# Clear NuGet cache\ndotnet nuget locals all --clear\n\n# Reinstall\nInstall-Package TextMagicClient\n```\n\n#### Issue 3: \".NET Framework version not supported\"\n\n**Cause**: Project targets .NET Framework < 4.6.1.\n\n**Solution**:\nUpdate your `.csproj` file:\n```xml\n<TargetFramework>net461</TargetFramework>\n<!-- or -->\n<TargetFramework>netstandard2.0</TargetFramework>\n```\n\n#### Issue 4: \"Newtonsoft.Json version conflict\"\n\n**Cause**: Another package requires a different Newtonsoft.Json version.\n\n**Solution**:\nAdd binding redirect to `app.config` or `web.config`:\n```xml\n<runtime>\n  <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n    <dependentAssembly>\n      <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n      <bindingRedirect oldVersion=\"0.0.0.0-13.0.0.0\" newVersion=\"13.0.0.0\" />\n    </dependentAssembly>\n  </assemblyBinding>\n</runtime>\n```\n\n#### Issue 5: \"RestSharp version conflict with other packages\"\n\n**Cause**: Another package in your project requires an older RestSharp version (< 112.0.0).\n\n**Solution**:\n```xml\n<!-- Option 1: Add binding redirect to app.config or web.config -->\n<runtime>\n  <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n    <dependentAssembly>\n      <assemblyIdentity name=\"RestSharp\" publicKeyToken=\"598062e77f915f75\" culture=\"neutral\" />\n      <bindingRedirect oldVersion=\"0.0.0.0-112.0.0.0\" newVersion=\"112.0.0.0\" />\n    </dependentAssembly>\n  </assemblyBinding>\n</runtime>\n```\n\n```xml\n<!-- Option 2: Update other packages to support RestSharp 112+ -->\n<!-- Check if newer versions of conflicting packages are available -->\n```\n\n**Note**: RestSharp 112.0.0 includes significant improvements and breaking changes from 105.x. If you have custom RestSharp code, review the [RestSharp migration guide](https://restsharp.dev/v107/#migrating-from-restsharp-106x).\n\n#### Issue 6: \"SSL/TLS connection errors\"\n\n**Cause**: Older .NET Framework versions may not support modern TLS.\n\n**Solution**:\n```csharp\n// Add this before making API calls\nSystem.Net.ServicePointManager.SecurityProtocol = \n    System.Net.SecurityProtocolType.Tls12 | \n    System.Net.SecurityProtocolType.Tls13;\n```\n\n### Benefits of Upgrading to v3.x\n\n#### Technical Improvements\n- **Modern .NET Support**: Compatible with .NET 6.0, 7.0, 8.0, and future versions\n- **Better Performance**: \n  - RestSharp 112.0.0 brings significant performance improvements\n  - Optimized HTTP client with better connection pooling\n  - Faster JSON serialization and deserialization\n- **Improved Code Quality**: Cleaner generated code with better documentation\n- **Enhanced Type Safety**: Stronger typing and better IntelliSense support\n- **Updated Dependencies**: \n  - RestSharp 105.1.0 → **112.0.0** (+7 major versions with bug fixes and improvements)\n  - Newtonsoft.Json 10.0.3 → 13.0.3 (latest security patches)\n  - JsonSubTypes 1.2.0 → 2.0.1 (major version update)\n- **Cross-Platform**: Works on Windows, Linux, and macOS\n\n#### Ecosystem Alignment\n- **Consistent with Other SDKs**: All TextMagic SDKs now use OpenAPI Generator\n- **Better Tooling**: Improved IDE support and debugging experience\n- **Active Maintenance**: Regular updates and community support\n- **Future-Proof**: Built on actively maintained tools and frameworks\n\n#### Security & Maintenance\n- **Security Updates**: Latest dependency versions with security patches\n- **Bug Fixes**: Resolved issues from Swagger Codegen\n- **Long-Term Support**: OpenAPI Generator is actively maintained\n- **Compliance**: Better support for modern security standards\n\n### Migration Effort vs. Benefits\n\n| Aspect | Effort | Benefit |\n|--------|--------|---------|\n| **Code Changes** | ⭐ Minimal (mostly none) | ⭐⭐⭐⭐⭐ No breaking API changes |\n| **Dependency Updates** | ⭐⭐ Low (automatic) | ⭐⭐⭐⭐⭐ Latest security patches |\n| **Testing** | ⭐⭐⭐ Medium | ⭐⭐⭐⭐⭐ Ensures compatibility |\n| **Overall Migration** | ⭐⭐ Low | ⭐⭐⭐⭐⭐ Future-proof, secure, performant |\n\n### Need Help?\n\n- **Documentation**: [https://docs.textmagic.com](https://docs.textmagic.com)\n- **Support**: [https://www.textmagic.com/support](https://www.textmagic.com/support)\n- **GitHub Issues**: [https://github.com/textmagic/textmagic-rest-csharp-v2/issues](https://github.com/textmagic/textmagic-rest-csharp-v2/issues)\n\n\n# C++\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-cpp-v2&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your C++ application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-cpp-v2)\n## Requirements\n\n* CMake 3.15 or later (https://cmake.org/)\n* Modern C++ compiler with C++17 support\n* cpprestsdk (https://github.com/microsoft/cpprestsdk)\n\n**Platform-specific installation:**\n\n```bash\n# Ubuntu/Debian\napt-get install build-essential cmake libcpprest-dev libboost-all-dev\n\n# macOS\nbrew install cmake cpprestsdk boost\n\n# Windows (vcpkg)\nvcpkg install cpprestsdk cpprestsdk:x64-windows boost\n```\n\n## Quick Start\n\n```cpp\n#include \"TextMagic/ApiClient.h\"\n#include \"TextMagic/ApiConfiguration.h\"\n#include \"TextMagic/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    // Configure API client\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // Set credentials from https://app.textmagic.com/settings/api\n    apiConfig->setBaseUrl(\"https://rest.textmagic.com\");\n    apiConfig->getHttpConfig().set_credentials(\n        web::credentials(\"YOUR_USERNAME\", \"YOUR_API_KEY\")\n    );\n    apiClient->setConfiguration(apiConfig);\n\n    // Create API instance\n    TextMagicApi api(apiClient);\n\n    // Test connection\n    pplx::task<std::shared_ptr<PingResponse>> pingResponse = api.ping();\n    pingResponse.wait();\n\n    try {\n        std::cout << \"✅ Connected! Server time: \"\n                  << pingResponse.get()->getPing() << std::endl;\n    } catch(const std::exception& e) {\n        std::cout << \"❌ Error: \" << e.what() << std::endl;\n    }\n\n    return 0;\n}\n```\n\n## Installation\n\nDownload and extract the library archive:\n```shell\nwget https://github.com/textmagic/textmagic-rest-cpp-v2/archive/v3.0.50038.tar.gz && \\\ntar zxf v3.0.50038.tar.gz && \\\nrm -f v3.0.50038.tar.gz && \\\ncd textmagic-rest-cpp-v2-3.0.50038\n```\nBuild using CMake:\n```shell\ncmake . && cmake --build .\n```\nThe output library file will be placed in the `textmagic-rest-cpp-v2-3.0.50038/lib` directory.\n\n## Usage Example\nIn the example below, we assume that you moved the library sources `textmagic-rest-cpp-v2-3.0.50038` directory to your test project root directory.\n\nConfigure your `CMakeLists.txt` as shown here:\n```cmake\ncmake_minimum_required(VERSION 3.15)\nproject(test)\n\n# Set C++17 standard\nset(CMAKE_CXX_STANDARD 17)\nset(CMAKE_CXX_STANDARD_REQUIRED ON)\n\n# Find dependencies\nfind_package(cpprestsdk REQUIRED)\nfind_package(Boost REQUIRED)\n\n# Create executable\nadd_executable(app main.cpp)\n\n# Import TextMagic library\nadd_library(TextMagic SHARED IMPORTED)\nset_property(TARGET TextMagic\n    PROPERTY IMPORTED_LOCATION\n    \"${PROJECT_SOURCE_DIR}/textmagic-rest-cpp-v2-3.0.50038/lib/libTextMagic.so\"\n)\n\n# Set include directories\ntarget_include_directories(app PRIVATE\n    ${PROJECT_SOURCE_DIR}/textmagic-rest-cpp-v2-3.0.50038/include\n)\n\n# Link libraries\ntarget_link_libraries(app\n    Boost::headers\n    cpprestsdk::cpprest\n    TextMagic\n)\n```\n\n`main.cpp` file example:\n```cpp\n#include <iostream>\n#include <fstream>\n#include \"textmagic-rest-cpp-v2-3.0.50038/include/TextMagic/ApiClient.h\"\n#include \"textmagic-rest-cpp-v2-3.0.50038/include/TextMagic/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp-v2-3.0.50038/include/TextMagic/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // Put your Username and API Key from https://app.textmagic.com/settings/api page.\n    apiConfig->setBaseUrl(\"https://rest.textmagic.com\");\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Simple ping request example\n    pplx::task<std::shared_ptr<PingResponse>> pingResponse = api.ping();\n    pingResponse.wait();\n\n    try {\n        std::cout << pingResponse.get()->getPing() << '\\n';\n    } catch(const std::exception& e) {\n        std::cout << \"getPing() exception: \" << e.what() << '\\n';\n    }\n\n    // Send a new message request example\n    std::shared_ptr<SendMessageInputObject> sendMessageInputObject(new SendMessageInputObject);\n    sendMessageInputObject->setPhones(\"+19998887766\");\n    sendMessageInputObject->setText(\"I love TextMagic!\");\n\n    pplx::task<std::shared_ptr<SendMessageResponse>> sendMessageResponse = api.sendMessage(sendMessageInputObject);\n    sendMessageResponse.wait();\n\n    try {\n        std::cout << sendMessageResponse.get()->getId() << '\\n';\n    } catch(const std::exception& e) {\n        std::cout << \"getId() exception: \" << e.what() << '\\n';\n    }\n\n    // Get all outgoing messages request example\n    pplx::task<std::shared_ptr<GetAllOutboundMessagesPaginatedResponse>> getAllOutboundMessagesResponse = api.getAllOutboundMessages(boost::none, boost::none, boost::none);\n    getAllOutboundMessagesResponse.wait();\n\n    try {\n        std::cout << getAllOutboundMessagesResponse.get()->getResources()[0]->getId() << '\\n';\n    } catch(const std::exception& e) {\n        std::cout << \"getId() exception: \" << e.what() << '\\n';\n    }\n\n    // Upload list avatar request example\n    std::filebuf fb;\n    fb.open (\"test.jpg\", std::ios::in);\n    std::shared_ptr<std::istream> is(new std::istream(&fb));\n\n    std::shared_ptr<HttpContent> image(new HttpContent);\n    image->setName(\"test\");\n    image->setContentDisposition(\"attachment\");\n    image->setFileName(\"test.jpg\");\n\n    image->setContentType(\"image/jpeg\");\n    image->setData(is);\n\n    // List ID in current example is 3223\n    pplx::task<std::shared_ptr<ResourceLinkResponse>> resourceLinkResponse = api.uploadListAvatar(image, 3223);\n    resourceLinkResponse.wait();\n\n    try {\n        std::cout << resourceLinkResponse.get()->getId() << '\\n';\n    } catch(const std::exception& e) {\n        std::cout << \"getId() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}\n```\nBuild your test project:\n```shell\ncmake . && cmake --build .\n```\nRun:\n```shell\n./app\n```\n\n## API Documentation\n\nFor detailed API documentation, including all available methods and parameters, please visit:\n\n- **REST API Documentation:** [https://docs.textmagic.com/](https://docs.textmagic.com/)\n- **API Key Management:** [https://app.textmagic.com/settings/api](https://app.textmagic.com/settings/api)\n\n### Available Methods\n\nThe SDK provides access to all TextMagic API endpoints, including:\n\n- **Messages:** Send, receive, and manage SMS messages\n- **Contacts:** Manage your contact lists\n- **Templates:** Create and use message templates\n- **Chats:** Manage conversations\n- **Bulk Messaging:** Send messages to multiple recipients\n- **Sender IDs:** Manage sender names\n- **Account:** Check balance and account information\n- **Statistics:** Get messaging statistics and reports\n\n## Migration Guide\n\n### Migrating from v2.x to v3.x\n\nVersion 3.0 is a **major update** that migrates from Swagger Codegen to OpenAPI Generator with modern C++17 features. This version is **not backward compatible** with v2.x.\n\n#### Breaking Changes\n\n##### 1. **Build System Requirements**\n\n| Component | v2.x | v3.x |\n|-----------|------|------|\n| **CMake** | 2.8+ | **3.15+** ⚠️ |\n| **C++ Standard** | C++11 | **C++17** ⚠️ |\n| **Compiler** | Any C++11 | Modern C++17 compiler required |\n\n##### 2. **Include Paths Changed**\n\n```cpp\n// v2.x - Files in root directory\n#include \"ApiClient.h\"\n#include \"ApiConfiguration.h\"\n#include \"api/TextMagicApi.h\"\n#include \"model/SendMessageInputObject.h\"\n\n// v3.x - Organized in namespace folders\n#include \"TextMagic/ApiClient.h\"\n#include \"TextMagic/ApiConfiguration.h\"\n#include \"TextMagic/api/TextMagicApi.h\"\n#include \"TextMagic/model/SendMessageInputObject.h\"\n```\n\n##### 3. **Library Structure**\n\n```bash\n# v2.x - Flat structure\ntextmagic-rest-cpp-v2/\n├── ApiClient.h\n├── ApiConfiguration.h\n├── api/\n└── model/\n\n# v3.x - Modern structure\ntextmagic-rest-cpp-v2/\n├── include/\n│   └── TextMagic/\n│       ├── ApiClient.h\n│       ├── ApiConfiguration.h\n│       ├── api/\n│       └── model/\n└── src/\n```\n\n##### 4. **CMakeLists.txt Changes**\n\n```cmake\n# v2.x\ncmake_minimum_required(VERSION 2.8)\nset(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++11\")\ntarget_link_libraries(app boost_system cpprest crypto textmagic_client)\n\n# v3.x\ncmake_minimum_required(VERSION 3.15)\nset(CMAKE_CXX_STANDARD 17)\nset(CMAKE_CXX_STANDARD_REQUIRED ON)\nfind_package(cpprestsdk REQUIRED)\nfind_package(Boost REQUIRED)\ntarget_link_libraries(app Boost::headers cpprestsdk::cpprest textmagic_client)\n```\n\n##### 5. **Installation Method**\n\n```bash\n# v2.x - Manual library path\ntarget_include_directories(app PRIVATE\n    ${PROJECT_SOURCE_DIR}/textmagic-rest-cpp-v2\n    ${PROJECT_SOURCE_DIR}/textmagic-rest-cpp-v2/model\n    ${PROJECT_SOURCE_DIR}/textmagic-rest-cpp-v2/api\n)\n\n# v3.x - CMake package config\nfind_package(TextMagic REQUIRED)\ntarget_link_libraries(app TextMagic::TextMagic)\n```\n\n#### What Stays the Same\n\n- ✅ **Namespace:** `com::textmagic::client::api` (unchanged)\n- ✅ **API class name:** `TextMagicApi` (unchanged)\n- ✅ **Configuration:** `ApiClient` and `ApiConfiguration` (unchanged)\n- ✅ **Authentication:** HTTP Basic Auth with username/API key\n- ✅ **API method names** and signatures\n- ✅ **Response objects** structure\n- ✅ **Error handling** with exceptions\n\n#### Upgrade Steps\n\n##### Step 1: Update Build Environment\n\n```bash\n# Check CMake version\ncmake --version  # Must be 3.15+\n\n# Check C++ compiler version\ng++ --version    # GCC 7+ for C++17\nclang++ --version  # Clang 5+ for C++17\n\n# Update if needed (Ubuntu example)\nsudo apt-get update\nsudo apt-get install cmake g++-9\n```\n\n##### Step 2: Update Dependencies\n\n```bash\n# Ubuntu/Debian\nsudo apt-get install build-essential cmake libcpprest-dev libboost-all-dev\n\n# macOS\nbrew install cmake cpprestsdk boost\n\n# Windows (vcpkg)\nvcpkg install cpprestsdk cpprestsdk:x64-windows boost\n```\n\n##### Step 3: Update Your CMakeLists.txt\n\n```cmake\ncmake_minimum_required(VERSION 3.15)\nproject(your_project)\n\n# Set C++17 standard\nset(CMAKE_CXX_STANDARD 17)\nset(CMAKE_CXX_STANDARD_REQUIRED ON)\n\n# Find dependencies\nfind_package(cpprestsdk REQUIRED)\nfind_package(Boost REQUIRED)\n\n# Your executable\nadd_executable(your_app main.cpp)\n\n# Link TextMagic SDK (if installed)\nfind_package(TextMagic REQUIRED)\ntarget_link_libraries(your_app TextMagic::TextMagic)\n\n# OR link manually\nadd_library(textmagic_client SHARED IMPORTED)\nset_property(TARGET textmagic_client\n    PROPERTY IMPORTED_LOCATION\n    \"${PROJECT_SOURCE_DIR}/textmagic-rest-cpp-v2-3.0.0/lib/libTextMagic.so\"\n)\ntarget_include_directories(your_app PRIVATE\n    ${PROJECT_SOURCE_DIR}/textmagic-rest-cpp-v2-3.0.0/include\n)\ntarget_link_libraries(your_app\n    Boost::headers\n    cpprestsdk::cpprest\n    textmagic_client\n)\n```\n\n##### Step 4: Update Include Statements\n\n```cpp\n// Update all includes to use new paths\n#include \"TextMagic/ApiClient.h\"\n#include \"TextMagic/ApiConfiguration.h\"\n#include \"TextMagic/api/TextMagicApi.h\"\n#include \"TextMagic/model/SendMessageInputObject.h\"\n#include \"TextMagic/model/PingResponse.h\"\n// etc.\n```\n\n##### Step 5: Rebuild Your Project\n\n```bash\n# Clean old build\nrm -rf build/\nmkdir build && cd build\n\n# Configure with CMake 3.15+\ncmake ..\n\n# Build\ncmake --build .\n\n# Run\n./your_app\n```\n\n#### Code Migration Example\n\n**Before (v2.x):**\n```cpp\n#include \"ApiClient.h\"\n#include \"ApiConfiguration.h\"\n#include \"api/TextMagicApi.h\"\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    apiConfig->setBaseUrl(\"https://rest.textmagic.com\");\n    apiConfig->getHttpConfig().set_credentials(\n        web::credentials(\"username\", \"api_key\")\n    );\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n    auto response = api.ping();\n    response.wait();\n\n    std::cout << response.get()->getPing() << std::endl;\n    return 0;\n}\n```\n\n**After (v3.x):**\n```cpp\n#include \"TextMagic/ApiClient.h\"\n#include \"TextMagic/ApiConfiguration.h\"\n#include \"TextMagic/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    apiConfig->setBaseUrl(\"https://rest.textmagic.com\");\n    apiConfig->getHttpConfig().set_credentials(\n        web::credentials(\"username\", \"api_key\")\n    );\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n    auto response = api.ping();\n    response.wait();\n\n    std::cout << response.get()->getPing() << std::endl;\n    return 0;\n}\n```\n\n**Key difference:** Only the include paths changed! The actual API usage remains identical.\n\n#### Troubleshooting\n\n**Problem:** `fatal error: ApiClient.h: No such file or directory`\n\n**Solution:** Update include paths to use `TextMagic/` prefix:\n```cpp\n#include \"TextMagic/ApiClient.h\"\n```\n\n**Problem:** `CMake Error: CMake 2.8 or higher is required`\n\n**Solution:** Update CMake to 3.15+:\n```bash\n# Ubuntu\nsudo apt-get install cmake\n\n# Or download from https://cmake.org/download/\n```\n\n**Problem:** `error: 'std::optional' has not been declared`\n\n**Solution:** Ensure C++17 is enabled:\n```cmake\nset(CMAKE_CXX_STANDARD 17)\nset(CMAKE_CXX_STANDARD_REQUIRED ON)\n```\n\n**Problem:** Linker errors with `cpprestsdk`\n\n**Solution:** Use proper CMake targets:\n```cmake\nfind_package(cpprestsdk REQUIRED)\ntarget_link_libraries(your_app cpprestsdk::cpprest)\n```\n\n#### Benefits of v3.x\n\n- ✅ **Modern C++17** - Better performance, cleaner code\n- ✅ **Improved type safety** - Using `std::optional`, `std::variant`\n- ✅ **Better CMake integration** - Package config support\n- ✅ **Organized structure** - Clear include hierarchy\n- ✅ **Active maintenance** - Based on OpenAPI Generator (actively maintained)\n- ✅ **Future-proof** - Ready for OpenAPI 3.1+ features\n\n#### Need Help?\n\nIf you encounter issues during migration:\n\n1. Check the [GitHub Issues](https://github.com/textmagic/textmagic-rest-cpp-v2/issues)\n2. Review the [API Documentation](https://docs.textmagic.com/)\n3. Contact [TextMagic Support](https://www.textmagic.com/support/)\n\n\n# Python\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-python-v2&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your Python application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-python-v2)\n## Requirements\n\n- **Python** >= 3.9\n- **urllib3** >= 2.1.0, < 3.0.0,\n- **python-dateutil** >= 2.8.2,\n- **pydantic** >= 2,\n- **typing-extensions** >= 4.7.1,\n\n## Installation\n\n### Install from PyPI (Recommended)\n\n```bash\npip install TextMagic\n```\n\n### Install from GitHub\n\n```bash\npip install git+https://github.com/textmagic/textmagic-rest-python-v2.git@v3.0.50053\n```\n\n### Install from source\n\n```bash\ngit clone https://github.com/textmagic/textmagic-rest-python-v2.git\ncd textmagic-rest-python-v2\npython setup.py install\n```\n\n## Quick Start\n\n### Basic Usage\n\n```python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\n# Configure API credentials\n# Get your credentials from https://app.textmagic.com/settings/api\nconfiguration = TextMagic.Configuration(\n    username='YOUR_USERNAME',\n    password='YOUR_API_KEY'\n)\n\n# Create API client\nwith TextMagic.ApiClient(configuration) as api_client:\n    # Create API instance\n    api = TextMagic.TextMagicApi(api_client)\n\n    # Test connection\n    try:\n        response = api.ping()\n        print(f\"✅ Connected! Server time: {response.ping}\")\n    except ApiException as e:\n        print(f\"❌ Error: {e}\")\n```\n\n### Sending Messages\n\n```python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration(\n    username='YOUR_USERNAME',\n    password='YOUR_API_KEY'\n)\n\nwith TextMagic.ApiClient(configuration) as api_client:\n    api = TextMagic.TextMagicApi(api_client)\n\n    # Send SMS to a single number\n    try:\n        send_message = TextMagic.SendMessageInputObject(\n            text=\"Hello from TextMagic Python SDK!\",\n            phones=\"+1234567890\"\n        )\n        response = api.send_message(send_message)\n        print(f\"✅ Message sent! ID: {response.id}\")\n        print(f\"   Session ID: {response.session_id}\")\n    except ApiException as e:\n        print(f\"❌ Error sending message: {e}\")\n\n    # Send SMS to multiple numbers\n    try:\n        send_message = TextMagic.SendMessageInputObject(\n            text=\"Bulk message\",\n            phones=\"+1234567890,+0987654321\"  # Comma-separated\n        )\n        response = api.send_message(send_message)\n        print(f\"✅ Bulk message sent! Session ID: {response.session_id}\")\n    except ApiException as e:\n        print(f\"❌ Error: {e}\")\n```\n\n### Getting Outgoing Messages\n\n```python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration(\n    username='YOUR_USERNAME',\n    password='YOUR_API_KEY'\n)\n\nwith TextMagic.ApiClient(configuration) as api_client:\n    api = TextMagic.TextMagicApi(api_client)\n\n    try:\n        # Get recent outgoing messages\n        response = api.get_all_outbound_messages(page=1, limit=10)\n\n        print(f\"Total messages: {response.page.total}\")\n        for message in response.resources:\n            print(f\"- [{message.id}] {message.text[:50]}... → {message.receiver}\")\n            print(f\"  Status: {message.status}, Sent: {message.created_at}\")\n    except ApiException as e:\n        print(f\"❌ Error: {e}\")\n```\n\n### Uploading Files\n\n```python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration(\n    username='YOUR_USERNAME',\n    password='YOUR_API_KEY'\n)\n\nwith TextMagic.ApiClient(configuration) as api_client:\n    api = TextMagic.TextMagicApi(api_client)\n\n    # Upload list avatar\n    try:\n        response = api.upload_list_avatar(\n            file='path/to/avatar.png',\n            id=12345  # List ID\n        )\n        print(f\"✅ Avatar uploaded! Resource ID: {response.id}\")\n    except ApiException as e:\n        print(f\"❌ Error: {e}\")\n```\n\n### Error Handling\n\n```python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration(\n    username='YOUR_USERNAME',\n    password='YOUR_API_KEY'\n)\n\nwith TextMagic.ApiClient(configuration) as api_client:\n    api = TextMagic.TextMagicApi(api_client)\n\n    try:\n        response = api.send_message(\n            TextMagic.SendMessageInputObject(\n                text=\"Test message\",\n                phones=\"+1234567890\"\n            )\n        )\n        print(f\"✅ Success: {response.id}\")\n    except ApiException as e:\n        print(f\"❌ API Exception:\")\n        print(f\"   Status: {e.status}\")\n        print(f\"   Reason: {e.reason}\")\n        print(f\"   Body: {e.body}\")\n    except Exception as e:\n        print(f\"❌ Unexpected error: {e}\")\n```\n\n## API Documentation\n\nFor detailed API documentation, including all available methods and parameters, please visit:\n\n- **REST API Documentation:** https://docs.textmagic.com/\n\n### Available Methods\n\nThe SDK provides access to all TextMagic API endpoints, including:\n\n- **Messages:** Send, receive, and manage SMS messages\n- **Contacts:** Manage your contact lists\n- **Templates:** Create and use message templates\n- **Chats:** Manage conversations\n- **Bulk Messaging:** Send messages to multiple recipients\n- **Sender IDs:** Manage sender names\n- **Account:** Check balance and account information\n- **Statistics:** Get messaging statistics and reports\n\n## Migration Guide\n\n### Migrating from v2.x to v3.x\n\n#### Breaking Changes\n\n1. **Python Version Requirements:**\n   - v2.x: Python 2.7+ and 3.4+\n   - v3.x: Python 3.9+ only\n\n2. **Configuration (More Pythonic):**\n   ```python\n   # v2.x\n   configuration = TextMagic.Configuration()\n   configuration.username = 'username'\n   configuration.password = 'api_key'\n\n   # v3.x (constructor with parameters)\n   configuration = TextMagic.Configuration(\n       username='username',\n       password='api_key'\n   )\n   ```\n\n3. **Context Manager Support (New in v3.x):**\n   ```python\n   # v2.x (manual resource management)\n   api_client = TextMagic.ApiClient(configuration)\n   api = TextMagic.TextMagicApi(api_client)\n   response = api.ping()\n\n   # v3.x (context managers - recommended)\n   with TextMagic.ApiClient(configuration) as api_client:\n       api = TextMagic.TextMagicApi(api_client)\n       response = api.ping()\n   ```\n\n#### What Stays the Same\n\n- ✅ Package name: `TextMagic` (unchanged)\n- ✅ Import statements: `import TextMagic` (unchanged)\n- ✅ API method names and signatures\n- ✅ Response objects structure\n- ✅ Authentication mechanism\n- ✅ Error handling with `ApiException`\n\n## Development\n\n### Running Tests\n\n```bash\n# Install development dependencies\npip install -r requirements-dev.txt\n\n# Run tests\npytest tests/\n\n# Run tests with coverage\npytest --cov=TextMagic tests/\n```\n\n### Building from Source\n\n```bash\ngit clone https://github.com/textmagic/textmagic-rest-python-v2.git\ncd textmagic-rest-python-v2\npython setup.py sdist bdist_wheel\n```\n\n## Need Help?\n\n- **Documentation:** https://docs.textmagic.com/\n- **Support:** https://www.textmagic.com/support/\n- **GitHub Issues:** https://github.com/textmagic/textmagic-rest-python-v2/issues\n\n\n# Perl\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-perl-v2&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your Perl application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-perl-v2)\n## Requirements\n\n- **Perl** >= 5.38 (recommended), minimum 5.10\n  - ⚠️ **Note:** Perl versions below 5.38 are no longer officially supported by the Perl community\n  - For production use, we strongly recommend **Perl 5.38+** for security updates and bug fixes\n  - Minimum version 5.10 is supported for legacy compatibility only\n- **CPAN modules:**\n  - URI::Query\n  - Log::Any\n  - JSON\n  - LWP::UserAgent\n  - Module::Runtime\n  - DateTime\n  - LWP::Protocol::https\n\n## Quick Start\n\n```perl\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# Configure API client\n# Get your credentials from https://app.textmagic.com/settings/api\nmy $client = Net::Sms::TextMagicClient::ApiClient->new(\n    username  => 'YOUR_USERNAME',\n    password  => 'YOUR_API_KEY',\n    base_url  => 'https://rest.textmagic.com'\n);\n\nmy $api = Net::Sms::TextMagicClient::TextMagicApi->new($client);\n\n# Test connection\neval {\n    my $result = $api->ping();\n    print \"✅ Connected! Server time: \" . $result->ping . \"\\n\";\n};\nif ($@) {\n    warn \"❌ Error: $@\\n\";\n}\n```\n\n## Installation\n\n### From GitHub\n\n```bash\n# Download and extract\nwget https://github.com/textmagic/textmagic-rest-perl-v2/archive/v3.0.50030.tar.gz\ntar zxf v3.0.50030.tar.gz\nrm -f v3.0.50030.tar.gz\ncd textmagic-rest-perl-v2-3.0.50030\n\n# Install dependencies\ncpanm --installdeps .\n\n# Add to Perl library path\nexport PERL5LIB=\"${PERL5LIB}:$(pwd)/lib\"\n```\n\n### Using cpanfile\n\nIf you want to include this SDK in your project's dependencies:\n\n```perl\n# Add to your cpanfile\nrequires 'Net::Sms::TextMagicClient', '== 3.0.50030';\n```\n\nThen install:\n\n```bash\ncpanm --installdeps .\n```\n\n## Usage Examples\n\nPlease follow the [installation](#installation) instructions and execute the following Perl code:\n\n### Sending Messages\n\n```perl\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::SendMessageInputObject;\n\n# Configure API client\nmy $client = Net::Sms::TextMagicClient::ApiClient->new(\n    username  => 'YOUR_USERNAME',\n    password  => 'YOUR_API_KEY',\n    base_url  => 'https://rest.textmagic.com'\n);\n\nmy $api = Net::Sms::TextMagicClient::TextMagicApi->new($client);\n\n# Send SMS to a single number\nmy $message = Net::Sms::TextMagicClient::Object::SendMessageInputObject->new(\n    text   => 'Hello from TextMagic Perl SDK!',\n    phones => '+1234567890'\n);\n\neval {\n    my $result = $api->send_message(send_message_input_object => $message);\n    print \"✅ Message sent! ID: \" . $result->id . \"\\n\";\n    print \"   Session ID: \" . $result->session_id . \"\\n\";\n};\nif ($@) {\n    warn \"❌ Error sending message: $@\\n\";\n}\n```\n\n### Retrieving Messages\n\n```perl\n# Get all outbound messages\neval {\n    my $result = $api->get_all_outbound_messages();\n    foreach my $msg (@{$result->resources}) {\n        print \"Message ID: \" . $msg->id . \"\\n\";\n        print \"Text: \" . $msg->text . \"\\n\";\n        print \"Status: \" . $msg->status . \"\\n\";\n    }\n};\nif ($@) {\n    warn \"❌ Error: $@\\n\";\n}\n```\n\n### Uploading Files\n\n```perl\n# Upload list avatar (example list ID: 3223)\neval {\n    my $result = $api->upload_list_avatar(\n        image => \"avatar.jpg\",\n        id    => 3223\n    );\n    print \"✅ Avatar uploaded! Resource ID: \" . $result->id . \"\\n\";\n};\nif ($@) {\n    warn \"❌ Error uploading avatar: $@\\n\";\n}\n```\n\n### Error Handling\n\n```perl\nuse Try::Tiny;\n\ntry {\n    my $result = $api->ping();\n    print \"Server time: \" . $result->ping . \"\\n\";\n} catch {\n    if (ref($_) eq 'Net::Sms::TextMagicClient::ApiException') {\n        print \"API Exception:\\n\";\n        print \"  Code: \" . $_->code . \"\\n\";\n        print \"  Message: \" . $_->message . \"\\n\";\n    } else {\n        print \"Unexpected error: $_\\n\";\n    }\n};\n```\n\n## API Documentation\n\nFor detailed API documentation, including all available methods and parameters, please visit:\n\n- **REST API Documentation:** [https://docs.textmagic.com/](https://docs.textmagic.com/)\n- **API Key Management:** [https://app.textmagic.com/settings/api](https://app.textmagic.com/settings/api)\n\n### Available Methods\n\nThe SDK provides access to all TextMagic API endpoints, including:\n\n- **Messages:** Send, receive, and manage SMS messages\n- **Contacts:** Manage your contact lists\n- **Templates:** Create and use message templates\n- **Chats:** Manage conversations\n- **Bulk Messaging:** Send messages to multiple recipients\n- **Sender IDs:** Manage sender names\n- **Account:** Check balance and account information\n- **Statistics:** Get messaging statistics and reports\n\n## Migration Guide\n\n### Migrating from v2.x to v3.x\n\n**Version 3.0 is a MAJOR update** that introduces breaking changes. This guide will help you migrate your code from v2.x to v3.x.\n\n> ⚠️ **IMPORTANT:** v3.x is **NOT backward compatible** with v2.x. You will need to update your code.\n\n#### Why Upgrade?\n\n- ✅ **Modern tooling** - OpenAPI Generator 7.17.0 (actively maintained)\n- ✅ **Better code quality** - Improved type handling and error messages\n- ✅ **Bug fixes** - Many Swagger Codegen issues resolved\n- ✅ **Consistency** - Aligned with other TextMagic SDKs (Python, Ruby, Go, etc.)\n- ✅ **Future-proof** - Ready for OpenAPI 3.1+ features\n- ✅ **Security** - Support for modern Perl versions (5.38+)\n\n#### Breaking Changes Overview\n\n| Component | v2.x | v3.x | Impact |\n|-----------|------|------|--------|\n| **Generator** | Swagger Codegen 2.4.8 | **OpenAPI Generator 7.17.0** | ⚠️ High |\n| **Installation** | `perl Makefile.PL && make install` | **`cpanm --installdeps .`** | ⚠️ Medium |\n| **Method Signatures** | Positional parameters | **Named parameters** | ⚠️ High |\n| **Perl Version** | 5.10+ | **5.10+ (min), 5.38+ (recommended)** | ℹ️ Low |\n| **Module Name** | Net::Sms::TextMagicClient | **Net::Sms::TextMagicClient** | ✅ None |\n| **API Endpoints** | Same | **Same** | ✅ None |\n| **Authentication** | HTTP Basic Auth | **HTTP Basic Auth** | ✅ None |\n\n**⚠️ Perl Version Notice:** While SDK supports Perl 5.10+, versions below 5.38 are **no longer maintained** by the Perl community (no security patches). For production use, upgrade to **Perl 5.38+**.\n\n#### Detailed Breaking Changes\n\n##### 1. **Installation Method Changed**\n\n**v2.x used ExtUtils::MakeMaker:**\n```bash\n# Old way (v2.x)\nperl Makefile.PL\nmake\nmake test\nmake install\n```\n\n**v3.x uses cpanfile (modern approach):**\n```bash\n# New way (v3.x)\ncpanm --installdeps .\nexport PERL5LIB=\"${PERL5LIB}:$(pwd)/lib\"\n```\n\n**Why?** OpenAPI Generator uses modern Perl tooling. `cpanfile` is the current standard.\n\n##### 2. **API Method Signatures - Named Parameters Required**\n\n**This is the MOST IMPORTANT change.** All API methods now require named parameters.\n\n**v2.x - Positional parameters:**\n```perl\n# Old way - positional parameter\nmy $result = $api->send_message($message_object);\n\n# Old way - multiple parameters\nmy $messages = $api->get_all_outbound_messages(1, 10);\n```\n\n**v3.x - Named parameters:**\n```perl\n# New way - named parameter (REQUIRED)\nmy $result = $api->send_message(\n    send_message_input_object => $message_object\n);\n\n# New way - named parameters\nmy $messages = $api->get_all_outbound_messages(\n    page => 1,\n    limit => 10\n);\n```\n\n**⚠️ Your code WILL break if you don't update method calls!**\n\n##### 3. **Object Initialization - Named Parameters Recommended**\n\n**v2.x - Setter methods:**\n```perl\n# Old way - create empty object, then set properties\nmy $message = Net::Sms::TextMagicClient::Object::SendMessageInputObject->new();\n$message->text('Hello');\n$message->phones('+1234567890');\n$message->from('MyCompany');\n```\n\n**v3.x - Constructor parameters (recommended):**\n```perl\n# New way - pass all parameters to constructor\nmy $message = Net::Sms::TextMagicClient::Object::SendMessageInputObject->new(\n    text   => 'Hello',\n    phones => '+1234567890',\n    from   => 'MyCompany'\n);\n```\n\n**Note:** Setter methods still work in v3.x, but constructor initialization is cleaner.\n\n##### 4. **Base URL Configuration**\n\n**v2.x - Base URL was implicit:**\n```perl\n# Old way - base_url was optional/implicit\nmy $client = Net::Sms::TextMagicClient::ApiClient->new(\n    username => 'user',\n    password => 'key'\n);\n```\n\n**v3.x - Base URL should be explicit:**\n```perl\n# New way - explicitly set base_url (recommended)\nmy $client = Net::Sms::TextMagicClient::ApiClient->new(\n    username => 'user',\n    password => 'key',\n    base_url => 'https://rest.textmagic.com'\n);\n```\n\n**Why?** Explicit configuration is clearer and prevents issues with default values.\n\n#### What Stays the Same\n\n- ✅ **Module name:** `Net::Sms::TextMagicClient` (unchanged)\n- ✅ **Namespace structure:** All classes in same hierarchy\n- ✅ **API class name:** `TextMagicApi` (unchanged)\n- ✅ **Authentication:** HTTP Basic Auth with username/API key\n- ✅ **Response objects:** Same structure and properties\n- ✅ **Error handling:** Same exception types\n\n#### Step-by-Step Migration Guide\n\n##### Step 1: Backup Your Current Code\n\n```bash\n# Create a backup before starting migration\ncp -r your_project your_project_backup\ngit checkout -b upgrade-to-v3\n```\n\n##### Step 2: Check Your Perl Version\n\n```bash\n# Check current Perl version\nperl -v\n\n# If below 5.38, consider upgrading (recommended for production)\n# Ubuntu/Debian:\nsudo apt-get install perl\n\n# macOS:\nbrew install perl\n\n# Or use perlbrew for multiple versions:\ncurl -L https://install.perlbrew.pl | bash\nperlbrew install perl-5.38.0\nperlbrew switch perl-5.38.0\n```\n\n##### Step 3: Remove Old SDK (v2.x)\n\n```bash\n# If you installed v2.x globally, remove it\n# Find where it's installed:\nperldoc -l Net::Sms::TextMagicClient\n\n# Remove old installation (adjust path as needed)\nrm -rf /path/to/perl/lib/Net/Sms/TextMagicClient\n```\n\n##### Step 4: Install New SDK (v3.x)\n\n```bash\n# Download v3.x\nwget https://github.com/textmagic/textmagic-rest-perl-v2/archive/v3.0.50030.tar.gz\ntar zxf v3.0.50030.tar.gz\nrm -f v3.0.50030.tar.gz\ncd textmagic-rest-perl-v2-3.0.50030\n\n# Install dependencies\ncpanm --installdeps .\n\n# Add to library path (add this to your ~/.bashrc or ~/.zshrc)\nexport PERL5LIB=\"${PERL5LIB}:$(pwd)/lib\"\n```\n\n##### Step 5: Update Your Code - API Method Calls\n\n**Find all API method calls and add named parameters:**\n\n```perl\n# BEFORE (v2.x):\n$api->send_message($message);\n$api->get_all_outbound_messages(1, 10);\n$api->delete_contact($contact_id);\n$api->update_contact($contact_id, $contact_data);\n\n# AFTER (v3.x):\n$api->send_message(send_message_input_object => $message);\n$api->get_all_outbound_messages(page => 1, limit => 10);\n$api->delete_contact(id => $contact_id);\n$api->update_contact(id => $contact_id, update_contact_input_object => $contact_data);\n```\n\n**Tip:** Use regex to find all API calls:\n```bash\ngrep -r '\\$api->' your_project/\n```\n\n##### Step 6: Update Object Initialization\n\n**Refactor object creation to use constructor parameters:**\n\n```perl\n# BEFORE (v2.x):\nmy $message = Net::Sms::TextMagicClient::Object::SendMessageInputObject->new();\n$message->text('Hello');\n$message->phones('+1234567890');\n$message->from('MyCompany');\n\n# AFTER (v3.x) - recommended:\nmy $message = Net::Sms::TextMagicClient::Object::SendMessageInputObject->new(\n    text   => 'Hello',\n    phones => '+1234567890',\n    from   => 'MyCompany'\n);\n```\n\n##### Step 7: Update ApiClient Configuration\n\n**Add explicit base_url:**\n\n```perl\n# BEFORE (v2.x):\nmy $client = Net::Sms::TextMagicClient::ApiClient->new(\n    username => $username,\n    password => $api_key\n);\n\n# AFTER (v3.x):\nmy $client = Net::Sms::TextMagicClient::ApiClient->new(\n    username => $username,\n    password => $api_key,\n    base_url => 'https://rest.textmagic.com'  # Add this\n);\n```\n\n##### Step 8: Test Thoroughly\n\n```bash\n# Run your test suite\nprove -l t/\n\n# Test individual scripts\nperl -Ilib your_script.pl\n\n# Enable warnings to catch issues\nperl -w -Ilib your_script.pl\n```\n\n##### Step 9: Update Dependencies in Your Project\n\n**If using cpanfile in your project:**\n```perl\n# Update your project's cpanfile\nrequires 'Net::Sms::TextMagicClient', '== 3.0.50030';\n```\n\n**If using Makefile.PL:**\n```perl\n# Update PREREQ_PM in your Makefile.PL\nPREREQ_PM => {\n    'Net::Sms::TextMagicClient' => '3.0.50030',\n    # ... other dependencies\n},\n```\n\n#### Complete Migration Examples\n\n##### Example 1: Simple Message Sending\n\n**BEFORE (v2.x):**\n```perl\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::SendMessageInputObject;\n\n# v2.x configuration\nmy $client = Net::Sms::TextMagicClient::ApiClient->new(\n    username => 'myuser',\n    password => 'myapikey'\n);\n\nmy $api = Net::Sms::TextMagicClient::TextMagicApi->new($client);\n\n# v2.x object creation\nmy $message = Net::Sms::TextMagicClient::Object::SendMessageInputObject->new();\n$message->text('Hello World');\n$message->phones('+1234567890');\n\n# v2.x API call - positional parameter\nmy $result = $api->send_message($message);\nprint \"Message ID: \" . $result->id . \"\\n\";\n```\n\n**AFTER (v3.x):**\n```perl\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::SendMessageInputObject;\n\n# v3.x configuration - explicit base_url\nmy $client = Net::Sms::TextMagicClient::ApiClient->new(\n    username => 'myuser',\n    password => 'myapikey',\n    base_url => 'https://rest.textmagic.com'\n);\n\nmy $api = Net::Sms::TextMagicClient::TextMagicApi->new($client);\n\n# v3.x object creation - constructor parameters\nmy $message = Net::Sms::TextMagicClient::Object::SendMessageInputObject->new(\n    text   => 'Hello World',\n    phones => '+1234567890'\n);\n\n# v3.x API call - NAMED parameter (required!)\nmy $result = $api->send_message(\n    send_message_input_object => $message\n);\nprint \"Message ID: \" . $result->id . \"\\n\";\n```\n\n##### Example 2: Retrieving Messages with Pagination\n\n**BEFORE (v2.x):**\n```perl\n# v2.x - positional parameters\nmy $page = 1;\nmy $limit = 10;\nmy $result = $api->get_all_outbound_messages($page, $limit);\n\nforeach my $msg (@{$result->resources}) {\n    print $msg->id . \": \" . $msg->text . \"\\n\";\n}\n```\n\n**AFTER (v3.x):**\n```perl\n# v3.x - named parameters (required!)\nmy $result = $api->get_all_outbound_messages(\n    page  => 1,\n    limit => 10\n);\n\nforeach my $msg (@{$result->resources}) {\n    print $msg->id . \": \" . $msg->text . \"\\n\";\n}\n```\n\n##### Example 3: Contact Management\n\n**BEFORE (v2.x):**\n```perl\n# v2.x - create contact\nmy $contact = Net::Sms::TextMagicClient::Object::CreateContactInputObject->new();\n$contact->first_name('John');\n$contact->last_name('Doe');\n$contact->phone('+1234567890');\n\nmy $result = $api->create_contact($contact);\n\n# v2.x - update contact\nmy $update = Net::Sms::TextMagicClient::Object::UpdateContactInputObject->new();\n$update->first_name('Jane');\n$api->update_contact($result->id, $update);\n\n# v2.x - delete contact\n$api->delete_contact($result->id);\n```\n\n**AFTER (v3.x):**\n```perl\n# v3.x - create contact\nmy $contact = Net::Sms::TextMagicClient::Object::CreateContactInputObject->new(\n    first_name => 'John',\n    last_name  => 'Doe',\n    phone      => '+1234567890'\n);\n\nmy $result = $api->create_contact(\n    create_contact_input_object => $contact\n);\n\n# v3.x - update contact (named parameters!)\nmy $update = Net::Sms::TextMagicClient::Object::UpdateContactInputObject->new(\n    first_name => 'Jane'\n);\n$api->update_contact(\n    id => $result->id,\n    update_contact_input_object => $update\n);\n\n# v3.x - delete contact (named parameter!)\n$api->delete_contact(id => $result->id);\n```\n\n##### Example 4: Error Handling\n\n**Error handling remains the same, but with updated method calls:**\n\n```perl\nuse Try::Tiny;\n\ntry {\n    # v3.x - named parameters\n    my $result = $api->send_message(\n        send_message_input_object => $message\n    );\n    print \"Success: \" . $result->id . \"\\n\";\n} catch {\n    if (ref($_) eq 'Net::Sms::TextMagicClient::ApiException') {\n        print \"API Error: \" . $_->message . \"\\n\";\n        print \"Code: \" . $_->code . \"\\n\";\n    } else {\n        print \"Unexpected error: $_\\n\";\n    }\n};\n```\n\n#### Common Migration Issues & Solutions\n\n##### Issue 1: \"Can't locate Net/Sms/TextMagicClient.pm\"\n\n**Cause:** Library path not set or SDK not installed.\n\n**Solution:**\n```bash\n# Check if SDK is in the path\nperl -MNet::Sms::TextMagicClient -e 'print \"OK\\n\"'\n\n# If not found, set PERL5LIB\nexport PERL5LIB=\"${PERL5LIB}:/path/to/textmagic-rest-perl-v2/lib\"\n\n# Or reinstall\ncd /path/to/textmagic-rest-perl-v2\ncpanm --installdeps .\n```\n\n##### Issue 2: \"Method not found\" or \"Wrong number of arguments\"\n\n**Cause:** Using v2.x positional parameters instead of v3.x named parameters.\n\n**Solution:**\n```perl\n# ❌ WRONG (v2.x style):\n$api->send_message($message);\n\n# ✅ CORRECT (v3.x style):\n$api->send_message(send_message_input_object => $message);\n```\n\n**How to find all occurrences:**\n```bash\n# Search for API calls that need updating\ngrep -rn '\\$api->' your_project/ | grep -v '=>'\n```\n\n##### Issue 3: \"SSL/TLS connection errors\"\n\n**Cause:** Missing LWP::Protocol::https module.\n\n**Solution:**\n```bash\n# Install HTTPS support\ncpanm LWP::Protocol::https\n\n# Or install all dependencies\ncpanm --installdeps .\n```\n\n##### Issue 4: \"Undefined subroutine\" errors\n\n**Cause:** Method names may have changed in OpenAPI Generator.\n\n**Solution:**\n```perl\n# Check available methods\nuse Data::Dumper;\nmy @methods = grep { /^[a-z]/ } keys %Net::Sms::TextMagicClient::TextMagicApi::;\nprint Dumper(\\@methods);\n\n# Or check documentation\nperldoc Net::Sms::TextMagicClient::TextMagicApi\n```\n\n##### Issue 5: \"Can't call method on undefined value\"\n\n**Cause:** API response structure may have changed.\n\n**Solution:**\n```perl\n# Add defensive checks\nmy $result = $api->some_method(...);\nif ($result && $result->resources) {\n    foreach my $item (@{$result->resources}) {\n        # Process item\n    }\n}\n\n# Or use Try::Tiny\nuse Try::Tiny;\ntry {\n    my $result = $api->some_method(...);\n    # Process result\n} catch {\n    warn \"Error: $_\";\n};\n```\n\n##### Issue 6: \"Perl version too old\" warnings\n\n**Cause:** Using Perl < 5.38 (unsupported by Perl community).\n\n**Solution:**\n```bash\n# Check current version\nperl -v\n\n# Upgrade using perlbrew (recommended)\ncurl -L https://install.perlbrew.pl | bash\nperlbrew install perl-5.38.0\nperlbrew switch perl-5.38.0\n\n# Or use system package manager\n# Ubuntu/Debian:\nsudo apt-get update && sudo apt-get install perl\n\n# macOS:\nbrew upgrade perl\n```\n\n##### Issue 7: \"Dependencies not found\"\n\n**Cause:** Missing CPAN modules.\n\n**Solution:**\n```bash\n# Install all dependencies from cpanfile\ncpanm --installdeps .\n\n# Or install individually\ncpanm URI::Query Log::Any JSON LWP::UserAgent Module::Runtime DateTime LWP::Protocol::https\n\n# Check installed modules\nperldoc -l URI::Query\nperldoc -l LWP::UserAgent\n```\n\n#### Benefits of Upgrading to v3.x\n\n##### Technical Improvements\n\n- ✅ **Modern code generation** - OpenAPI Generator 7.17.0 (actively maintained, regular updates)\n- ✅ **Better type handling** - Improved object serialization/deserialization\n- ✅ **Cleaner code** - Named parameters make code more readable and maintainable\n- ✅ **Bug fixes** - Many Swagger Codegen issues resolved\n- ✅ **Better error messages** - More descriptive exceptions and validation\n- ✅ **Future-proof** - Ready for OpenAPI 3.1+ features\n\n##### Ecosystem Alignment\n\n- ✅ **Consistent with other SDKs** - Same patterns as Python, Ruby, Go, Java SDKs\n- ✅ **Modern Perl practices** - Uses cpanfile, follows current standards\n- ✅ **Better documentation** - Auto-generated docs from OpenAPI spec\n- ✅ **Community support** - OpenAPI Generator has large, active community\n\n##### Security & Maintenance\n\n- ✅ **Security updates** - OpenAPI Generator receives regular security patches\n- ✅ **Active maintenance** - Generator is actively developed (Swagger Codegen is deprecated)\n- ✅ **Perl 5.38+ support** - Ready for modern, supported Perl versions\n- ✅ **Long-term support** - OpenAPI Generator is the industry standard\n\n##### Migration Effort vs. Benefits\n\n| Effort Level | Time Estimate | Benefit |\n|--------------|---------------|----------|\n| **Small projects** (< 100 API calls) | 1-2 hours | High - Future-proof, better code quality |\n| **Medium projects** (100-500 calls) | 4-8 hours | High - Consistency, maintainability |\n| **Large projects** (500+ calls) | 1-2 days | High - Long-term support, security |\n\n**Recommendation:** The migration effort is worthwhile for all project sizes due to long-term benefits.\n\n#### Need Help?\n\nIf you encounter issues during migration:\n\n1. Check the [GitHub Issues](https://github.com/textmagic/textmagic-rest-perl-v2/issues)\n2. Review the [API Documentation](https://docs.textmagic.com/)\n3. Contact [TextMagic Support](https://www.textmagic.com/support/)\n\n\n# Ruby\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-ruby-v2&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your Ruby application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-ruby-v2)\n\n## Requirements\n\n- **Ruby 2.7+** (Ruby 2.6 and earlier are no longer supported)\n  - Tested on Ruby 2.7, 3.0, 3.1, 3.2, 3.3\n- **Bundler** for dependency management\n\n### Dependencies\n\n- **Typhoeus** ~> 1.0 (HTTP client library)\n- **RSpec** ~> 3.6 (for development/testing)\n\n## Installation\n\n### Via RubyGems (Recommended)\n\n```bash\ngem install textmagic_rest_client\n```\n\n### Via Gemfile\n\nAdd this line to your `Gemfile`:\n\n```ruby\ngem 'textmagic_rest_client', '~> 3.0.50052'\n```\n\nThen run:\n\n```bash\nbundle install\n```\n\n### From GitHub\n\nAdd this line to your `Gemfile`:\n\n```ruby\ngem 'textmagic_rest_client', git: 'https://github.com/textmagic/textmagic-rest-ruby-v2.git', tag: 'v3.0.50052'\n```\n\nThen run:\n\n```bash\nbundle install\n```\n\n### Updating the Gem\n\n```bash\n# Update to latest version\nbundle update textmagic_rest_client\n\n# Or via gem command\ngem update textmagic_rest_client\n```\n\n## Quick Start\n\n### Basic Usage\n\n```ruby\nrequire 'textmagic_rest_client'\n\n# Configure API credentials\n# Get your credentials from https://app.textmagic.com/settings/api\nTextMagic.configure do |config|\n  config.username = 'YOUR_USERNAME'\n  config.password = 'YOUR_API_KEY'\nend\n\n# Create API instance\napi = TextMagic::TextMagicApi.new\n\n# Test connection\nbegin\n  result = api.ping\n  puts \"✅ Connected! Server time: #{result.ping}\"\nrescue TextMagic::ApiError => e\n  puts \"❌ Error: #{e}\"\nend\n```\n\n### Sending Messages\n\n```ruby\nrequire 'textmagic_rest_client'\n\nTextMagic.configure do |config|\n  config.username = 'YOUR_USERNAME'\n  config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n# Send SMS to a single number\nbegin\n  message = TextMagic::SendMessageInputObject.new(\n    text: 'Hello from TextMagic Ruby SDK!',\n    phones: '+1234567890'\n  )\n  result = api.send_message(message)\n  puts \"✅ Message sent! ID: #{result.id}\"\n  puts \"   Session ID: #{result.session_id}\"\nrescue TextMagic::ApiError => e\n  puts \"❌ Error sending message: #{e}\"\nend\n\n# Send SMS to multiple numbers\nbegin\n  message = TextMagic::SendMessageInputObject.new(\n    text: 'Bulk message',\n    phones: '+1234567890,+0987654321'  # Comma-separated\n  )\n  result = api.send_message(message)\n  puts \"✅ Bulk message sent! Session ID: #{result.session_id}\"\nrescue TextMagic::ApiError => e\n  puts \"❌ Error: #{e}\"\nend\n```\n\n### Getting Outgoing Messages\n\n```ruby\nrequire 'textmagic_rest_client'\n\nTextMagic.configure do |config|\n  config.username = 'YOUR_USERNAME'\n  config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nbegin\n  # Get recent outgoing messages\n  result = api.get_all_outbound_messages(page: 1, limit: 10)\n\n  puts \"Total messages: #{result.page.total}\"\n  result.resources.each do |message|\n    puts \"- [#{message.id}] #{message.text[0..50]}... → #{message.receiver}\"\n    puts \"  Status: #{message.status}, Sent: #{message.created_at}\"\n  end\nrescue TextMagic::ApiError => e\n  puts \"❌ Error: #{e}\"\nend\n```\n\n### Uploading Files\n\n```ruby\nrequire 'textmagic_rest_client'\n\nTextMagic.configure do |config|\n  config.username = 'YOUR_USERNAME'\n  config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n# Upload list avatar\nbegin\n  file = File.open('path/to/avatar.png', 'r')\n  result = api.upload_list_avatar(file, 12345)  # 12345 is List ID\n  puts \"✅ Avatar uploaded! Resource ID: #{result.id}\"\nrescue TextMagic::ApiError => e\n  puts \"❌ Error: #{e}\"\nensure\n  file.close if file\nend\n```\n\n### Error Handling\n\n```ruby\nrequire 'textmagic_rest_client'\n\nTextMagic.configure do |config|\n  config.username = 'YOUR_USERNAME'\n  config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nbegin\n  message = TextMagic::SendMessageInputObject.new(\n    text: 'Test message',\n    phones: '+1234567890'\n  )\n  result = api.send_message(message)\n  puts \"✅ Success: #{result.id}\"\nrescue TextMagic::ApiError => e\n  puts \"❌ API Exception:\"\n  puts \"   Code: #{e.code}\"\n  puts \"   Message: #{e.message}\"\n  puts \"   Response body: #{e.response_body}\"\nrescue StandardError => e\n  puts \"❌ Unexpected error: #{e}\"\nend\n```\n\n## API Documentation\n\nFor detailed API documentation, including all available methods and parameters, please visit:\n\n- **REST API Documentation:** https://docs.textmagic.com/\n\n### Available Methods\n\nThe SDK provides access to all TextMagic API endpoints, including:\n\n- **Messages:** Send, receive, and manage SMS messages\n- **Contacts:** Manage your contact lists\n- **Templates:** Create and use message templates\n- **Chats:** Manage conversations\n- **Bulk Messaging:** Send messages to multiple recipients\n- **Sender IDs:** Manage sender names\n- **Account:** Check balance and account information\n- **Statistics:** Get messaging statistics and reports\n\n## Migration Guide\n\n### Migrating from v2.x to v3.x\n\n#### Breaking Changes\n\n1. **Ruby Version Requirements:**\n   - v2.x: Ruby 2.4+\n   - v3.x: Ruby 2.7+ only\n\n2. **HTTP Library:**\n   - v2.x: Various libraries\n   - v3.x: Typhoeus (modern, thread-safe)\n\n3. **Object Initialization:**\n   ```ruby\n   # v2.x\n   message = TextMagic::SendMessageInputObject.new\n   message.text = 'Hello'\n   message.phones = '+1234567890'\n\n   # v3.x (supports both styles, but keyword arguments preferred)\n   message = TextMagic::SendMessageInputObject.new(\n     text: 'Hello',\n     phones: '+1234567890'\n   )\n   ```\n\n#### What Stays the Same\n\n- ✅ Module name: `TextMagic` (unchanged)\n- ✅ Gem name: `textmagic_rest_client` (unchanged)\n- ✅ Configuration method: `TextMagic.configure` (unchanged)\n- ✅ API method names and signatures\n- ✅ Response objects structure\n- ✅ Authentication mechanism\n- ✅ Error handling with `TextMagic::ApiError`\n\n#### Upgrade Steps\n\n1. **Update Ruby version** (if needed):\n   ```bash\n   # Check current Ruby version\n   ruby -v\n\n   # Install Ruby 2.7+ using rbenv or rvm\n   rbenv install 3.3.0\n   rbenv global 3.3.0\n   ```\n\n2. **Update Gemfile**:\n   ```ruby\n   # Update version constraint\n   gem 'textmagic_rest_client', '~> 3.0'\n   ```\n\n3. **Install new version**:\n   ```bash\n   bundle update textmagic_rest_client\n   ```\n\n4. **Update code** (if using old initialization style):\n   ```ruby\n   # Old style still works, but prefer keyword arguments\n   message = TextMagic::SendMessageInputObject.new(\n     text: 'Hello',\n     phones: '+1234567890'\n   )\n   ```\n\n5. **Test your application**:\n   ```bash\n   bundle exec rspec\n   # or your test command\n   ```\n\n## Development\n\n### Running Tests\n\n```bash\n# Install development dependencies\nbundle install\n\n# Run tests\nbundle exec rspec\n\n# Run tests with coverage\nbundle exec rspec --format documentation\n```\n\n### Building the Gem\n\n```bash\n# Build gem file\ngem build textmagic_rest_client.gemspec\n\n# Install locally\ngem install ./textmagic_rest_client-3.0.50052.gem\n```\n\n## Need Help?\n\n- **Documentation:** https://docs.textmagic.com/\n- **Support:** https://www.textmagic.com/support/\n- **GitHub Issues:** https://github.com/textmagic/textmagic-rest-ruby-v2/issues\n\n\n# Go\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-go-v2&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your Go application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-go-v2)\n\n## Requirements\n\n- **Go 1.23** or higher\n- Go modules support\n\n## Installation\n\n### Via go get (Recommended)\n\n```bash\ngo get -u github.com/textmagic/textmagic-rest-go-v2/v3@latest\n```\n\n### Via go.mod\n\nAdd to your `go.mod`:\n```go\nrequire github.com/textmagic/textmagic-rest-go-v2/v3 v3.0.50044\n```\n\nThen run:\n```bash\ngo mod download\n```\n\n### Package Registry\n\nThis package is available on [pkg.go.dev](https://pkg.go.dev/github.com/textmagic/textmagic-rest-go-v2/v3) - the official Go package registry.\n\n## Usage Example\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n\n    tm \"github.com/textmagic/textmagic-rest-go-v2/v3\"\n)\n\nfunc main() {\n    // Create configuration\n    cfg := tm.NewConfiguration()\n    cfg.Servers = tm.ServerConfigurations{\n        {\n            URL: \"https://rest.textmagic.com\",\n            Description: \"TextMagic REST API\",\n        },\n    }\n\n    client := tm.NewAPIClient(cfg)\n\n    // Set up authentication\n    // Get your credentials from https://app.textmagic.com/settings/api\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    // Simple ping request example\n    pingResponse, _, err := client.TextMagicAPI.Ping(auth).Execute()\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Println(\"Ping:\", pingResponse.Ping)\n\n    // Send a new message request example\n    sendMessageInput := tm.SendMessageInputObject{\n        Text:   \"I love TextMagic!\",\n        Phones: \"+19998887766\",\n    }\n\n    sendMessageResponse, _, err := client.TextMagicAPI.SendMessage(auth).SendMessageInputObject(sendMessageInput).Execute()\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Println(\"Message ID:\", sendMessageResponse.Id)\n\n    // Get all outgoing messages request example\n    page := int32(1)\n    limit := int32(250)\n\n    getAllOutboundMessageResponse, _, err := client.TextMagicAPI.GetAllOutboundMessages(auth).\n        Page(page).\n        Limit(limit).\n        Execute()\n\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    if len(getAllOutboundMessageResponse.Resources) > 0 {\n        fmt.Println(\"First message ID:\", getAllOutboundMessageResponse.Resources[0].Id)\n    }\n}\n```\n\n## Features\n\n- ✅ Full TextMagic API support\n- ✅ Type-safe API calls\n- ✅ Context-based authentication\n- ✅ File upload support\n- ✅ Comprehensive error handling\n- ✅ Modern Go idioms (Go 1.23+)\n- ✅ No external dependencies for optional parameters\n- ✅ Fluent API for method chaining\n\n## Error Handling\n\nThe SDK returns standard Go errors that should be properly handled:\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n\n    tm \"github.com/textmagic/textmagic-rest-go-v2/v3\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    cfg.Servers = tm.ServerConfigurations{\n        {\n            URL: \"https://rest.textmagic.com\",\n            Description: \"TextMagic REST API\",\n        },\n    }\n\n    client := tm.NewAPIClient(cfg)\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    sendMessageInput := tm.SendMessageInputObject{\n        Text:   \"Test message\",\n        Phones: \"+1234567890\",\n    }\n\n    response, httpResp, err := client.TextMagicAPI.SendMessage(auth).\n        SendMessageInputObject(sendMessageInput).\n        Execute()\n\n    if err != nil {\n        // Handle different types of errors\n        if httpResp != nil {\n            switch httpResp.StatusCode {\n            case 401:\n                log.Fatal(\"Authentication failed: Invalid credentials\")\n            case 400:\n                log.Fatal(\"Bad request: Invalid parameters\")\n            case 404:\n                log.Fatal(\"Resource not found\")\n            case 429:\n                log.Fatal(\"Rate limit exceeded\")\n            default:\n                log.Fatalf(\"API error (status %d): %v\", httpResp.StatusCode, err)\n            }\n        } else {\n            log.Fatalf(\"Network error: %v\", err)\n        }\n    }\n\n    fmt.Printf(\"Message sent successfully! ID: %s\\n\", response.Id)\n}\n```\n\n### Common Error Codes\n\n- **401 Unauthorized** - Invalid credentials\n- **400 Bad Request** - Invalid parameters\n- **404 Not Found** - Resource not found\n- **429 Too Many Requests** - Rate limit exceeded\n- **500 Internal Server Error** - Server error\n\n## API Documentation\n\nFor complete API documentation, including all available methods, parameters, and response formats, please visit:\n\n- 📖 **[TextMagic API Documentation](https://docs.textmagic.com/)**\n- 🔗 **[API Reference](https://docs.textmagic.com/#tag/TextMagic-API)**\n- 📦 **[Go Package Documentation](https://pkg.go.dev/github.com/textmagic/textmagic-rest-go-v2/v3)** - Official Go package registry with full SDK reference\n\n### Available API Methods\n\nThe SDK provides access to all TextMagic API endpoints through the `TextMagicAPI` interface. Some commonly used methods include:\n\n**Messaging:**\n- `SendMessage(ctx)` - Send SMS messages\n- `GetAllOutboundMessages(ctx)` - Get sent messages\n- `GetAllInboundMessages(ctx)` - Get received messages\n- `DeleteMessage(ctx, id)` - Delete a message\n- `GetMessagesBySessionId(ctx, id)` - Get messages by session ID\n\n**Contacts:**\n- `CreateContact(ctx)` - Create a new contact\n- `GetContact(ctx, id)` - Get contact details\n- `UpdateContact(ctx, id)` - Update contact information\n- `DeleteContact(ctx, id)` - Delete a contact\n- `GetAllContacts(ctx)` - Get all contacts\n\n**Lists:**\n- `CreateList(ctx)` - Create a contact list\n- `GetList(ctx, id)` - Get list details\n- `GetAllLists(ctx)` - Get all lists\n- `AssignContactsToList(ctx, id)` - Add contacts to a list\n\n**Account:**\n- `Ping(ctx)` - Test API connection\n- `GetUser(ctx)` - Get account information\n- `GetUserBalance(ctx)` - Get account balance\n\nFor a complete list of available methods, please refer to the generated SDK documentation in the `docs/` directory.\n\n## Migration Guide from v1.x to v2.x\n\n### Breaking Changes\n\n#### Go Version Requirement\n\n**v1.x (Swagger Codegen):**\n```go\ngo 1.13\n```\n\n**v2.x (OpenAPI Generator):**\n```go\ngo 1.23\n```\n\n**Action Required:** Upgrade your Go version to 1.23 or later.\n\n```bash\n# Check your Go version\ngo version\n\n# Should output: go1.23.x or higher\n```\n\n#### Dependencies Update\n\n**v1.x (Swagger Codegen):**\n```go\nimport (\n    \"github.com/antihax/optional\"\n    tm \"github.com/textmagic/textmagic-rest-go-v2\"\n)\n\n// Optional parameters required antihax/optional\npage := optional.NewInt32(1)\nlimit := optional.NewInt32(10)\n```\n\n**v2.x (OpenAPI Generator):**\n```go\nimport (\n    tm \"github.com/textmagic/textmagic-rest-go-v2/v3\"\n)\n\n// Optional parameters use fluent API\npage := int32(1)\nlimit := int32(10)\n```\n\n**Note:**\n- The `antihax/optional` dependency is **no longer required**\n- OpenAPI Generator 7.x uses built-in Go types for optional parameters\n- Fluent API for method chaining\n\n#### Import Path Change\n\n**v1.x:**\n```go\nimport tm \"github.com/textmagic/textmagic-rest-go-v2\"\n```\n\n**v2.x:**\n```go\nimport tm \"github.com/textmagic/textmagic-rest-go-v2/v3\"\n```\n\n**Note:** The `/v3` suffix is required for Go modules compatibility.\n\n#### API Usage Changes\n\n**v1.x (Swagger Codegen):**\n```go\napi := tm.NewAPIClient(cfg)\n\n// Optional parameters with antihax/optional\nopts := &tm.GetAllOutboundMessagesOpts{\n    Page:  optional.NewInt32(1),\n    Limit: optional.NewInt32(10),\n}\n\nresult, _, err := api.TextMagicApi.GetAllOutboundMessages(ctx, opts)\n```\n\n**v2.x (OpenAPI Generator):**\n```go\nclient := tm.NewAPIClient(cfg)\n\n// Fluent API with method chaining\nresult, _, err := client.TextMagicAPI.GetAllOutboundMessages(ctx).\n    Page(1).\n    Limit(10).\n    Execute()\n```\n\n### What Stays the Same\n\n✅ **Authentication** - Configuration remains the same:\n```go\nauth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n    UserName: \"YOUR_USERNAME\",\n    Password: \"YOUR_API_KEY\",\n})\n```\n\n✅ **API Methods** - All methods remain the same (with improved syntax)\n✅ **Models** - All data structures remain compatible\n✅ **Error Handling** - Standard Go error handling\n\n### Step-by-Step Migration\n\n1. **Upgrade Go to 1.23+**\n   ```bash\n   # Download and install Go 1.23\n   # https://go.dev/dl/\n\n   # Verify\n   go version\n   ```\n\n2. **Update Import Path**\n   ```bash\n   # Update go.mod\n   go get -u github.com/textmagic/textmagic-rest-go-v2/v3@latest\n\n   # Remove old version\n   go mod tidy\n   ```\n\n3. **Update Your Code**\n\n   **Before (v1.x):**\n   ```go\n   import (\n       \"github.com/antihax/optional\"\n       tm \"github.com/textmagic/textmagic-rest-go-v2\"\n   )\n\n   opts := &tm.GetAllOutboundMessagesOpts{\n       Page:  optional.NewInt32(1),\n       Limit: optional.NewInt32(10),\n   }\n   result, _, err := api.TextMagicApi.GetAllOutboundMessages(ctx, opts)\n   ```\n\n   **After (v2.x):**\n   ```go\n   import tm \"github.com/textmagic/textmagic-rest-go-v2/v3\"\n\n   result, _, err := client.TextMagicAPI.GetAllOutboundMessages(ctx).\n       Page(1).\n       Limit(10).\n       Execute()\n   ```\n\n4. **Remove antihax/optional**\n   ```bash\n   # Remove from imports and code\n   # Run go mod tidy to clean up\n   go mod tidy\n   ```\n\n5. **Test Your Application**\n   ```bash\n   # Run your tests\n   go test ./...\n\n   # Build your application\n   go build\n   ```\n\n### Compatibility Matrix\n\n|    Feature    | v1.x (Swagger) | v2.x (OpenAPI) | Compatible? |\n|---------------|----------------|----------------|-------------|\n| Go 1.13-1.22  |       ✅       |       ❌       |    ❌ No    |\n| Go 1.23+      |       ✅       |       ✅       |    ✅ Yes   |\n| API Methods   |      Same      |      Same      |    ✅ Yes   |\n| Models        |      Same      |      Same      |    ✅ Yes   |\n| Authentication|      Same      |      Same      |    ✅ Yes   |\n| File Upload   |       ❌       |       ✅       |    ⚠️ New   |\n| Optional Params| antihax/optional | Fluent API   |    ⚠️ Changed |\n| Import Path   | `/textmagic-rest-go-v2` | `/textmagic-rest-go-v2/v3` | ⚠️ Changed |\n\n### Need Help?\n\n- 📖 [Full Documentation](https://docs.textmagic.com/)\n- 💬 [Support](https://www.textmagic.com/support/)\n- 🐛 [Report Issues](https://github.com/textmagic/textmagic-rest-go-v2/issues)\n\n\n# Delphi\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-object-pascal&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your Delphi application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-object-pascal)\n\n## How to Install\nYou can clone the repo in your location of choice by using :\n```sh\ngit clone https://github.com/textmagic/textmagic-rest-object-pascal.git\n```\nYou can also manually clone the project, or simply download the files.\n## Getting it running\nYou'll need to make sure these 3 files are accessible by your project, either by adding them directly to the project, or making them accessible through your library path.\n- *TextmagicRestClient.pas* - The API wrapper itself.\n- *XSuperJSON.pas* - Helper library for JSON Parsing\n- *XSuperObject.pas* - Helper library for JSON Parsing\n\nOn your project you will only need to use the unit *TextmagicRestClient.pas*.\n\nThe wrapper uses Indy components to communicate with the REST API via SSL. In some cases, Indy will not be able to load the SSL libraries. If that happens, you can get them at [https://indy.fulgan.com/SSL/]. You'll just need to make sure the files **libeay32.dll** and **ssleay32.dll** (note: we use 32 bit versions for example application) are accessible to your application.\n\nThat is all you need to start using the API.\n\n## Using the API\nThe entire API is accessible via the class **TTMClient**, found in the **TextmagicRestClient.pas** file. You'll need to provide your credentials when creating the object. Check the TextMagic API documentation for up to date instructions on how to do that.\n```Pascal\nvar TMC:TTMClient;\n...\nTMC := TTMClient.Create(Your_User_Name, Your_API_V2_Key);\n```\nThe TTMClient's methods and parameters are very self-explanatory and for the most part they correspond directly to the API functions. Keep in mind most of the methods return an instance of a class, so don't forget to correctly free them to avoid memory leaks.\nYou'll note several of the methods return a **TTMLinkResult** class. This is a generic response for several of the API functions and contains the **id** of the created/updated resource and a direct link to the resource itself.\n## A few examples\nGetting your user account details :\n```Pascal\nvar User:TTMUser;\n...\nUser:=TMC.GetUser;\nUser.free;\n```\nCreating a new contact list:\n```Pascal\nvar LinkResult:TTMLinkResult;\n...\nLinkResult:=TMC.CreateList('My new list');\n{ LinkResult.Id will contain the ID of the newly created list } \nLinkResult.free;\n```\n\nCreating a new contact:\n```Pascal\nvar LinkResult:TTMLinkResult;\n...\n{ A list id is mandatory for creating contacts }\nLinkResult:=TMC.CreateContact('99911111337', MY_LIST_ID,'John','Doe');\n{ LinkResult.Id will contain the ID of the newly created contact } \nLinkResult.free;\n```\nSending a message to a single contact:\n```Pascal\nvar MR:TTMMessageResult;\n...\nMR:=TMC.CreateMessage('My SMS message',null,null,MY_CONTACT_ID,null,null,null,null,null,null,null);\nMR.free;\n```\nSending a message to a list of contacts:\n```Pascal\nvar MR:TTMMessageResult;\n...\nMR:=TMC.CreateMessage('My SMS message',null,null,null,MY_LIST_ID,null,null,null,null,null,null);\nMR.free;\n```\n\n# Bash\n\n<iframe src=\"https://ghbtns.com/github-btn.html?user=textmagic&repo=textmagic-rest-bash&type=star&count=true\" frameborder=\"0\" scrolling=\"0\" width=\"170px\" height=\"20px\"></iframe>\n\nThis library provides you with an easy way of sending SMS and receiving replies by integrating TextMagic SMS Gateway into your Bash application.\n\n[Get it now on GitHub](https://github.com/textmagic/textmagic-rest-bash)\n\n## Installation Instructions\n1.  [Download](https://github.com/textmagic/textmagic-rest-bash) the latest version of the wrapper from GitHub.\n2.  Put **tm.sh** into any folder or into PATH, if you want to use it globally.\n\n## Requirements\nThe Shell wrapper for the TextMagic API has the following requirement:\n*   Bash version 3 or newer.\n\n## Send SMS via Shell (an example)\nRun this in your command prompt or execute in script:\n```bash\ntm.sh send --text=\"Hello from TextMagic\" --phones=447860021130\n```\n\n"
    },
    {
      "name": "Common",
      "x-displayName": "Timezones and Countries",
      "description": ""
    },
    {
      "name": "Lookup",
      "description": "To get more details about a number or to check whether it is a valid number or not, you can use the Carrier Lookup command. To upload and check numbers in bulk, please use our [Web app](https://my.textmagic.com/online/carrier-lookup/)."
    },
    {
      "name": "Email Campaigns",
      "x-displayName": "Email Campaigns",
      "description": "# Email Campaign API\n\nThe Email Campaign API allows you to create and manage email marketing campaigns through the TextMagic platform. This API provides functionality to send immediate and scheduled bulk emails to your contacts and groups with advanced tracking and analytics.\n\n## Key Features\n\n- **Immediate Email Sending**: Send emails to multiple recipients right away\n- **Scheduled Campaigns**: Schedule emails for future delivery with one-time or recurring schedules\n- **Contact Integration**: Send to existing contacts, groups, or direct email addresses\n- **Email Sender Management**: Configure and manage verified email sender addresses\n- **Custom Sender Settings**: Use your configured email sender IDs for branded communications\n- **Advanced Tracking**: Monitor delivery, opens, clicks, and other engagement metrics\n- **Cost Management**: Real-time cost calculation and balance validation\n- **Team Collaboration**: Support for team workflows and impersonation\n- **Recurring Campaigns**: Set up automated email sequences with flexible scheduling\n\n## Authentication\n\nAll Email Campaign API endpoints require authentication using your TextMagic API credentials. Include your authentication token in the request headers.\n\n## Rate Limits\n\nEmail campaigns are subject to rate limiting and sending quotas based on your account plan. Monitor your usage through the API responses and account dashboard.\n\n## Supported Recipients\n\nYou can send email campaigns to:\n- **Contacts**: Use contact IDs from your TextMagic contact list\n- **Groups**: Target entire contact groups by group ID\n- **Direct Emails**: Send to specific email addresses not in your contact list\n- **Mixed Recipients**: Combine contacts, groups, and direct emails in a single campaign\n\n## Cost Calculation\n\nEmail campaign costs are calculated based on:\n- Number of recipients\n- Your account's email pricing tier\n- Additional features used (tracking, analytics, etc.)\n\nThe API will validate your account balance before creating campaigns and return cost estimates in responses.\n\n## Error Handling\n\nThe API returns detailed error information for common scenarios:\n- Insufficient account balance\n- Invalid recipient data\n- Missing or invalid sender configuration\n- Validation errors in campaign content\n\n## Campaign Types\n\n### Immediate Campaigns\nSend emails immediately to your recipients. Perfect for:\n- Breaking news and urgent announcements\n- Time-sensitive promotions\n- One-off communications\n\n### Scheduled Campaigns\nSchedule emails for future delivery with flexible timing options:\n- **One-time scheduled**: Send at a specific date and time\n- **Recurring campaigns**: Automated sending with daily, weekly, monthly, or custom schedules\n- **Timezone support**: Schedule in recipient's local timezone or specific timezone\n\n## Getting Started\n\n### Email Sender Setup\n1. Configure your email sender settings and verify your domains in your TextMagic account\n2. Use the Get Email Senders endpoint to retrieve available verified senders\n3. Note the sender IDs for use in campaign creation\n\n### For Immediate Campaigns\n1. Get your verified email senders using the Email Senders endpoint\n2. Prepare your recipient lists (contacts, groups, or email addresses)\n3. Create your email content with subject and HTML message\n4. Use the Create Email Campaign endpoint with a verified sender ID to send immediately\n5. Monitor campaign progress and analytics through the response data\n\n### For Scheduled Campaigns\n1. Get your verified email senders using the Email Senders endpoint\n2. Prepare your recipient lists (contacts, groups, or email addresses)\n3. Create your email content with subject and HTML message\n4. Define your schedule parameters (date, time, timezone, recurrence rules)\n5. Use the Schedule Email Campaign endpoint with a verified sender ID\n6. Monitor scheduled campaigns and their execution through the API\n\nFor detailed endpoint documentation, see the individual endpoint descriptions below.\n"
    }
  ],
  "externalDocs": {
    "description": "API documentation",
    "url": "https://docs.textmagictesting.com/"
  },
  "paths": {
    "/api/v2/auth": {},
    "/api/v2/ping": {
      "get": {
        "operationId": "ping",
        "summary": "Ping",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Timezones%20and%20Countries/ping\" target=\"_blank\">Try in sandbox</a><br>Make a simple ping request.",
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/PingResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Common"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    // PingResponse class object\n    $result = $api->ping();\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->ping: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            // PingResponse class object\n            PingResponse obj = apiInstance.ping();\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling ping\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.ping().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    # PingResponse object\n    result = api.ping()\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->ping: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                // PingResponse class object\n                var result = apiInstance.Ping();\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling ping: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            ' PingResponse class object\n            Dim result = apiInstance.Ping()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling ping: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    // tm.PingResponse struct\n    result, _, err := client.TextMagicApi.Ping(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task<std::shared_ptr<PingResponse>> result = api.ping();\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"ping() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    # PingResponse object\n    result = api_instance.ping()\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->ping: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    # PingResponse object\n    my $result = $api_instance->ping();\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->ping: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/timezones": {
      "get": {
        "operationId": "getTimezones",
        "summary": "Get timezones",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Timezones%20and%20Countries/getTimezones\" target=\"_blank\">Try in sandbox</a><br>Return all available timezone IDs",
        "parameters": [
          {
            "name": "full",
            "in": "query",
            "required": false,
            "description": "Return full info about timezones in array (0 or 1). Default is 0.",
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "default": 0
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetTimezonesResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Common"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "Not supported yet."
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getTimezones method below, default values will be used\n        int full = 0;\n\n        try {\n            // GetTimezonesResponse class object\n            GetTimezonesResponse obj = apiInstance.getTimezones(full);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getTimezones\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    full: 0,\n};\n\napi.getTimezones(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  full: 0,\n}\n\nbegin\n    # GetTimezonesResponse object\n    result = api.get_timezones(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_timezones: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getTimezones method below, default values will be used\n            int full = 0;\n\n            try {\n                // GetTimezonesResponse class object\n                var result = apiInstance.GetTimezones(full);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getTimezones: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getTimezones method below, default values will be used\n        Dim full As Integer = 0\n\n        Try\n            ' GetTimezonesResponse class object\n            Dim result = apiInstance.GetTimezones(full)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getTimezones: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetTimezonesOpts{\n        // Optional parameters\n        Full: optional.NewInt32(0),\n    }\n\n    // tm.GetTimezonesResponse struct\n    result, _, err := client.TextMagicApi.GetTimezones(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int full = 0;\n\n    try {\n        pplx::task<std::shared_ptr<GetTimezonesResponse>> result = api.getTimezones(full);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getTimezones() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\nfull = 0\n\ntry:\n    # GetTimezonesResponse object\n    result = api_instance.get_timezones(full=full)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_timezones: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $full = 0;\n\neval {\n    # GetTimezonesResponse object\n    my $result = $api_instance->get_timezones(full => $full);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_timezones: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/push/tokens": {},
    "/api/v2/push/tokens/{type}/{deviceId}": {},
    "/api/v2/state": {},
    "/api/v2/versions": {},
    "/api/v2/lookups/{phone}": {
      "get": {
        "operationId": "doCarrierLookup",
        "summary": "Carrier Lookup",
        "parameters": [
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "type": "string",
            "x-example": "447860021130",
            "description": "Phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164) or in [National format](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers).\n"
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "This option must be specified only if the phone number is in a **[National format](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers)**.\n",
            "type": "string",
            "x-example": "GB"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/DoCarrierLookupResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "429": {
            "description": "Returned when the number of queries per second is too high."
          }
        },
        "tags": [
          "Lookup"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$phone = \"447860021130\";\n// Optional, you can pass them as null values to doCarrierLookup method below, default values will be used\n$country = \"GB\";\n\ntry {\n    // DoCarrierLookupResponse class object\n    $result = $api->doCarrierLookup($phone, $country);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->doCarrierLookup: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        String phone = \"447860021130\";\n        // Optional, you can pass them as null values to doCarrierLookup method below, default values will be used\n        String country = \"GB\";\n\n        try {\n            // DoCarrierLookupResponse class object\n            DoCarrierLookupResponse obj = apiInstance.doCarrierLookup(phone, country);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling doCarrierLookup\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst phone = \"447860021130\";\n\n// Optional parameters\nconst opts = {\n    country: \"GB\",\n};\n\napi.doCarrierLookup(phone, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nphone = '447860021130'\nparams = {\n  # Optional parameters\n  country: 'GB',\n}\n\nbegin\n    # DoCarrierLookupResponse object\n    result = api.do_carrier_lookup(phone, params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->do_carrier_lookup: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            string phone = \"447860021130\";\n            // Optional, you can pass them as null values to doCarrierLookup method below, default values will be used\n            string country = \"GB\";\n\n            try {\n                // DoCarrierLookupResponse class object\n                var result = apiInstance.DoCarrierLookup(phone, country);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling doCarrierLookup: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim phone As String = \"447860021130\"\n        ' Optional, you can pass them as null values to doCarrierLookup method below, default values will be used\n        Dim country As String = \"GB\"\n\n        Try\n            ' DoCarrierLookupResponse class object\n            Dim result = apiInstance.DoCarrierLookup(phone, country)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling doCarrierLookup: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var phone string = \"447860021130\"\n\n    opts := tm.DoCarrierLookupOpts{\n        // Optional parameters\n        Country: optional.NewString(\"GB\"),\n    }\n\n    // tm.DoCarrierLookupResponse struct\n    result, _, err := client.TextMagicApi.DoCarrierLookup(auth, phone, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::string phone = \"447860021130\";\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    std::string country = \"GB\";\n\n    try {\n        pplx::task<std::shared_ptr<DoCarrierLookupResponse>> result = api.doCarrierLookup(phone, country);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"doCarrierLookup() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nphone = \"447860021130\"\n# Optional params, you can skip them\ncountry = \"GB\"\n\ntry:\n    # DoCarrierLookupResponse object\n    result = api_instance.do_carrier_lookup(phone=phone, country=country)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->do_carrier_lookup: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $phone = '447860021130';\n# Optional params, you can skip them\nmy $country = 'GB';\n\neval {\n    # DoCarrierLookupResponse object\n    my $result = $api_instance->do_carrier_lookup(phone => $phone, country => $country);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->do_carrier_lookup: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lookup/doCarrierLookup\" target=\"_blank\">Try in sandbox</a><br>This API call allows you to retrieve additional information about a phone number: region-specific phone number formatting, carrier, phone type (landline/mobile) and country information.\n\n> Numbers must be checked one by one. You cannot check multiple numbers in one request.\n \n"
      }
    },
    "/api/v2/countries": {
      "get": {
        "operationId": "getCountries",
        "summary": "Get countries",
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetCountriesResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Common"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "Not supported yet."
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            // GetCountriesResponse class object\n            GetCountriesResponse obj = apiInstance.getCountries();\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getCountries\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.getCountries().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    # GetCountriesResponse object\n    result = api.get_countries()\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_countries: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                // GetCountriesResponse class object\n                var result = apiInstance.GetCountries();\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getCountries: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            ' GetCountriesResponse class object\n            Dim result = apiInstance.GetCountries()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getCountries: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    // tm.GetCountriesResponse struct\n    result, _, err := client.TextMagicApi.GetCountries(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "Not supported yet."
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    # GetCountriesResponse object\n    result = api_instance.get_countries()\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_countries: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    # GetCountriesResponse object\n    my $result = $api_instance->get_countries();\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_countries: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Timezones%20and%20Countries/getCountries\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/user": {
      "get": {
        "operationId": "getCurrentUser",
        "summary": "Get current account information",
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    // User class object\n    $result = $api->getCurrentUser();\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getCurrentUser: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            // User class object\n            User obj = apiInstance.getCurrentUser();\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getCurrentUser\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.getCurrentUser().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    # User object\n    result = api.get_current_user()\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_current_user: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                // User class object\n                var result = apiInstance.GetCurrentUser();\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getCurrentUser: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            ' User class object\n            Dim result = apiInstance.GetCurrentUser()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getCurrentUser: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    // tm.User struct\n    result, _, err := client.TextMagicApi.GetCurrentUser(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task<std::shared_ptr<User>> result = api.getCurrentUser();\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getCurrentUser() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    # User object\n    result = api_instance.get_current_user()\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_current_user: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    # User object\n    my $result = $api_instance->get_current_user();\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_current_user: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Account/getCurrentUser\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "put": {
        "operationId": "updateCurrentUser",
        "summary": "Edit current account info",
        "parameters": [
          {
            "in": "body",
            "name": "UpdateCurrentUserInputObject",
            "required": true,
            "schema": {
              "properties": {
                "username": {
                  "type": "string",
                  "example": "Test"
                },
                "firstName": {
                  "type": "string",
                  "example": "Charles",
                  "description": "Account first name."
                },
                "lastName": {
                  "type": "string",
                  "example": "Conway",
                  "description": "Account last name."
                },
                "email": {
                  "type": "string",
                  "example": "charles@example.com"
                },
                "phone": {
                  "type": "string",
                  "example": 447860021130
                },
                "company": {
                  "type": "string",
                  "example": "Example Ltd.",
                  "description": "Account company name."
                },
                "timezone": {
                  "type": "integer",
                  "description": "The timezome internal ID. See [Get timezones](https://docs.textmagic.com/#operation/getTimezones).",
                  "example": 2
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Updated with success.",
            "schema": {
              "$ref": "#/definitions/UpdateCurrentUserResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateCurrentUserInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setUsername(\"Test\");\n$input->setFirstName(\"Charles\");\n$input->setLastName(\"Conway\");\n$input->setEmail(\"charles@example.com\");\n$input->setPhone(\"447860021130\");\n$input->setCompany(\"Example Ltd.\");\n$input->setTimezone(2);\n\ntry {\n    // UpdateCurrentUserResponse class object\n    $result = $api->updateCurrentUser($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateCurrentUser: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateCurrentUserInputObject input = new UpdateCurrentUserInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setUsername(\"Test\");\n        input.setFirstName(\"Charles\");\n        input.setLastName(\"Conway\");\n        input.setEmail(\"charles@example.com\");\n        input.setPhone(\"447860021130\");\n        input.setCompany(\"Example Ltd.\");\n        input.setTimezone(2);\n\n        try {\n            // UpdateCurrentUserResponse class object\n            UpdateCurrentUserResponse obj = apiInstance.updateCurrentUser(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateCurrentUser\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    username: \"Test\",\n    firstName: \"Charles\",\n    lastName: \"Conway\",\n    email: \"charles@example.com\",\n    phone: \"447860021130\",\n    company: \"Example Ltd.\",\n    timezone: 2,\n}\n\n\napi.updateCurrentUser(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateCurrentUserInputObject.new\n# Optional parameters, you can skip them\nobj.username = \"Test\"\nobj.first_name = \"Charles\"\nobj.last_name = \"Conway\"\nobj.email = \"charles@example.com\"\nobj.phone = \"447860021130\"\nobj.company = \"Example Ltd.\"\nobj.timezone = 2\n\nbegin\n    # UpdateCurrentUserResponse object\n    result = api.update_current_user(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_current_user: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateCurrentUserInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Username = \"Test\";\n            obj.FirstName = \"Charles\";\n            obj.LastName = \"Conway\";\n            obj.Email = \"charles@example.com\";\n            obj.Phone = \"447860021130\";\n            obj.Company = \"Example Ltd.\";\n            obj.Timezone = 2;\n\n            try {\n                // UpdateCurrentUserResponse class object\n                var result = apiInstance.UpdateCurrentUser(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateCurrentUser: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateCurrentUserInputObject With {\n            .Username = \"Test\",\n            .FirstName = \"Charles\",\n            .LastName = \"Conway\",\n            .Email = \"charles@example.com\",\n            .Phone = \"447860021130\",\n            .Company = \"Example Ltd.\",\n            .Timezone = 2\n        }\n\n        Try\n            ' UpdateCurrentUserResponse class object\n            Dim result = apiInstance.UpdateCurrentUser(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateCurrentUser: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Username: \"Test\",\n        FirstName: \"Charles\",\n        LastName: \"Conway\",\n        Email: \"charles@example.com\",\n        Phone: \"447860021130\",\n        Company: \"Example Ltd.\",\n        Timezone: 2,\n    }\n\n    // tm.UpdateCurrentUserResponse struct\n    result, _, err := client.TextMagicApi.UpdateCurrentUser(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateCurrentUserInputObject> input(new UpdateCurrentUserInputObject);\n    // Optional parameters, you can skip them\n    input->setUsername(\"Test\");\n    input->setFirstName(\"Charles\");\n    input->setLastName(\"Conway\");\n    input->setEmail(\"charles@example.com\");\n    input->setPhone(\"447860021130\");\n    input->setCompany(\"Example Ltd.\");\n    input->setTimezone(2);\n\n    try {\n        pplx::task<std::shared_ptr<UpdateCurrentUserResponse>> result = api.updateCurrentUser(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"updateCurrentUser() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateCurrentUserInputObject()\n# Optional parameters, you can skip them\ninput.username = \"Test\"\ninput.first_name = \"Charles\"\ninput.last_name = \"Conway\"\ninput.email = \"charles@example.com\"\ninput.phone = \"447860021130\"\ninput.company = \"Example Ltd.\"\ninput.timezone = 2\n\ntry:\n    # UpdateCurrentUserResponse object\n    result = api_instance.update_current_user(update_current_user_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_current_user: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateCurrentUserInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateCurrentUserInputObject->new(\n    # Optional parameters, you can skip them\n    username => 'Test',\n    firstName => 'Charles',\n    lastName => 'Conway',\n    email => 'charles@example.com',\n    phone => '447860021130',\n    company => 'Example Ltd.',\n    timezone => 2,\n);\n\neval {\n    # UpdateCurrentUserResponse object\n    my $result = $api_instance->update_current_user(update_current_user_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_current_user: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Account/updateCurrentUser\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/user/avatar": {
      "post": {
        "operationId": "uploadAvatar",
        "summary": "Upload an avatar",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "image",
            "in": "formData",
            "required": true,
            "description": "User avatar. Should be a PNG or JPG file not more than 10 MB.",
            "type": "file",
            "format": "binary"
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$image = new \\SplFileObject(\"test.jpg\");\n\ntry {\n    $api->uploadAvatar($image);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->uploadAvatar: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\nimport java.io.File;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // change to your file path\n        File image = new File(\"test.jpg\");\n\n        try {\n            apiInstance.uploadAvatar(image);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling uploadAvatar\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst fs = require('fs');\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n// change to your file path.\nconst image = new fs.ReadStream('filePath');\n\n\napi.uploadAvatar(image).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nimage = File.open('test.png', 'r')\n\nbegin\n    api.upload_avatar(image)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->upload_avatar: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // change to your file path\n            var image = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open);\n\n            try {\n                apiInstance.UploadAvatar(image);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling uploadAvatar: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' change to your file path\n        Dim image = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open)\n\n        Try\n            apiInstance.UploadAvatar(image)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling uploadAvatar: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\nSorry, file upload calls for Go SDK do not supported yet.\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::filebuf fb;\n    fb.open (\"test.jpg\", std::ios::in);\n    std::shared_ptr<std::istream> is(new std::istream(&fb));\n\n    std::shared_ptr<HttpContent> image(new HttpContent);\n    image->setName(\"test\");\n    image->setContentDisposition(\"attachment\");\n    image->setFileName(\"test.jpg\");\n\n    image->setContentType(\"image/jpeg\");\n    image->setData(is);\n\n    try {\n        pplx::task result = api.uploadAvatar(image);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"uploadAvatar() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# change to your file path\nimage = \"test.jpg\"\n\ntry:\n    api_instance.upload_avatar(image=image)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->upload_avatar: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# change to your file path\nmy $image = 'test.jpg';\n\neval {\n    $api_instance->upload_avatar(image => $image);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->upload_avatar: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Account/uploadAvatar\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteAvatar",
        "summary": "Delete an avatar",
        "produces": [],
        "responses": {
          "204": {
            "description": "Avatar deleted with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    $api->deleteAvatar();\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteAvatar: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            apiInstance.deleteAvatar();\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteAvatar\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.deleteAvatar().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    api.delete_avatar()\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_avatar: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                apiInstance.DeleteAvatar();\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteAvatar: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            apiInstance.DeleteAvatar()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteAvatar: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    client.TextMagicApi.DeleteAvatar(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task result = api.deleteAvatar();\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteAvatar() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    api_instance.delete_avatar()\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_avatar: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    $api_instance->delete_avatar();\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_avatar: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Account/deleteAvatar\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/user/disallowed-rules": {},
    "/api/v2/user/phone/verification": {},
    "/api/v2/user/email/verification": {},
    "/api/v2/user/password/change": {},
    "/api/v2/sources": {
      "get": {
        "operationId": "getAvailableSenderSettingOptions",
        "summary": "Get available sender settings",
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "The 2-letter ISO country ID. If not specified, it returns all the available sender settings.",
            "type": "string",
            "x-example": "US"
          }
        ],
        "responses": {
          "200": {
            "description": "Available sender setting options returned with success.",
            "schema": {
              "$ref": "#/definitions/GetAvailableSenderSettingOptionsResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Sender Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getAvailableSenderSettingOptions method below, default values will be used\n$country = \"US\";\n\ntry {\n    // GetAvailableSenderSettingOptionsResponse class object\n    $result = $api->getAvailableSenderSettingOptions($country);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getAvailableSenderSettingOptions: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getAvailableSenderSettingOptions method below, default values will be used\n        String country = \"US\";\n\n        try {\n            // GetAvailableSenderSettingOptionsResponse class object\n            GetAvailableSenderSettingOptionsResponse obj = apiInstance.getAvailableSenderSettingOptions(country);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getAvailableSenderSettingOptions\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    country: \"US\",\n};\n\napi.getAvailableSenderSettingOptions(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  country: 'US',\n}\n\nbegin\n    # GetAvailableSenderSettingOptionsResponse object\n    result = api.get_available_sender_setting_options(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_available_sender_setting_options: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getAvailableSenderSettingOptions method below, default values will be used\n            string country = \"US\";\n\n            try {\n                // GetAvailableSenderSettingOptionsResponse class object\n                var result = apiInstance.GetAvailableSenderSettingOptions(country);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getAvailableSenderSettingOptions: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getAvailableSenderSettingOptions method below, default values will be used\n        Dim country As String = \"US\"\n\n        Try\n            ' GetAvailableSenderSettingOptionsResponse class object\n            Dim result = apiInstance.GetAvailableSenderSettingOptions(country)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getAvailableSenderSettingOptions: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetAvailableSenderSettingOptionsOpts{\n        // Optional parameters\n        Country: optional.NewString(\"US\"),\n    }\n\n    // tm.GetAvailableSenderSettingOptionsResponse struct\n    result, _, err := client.TextMagicApi.GetAvailableSenderSettingOptions(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    std::string country = \"US\";\n\n    try {\n        pplx::task<std::shared_ptr<GetAvailableSenderSettingOptionsResponse>> result = api.getAvailableSenderSettingOptions(country);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getAvailableSenderSettingOptions() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\ncountry = \"US\"\n\ntry:\n    # GetAvailableSenderSettingOptionsResponse object\n    result = api_instance.get_available_sender_setting_options(country=country)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_available_sender_setting_options: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $country = 'US';\n\neval {\n    # GetAvailableSenderSettingOptionsResponse object\n    my $result = $api_instance->get_available_sender_setting_options(country => $country);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_available_sender_setting_options: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Overview/getAvailableSenderSettingOptions\" target=\"_blank\">Try in sandbox</a><br>Get all available sender setting options which can be used in the \"from\" parameter of the POST messages method."
      }
    },
    "/api/v2/sender/settings": {
      "put": {
        "summary": "Change sender settings",
        "operationId": "updateSenderSetting",
        "produces": [],
        "parameters": [
          {
            "name": "UpdateSenderSettingInputObject",
            "required": true,
            "in": "body",
            "schema": {
              "type": "object",
              "required": [
                "value",
                "country"
              ],
              "properties": {
                "value": {
                  "description": "Available phone number in international E.164 format or senderid.",
                  "type": "string",
                  "example": "447624800500"
                },
                "country": {
                  "description": "Country for which the setting will be set.",
                  "type": "string",
                  "example": "AF"
                },
                "chatId": {
                  "description": "Set sender setting for specified chat only.",
                  "type": "integer",
                  "example": 344
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Sender settings have been updated with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Sender Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateSenderSettingInputObject();\n\n// Required parameters\n$input->setValue(\"447624800500\");\n$input->setCountry(\"AF\");\n\n// Optional parameters, you can skip these setters calls\n$input->setChatId(344);\n\ntry {\n    $api->updateSenderSetting($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateSenderSetting: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateSenderSettingInputObject input = new UpdateSenderSettingInputObject();\n\n        // Required parameters\n        input.setValue(\"447624800500\");\n        input.setCountry(\"AF\");\n\n        // Optional parameters, you can skip these setters calls\n        input.setChatId(344);\n\n        try {\n            apiInstance.updateSenderSetting(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateSenderSetting\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    value: \"447624800500\",\n    country: \"AF\",\n    // Optional parameters\n    chatId: 344,\n}\n\n\napi.updateSenderSetting(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateSenderSettingInputObject.new\n\n# Required parameters\nobj.value = \"447624800500\"\nobj.country = \"AF\"\n# Optional parameters, you can skip them\nobj.chat_id = 344\n\nbegin\n    api.update_sender_setting(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_sender_setting: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateSenderSettingInputObject();\n\n            // Required parameters\n            obj.Value = \"447624800500\";\n            obj.Country = \"AF\";\n\n            // Optional parameters, you can skip these setters calls\n            obj.ChatId = 344;\n\n            try {\n                apiInstance.UpdateSenderSetting(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateSenderSetting: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateSenderSettingInputObject With {\n            .Value = \"447624800500\",\n            .Country = \"AF\",\n            .ChatId = 344\n        }\n\n        Try\n            apiInstance.UpdateSenderSetting(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateSenderSetting: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Value: \"447624800500\",\n        Country: \"AF\",\n        // Optional parameters, you can skip them\n        ChatId: 344,\n    }\n\n    client.TextMagicApi.UpdateSenderSetting(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateSenderSettingInputObject> input(new UpdateSenderSettingInputObject);\n    // Required parameters\n    input->setValue(\"447624800500\");\n    input->setCountry(\"AF\");\n    // Optional parameters, you can skip them\n    input->setChatId(344);\n\n    try {\n        pplx::task result = api.updateSenderSetting(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"updateSenderSetting() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateSenderSettingInputObject()\n\n# Required parameters\ninput.value = \"447624800500\"\ninput.country = \"AF\"\n# Optional parameters, you can skip them\ninput.chat_id = 344\n\ntry:\n    api_instance.update_sender_setting(update_sender_setting_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_sender_setting: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateSenderSettingInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateSenderSettingInputObject->new(\n    # Required parameters\n    value => '447624800500',\n    country => 'AF',\n    # Optional parameters, you can skip them\n    chatId => 344,\n);\n\neval {\n    $api_instance->update_sender_setting(update_sender_setting_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_sender_setting: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Overview/updateSenderSetting\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/sender/settings/normalized": {
      "get": {
        "operationId": "getSenderSettings",
        "summary": "Get current sender settings",
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "Return sender settings enabled for sending to a specified country. Should be 2 upper-case characters.",
            "type": "string",
            "x-example": "US"
          }
        ],
        "responses": {
          "200": {
            "description": "Sender settings returned with success.",
            "schema": {
              "$ref": "#/definitions/GetSenderSettingsResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Sender Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getSenderSettings method below, default values will be used\n$country = \"US\";\n\ntry {\n    // GetSenderSettingsResponse class object\n    $result = $api->getSenderSettings($country);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getSenderSettings: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getSenderSettings method below, default values will be used\n        String country = \"US\";\n\n        try {\n            // GetSenderSettingsResponse class object\n            GetSenderSettingsResponse obj = apiInstance.getSenderSettings(country);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getSenderSettings\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    country: \"US\",\n};\n\napi.getSenderSettings(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  country: 'US',\n}\n\nbegin\n    # GetSenderSettingsResponse object\n    result = api.get_sender_settings(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_sender_settings: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getSenderSettings method below, default values will be used\n            string country = \"US\";\n\n            try {\n                // GetSenderSettingsResponse class object\n                var result = apiInstance.GetSenderSettings(country);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getSenderSettings: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getSenderSettings method below, default values will be used\n        Dim country As String = \"US\"\n\n        Try\n            ' GetSenderSettingsResponse class object\n            Dim result = apiInstance.GetSenderSettings(country)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getSenderSettings: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetSenderSettingsOpts{\n        // Optional parameters\n        Country: optional.NewString(\"US\"),\n    }\n\n    // tm.GetSenderSettingsResponse struct\n    result, _, err := client.TextMagicApi.GetSenderSettings(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    std::string country = \"US\";\n\n    try {\n        pplx::task<std::shared_ptr<GetSenderSettingsResponse>> result = api.getSenderSettings(country);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getSenderSettings() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\ncountry = \"US\"\n\ntry:\n    # GetSenderSettingsResponse object\n    result = api_instance.get_sender_settings(country=country)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_sender_settings: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $country = 'US';\n\neval {\n    # GetSenderSettingsResponse object\n    my $result = $api_instance->get_sender_settings(country => $country);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_sender_settings: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Overview/getSenderSettings\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/numbers/available": {
      "get": {
        "operationId": "getAvailableDedicatedNumbers",
        "summary": "Find dedicated numbers available for purchase",
        "parameters": [
          {
            "name": "prefix",
            "in": "query",
            "description": "Desired number prefix. Should include the country code (i.e. 447 for UK phone number format). Leave blank to get all the available numbers for the specified country.",
            "type": "integer",
            "x-example": 447155
          },
          {
            "name": "tollfree",
            "in": "query",
            "description": "Should we show only tollfree numbers (tollfree available only for US).",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "country",
            "in": "query",
            "required": true,
            "description": "The 2-letter dedicated number country ISO code.",
            "type": "string",
            "x-example": "GB"
          }
        ],
        "tags": [
          "Numbers"
        ],
        "responses": {
          "200": {
            "description": "The list of available to buy dedicated numbers.",
            "schema": {
              "$ref": "#/definitions/GetAvailableDedicatedNumbersResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$country = \"GB\";\n// Optional, you can pass them as null values to getAvailableDedicatedNumbers method below, default values will be used\n$prefix = 447155;\n$tollfree = 0;\n\ntry {\n    // GetAvailableDedicatedNumbersResponse class object\n    $result = $api->getAvailableDedicatedNumbers($country, $prefix, $tollfree);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getAvailableDedicatedNumbers: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        String country = \"GB\";\n        // Optional, you can pass them as null values to getAvailableDedicatedNumbers method below, default values will be used\n        int prefix = 447155;\n        int tollfree = 0;\n\n        try {\n            // GetAvailableDedicatedNumbersResponse class object\n            GetAvailableDedicatedNumbersResponse obj = apiInstance.getAvailableDedicatedNumbers(country, prefix, tollfree);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getAvailableDedicatedNumbers\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst country = \"GB\";\n\n// Optional parameters\nconst opts = {\n    prefix: 447155,\n    tollfree: 0,\n};\n\napi.getAvailableDedicatedNumbers(country, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  country: 'GB',\n  # Optional parameters\n  prefix: 447155,\n  tollfree: 0,\n}\n\nbegin\n    # GetAvailableDedicatedNumbersResponse object\n    result = api.get_available_dedicated_numbers(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_available_dedicated_numbers: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            string country = \"GB\";\n            // Optional, you can pass them as null values to getAvailableDedicatedNumbers method below, default values will be used\n            int prefix = 447155;\n            int tollfree = 0;\n\n            try {\n                // GetAvailableDedicatedNumbersResponse class object\n                var result = apiInstance.GetAvailableDedicatedNumbers(country, prefix, tollfree);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getAvailableDedicatedNumbers: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim country As String = \"GB\"\n        ' Optional, you can pass them as null values to getAvailableDedicatedNumbers method below, default values will be used\n        Dim prefix As Integer = 447155\n        Dim tollfree As Integer = 0\n\n        Try\n            ' GetAvailableDedicatedNumbersResponse class object\n            Dim result = apiInstance.GetAvailableDedicatedNumbers(country, prefix, tollfree)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getAvailableDedicatedNumbers: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetAvailableDedicatedNumbersOpts{\n        // Required parameters\n        Country: \"GB\",\n        // Optional parameters\n        Prefix: optional.NewInt32(447155),\n        Tollfree: optional.NewInt32(0),\n    }\n\n    // tm.GetAvailableDedicatedNumbersResponse struct\n    result, _, err := client.TextMagicApi.GetAvailableDedicatedNumbers(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::string country = \"GB\";\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int prefix = 447155;\n    int tollfree = 0;\n\n    try {\n        pplx::task<std::shared_ptr<GetAvailableDedicatedNumbersResponse>> result = api.getAvailableDedicatedNumbers(country, prefix, tollfree);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getAvailableDedicatedNumbers() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ncountry = \"GB\"\n# Optional params, you can skip them\nprefix = 447155\ntollfree = 0\n\ntry:\n    # GetAvailableDedicatedNumbersResponse object\n    result = api_instance.get_available_dedicated_numbers(country=country, prefix=prefix, tollfree=tollfree)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_available_dedicated_numbers: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $country = 'GB';\n# Optional params, you can skip them\nmy $prefix = 447155;\nmy $tollfree = 0;\n\neval {\n    # GetAvailableDedicatedNumbersResponse object\n    my $result = $api_instance->get_available_dedicated_numbers(country => $country, prefix => $prefix, tollfree => $tollfree);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_available_dedicated_numbers: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/getAvailableDedicatedNumbers\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/numbers": {
      "get": {
        "summary": "Get all your dedicated numbers",
        "operationId": "getUserDedicatedNumbers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "surveyId",
            "in": "query",
            "required": false,
            "description": "Fetch only those numbers that are ready for the survey.",
            "type": "integer"
          }
        ],
        "responses": {
          "200": {
            "description": "Requested data returned with success.",
            "schema": {
              "$ref": "#/definitions/GetUserDedicatedNumbersPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Numbers"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getUserDedicatedNumbers method below, default values will be used\n$page = 1;\n$limit = 10;\n$surveyId = 1;\n\ntry {\n    // GetUserDedicatedNumbersPaginatedResponse class object\n    $result = $api->getUserDedicatedNumbers($page, $limit, $surveyId);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getUserDedicatedNumbers: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getUserDedicatedNumbers method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        int surveyId = 1;\n\n        try {\n            // GetUserDedicatedNumbersPaginatedResponse class object\n            GetUserDedicatedNumbersPaginatedResponse obj = apiInstance.getUserDedicatedNumbers(page, limit, surveyId);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getUserDedicatedNumbers\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    surveyId: 1,\n};\n\napi.getUserDedicatedNumbers(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  survey_id: 1,\n}\n\nbegin\n    # GetUserDedicatedNumbersPaginatedResponse object\n    result = api.get_user_dedicated_numbers(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_user_dedicated_numbers: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getUserDedicatedNumbers method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            int surveyId = 1;\n\n            try {\n                // GetUserDedicatedNumbersPaginatedResponse class object\n                var result = apiInstance.GetUserDedicatedNumbers(page, limit, surveyId);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getUserDedicatedNumbers: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getUserDedicatedNumbers method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim surveyId As Integer = 1\n\n        Try\n            ' GetUserDedicatedNumbersPaginatedResponse class object\n            Dim result = apiInstance.GetUserDedicatedNumbers(page, limit, surveyId)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getUserDedicatedNumbers: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetUserDedicatedNumbersOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        SurveyId: optional.NewInt32(1),\n    }\n\n    // tm.GetUserDedicatedNumbersPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetUserDedicatedNumbers(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    int surveyId = 1;\n\n    try {\n        pplx::task<std::shared_ptr<GetUserDedicatedNumbersPaginatedResponse>> result = api.getUserDedicatedNumbers(page, limit, surveyId);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getUserDedicatedNumbers() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nsurvey_id = 1\n\ntry:\n    # GetUserDedicatedNumbersPaginatedResponse object\n    result = api_instance.get_user_dedicated_numbers(page=page, limit=limit, survey_id=survey_id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_user_dedicated_numbers: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $surveyId = 1;\n\neval {\n    # GetUserDedicatedNumbersPaginatedResponse object\n    my $result = $api_instance->get_user_dedicated_numbers(page => $page, limit => $limit, surveyId => $surveyId);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_user_dedicated_numbers: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/getUserDedicatedNumbers\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "post": {
        "operationId": "buyDedicatedNumber",
        "summary": "Buy a dedicated number",
        "parameters": [
          {
            "name": "BuyDedicatedNumberInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "phone",
                "country",
                "userId"
              ],
              "additionalProperties": false,
              "properties": {
                "phone": {
                  "description": "Dedicated phone number.",
                  "type": "string",
                  "example": "447860021130"
                },
                "country": {
                  "description": "Country code phone number.",
                  "type": "string",
                  "example": "AU"
                },
                "userId": {
                  "description": "Assigned dedicated number. This number will be available for this account only. You cannot transfer numbers between sub-accounts.\n",
                  "type": "integer",
                  "example": 5501
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Number has been bought with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Numbers"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new BuyDedicatedNumberInputObject();\n\n// Required parameters\n$input->setPhone(\"447860021130\");\n$input->setCountry(\"AU\");\n$input->setUserId(5501);\n\ntry {\n    $api->buyDedicatedNumber($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->buyDedicatedNumber: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        BuyDedicatedNumberInputObject input = new BuyDedicatedNumberInputObject();\n\n        // Required parameters\n        input.setPhone(\"447860021130\");\n        input.setCountry(\"AU\");\n        input.setUserId(5501);\n\n        try {\n            apiInstance.buyDedicatedNumber(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling buyDedicatedNumber\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    phone: \"447860021130\",\n    country: \"AU\",\n    userId: 5501,\n}\n\n\napi.buyDedicatedNumber(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::BuyDedicatedNumberInputObject.new\n\n# Required parameters\nobj.phone = \"447860021130\"\nobj.country = \"AU\"\nobj.user_id = 5501\n\nbegin\n    api.buy_dedicated_number(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->buy_dedicated_number: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new BuyDedicatedNumberInputObject();\n\n            // Required parameters\n            obj.Phone = \"447860021130\";\n            obj.Country = \"AU\";\n            obj.UserId = 5501;\n\n            try {\n                apiInstance.BuyDedicatedNumber(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling buyDedicatedNumber: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New BuyDedicatedNumberInputObject With {\n            .Phone = \"447860021130\",\n            .Country = \"AU\",\n            .UserId = 5501\n        }\n\n        Try\n            apiInstance.BuyDedicatedNumber(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling buyDedicatedNumber: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Phone: \"447860021130\",\n        Country: \"AU\",\n        UserId: 5501,\n    }\n\n    client.TextMagicApi.BuyDedicatedNumber(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<BuyDedicatedNumberInputObject> input(new BuyDedicatedNumberInputObject);\n    // Required parameters\n    input->setPhone(\"447860021130\");\n    input->setCountry(\"AU\");\n    input->setUserId(5501);\n\n    try {\n        pplx::task result = api.buyDedicatedNumber(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"buyDedicatedNumber() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.BuyDedicatedNumberInputObject()\n\n# Required parameters\ninput.phone = \"447860021130\"\ninput.country = \"AU\"\ninput.user_id = 5501\n\ntry:\n    api_instance.buy_dedicated_number(buy_dedicated_number_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->buy_dedicated_number: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::BuyDedicatedNumberInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::BuyDedicatedNumberInputObject->new(\n    # Required parameters\n    phone => '447860021130',\n    country => 'AU',\n    userId => 5501,\n);\n\neval {\n    $api_instance->buy_dedicated_number(buy_dedicated_number_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->buy_dedicated_number: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/buyDedicatedNumber\" target=\"_blank\">Try in sandbox</a><br>To buy a dedicated number, you first need to find an available number matching your criteria using the `/api/v2/numbers/available` command described above."
      }
    },
    "/api/v2/numbers/{id}": {
      "get": {
        "operationId": "getDedicatedNumber",
        "summary": "Get the details of a specific dedicated number",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Requested dedicated number data returned with success.",
            "schema": {
              "$ref": "#/definitions/UsersInbound"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Numbers"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // UsersInbound class object\n    $result = $api->getDedicatedNumber($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getDedicatedNumber: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // UsersInbound class object\n            UsersInbound obj = apiInstance.getDedicatedNumber(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getDedicatedNumber\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getDedicatedNumber(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # UsersInbound object\n    result = api.get_dedicated_number(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_dedicated_number: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // UsersInbound class object\n                var result = apiInstance.GetDedicatedNumber(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getDedicatedNumber: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' UsersInbound class object\n            Dim result = apiInstance.GetDedicatedNumber(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getDedicatedNumber: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.UsersInbound struct\n    result, _, err := client.TextMagicApi.GetDedicatedNumber(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<UsersInbound>> result = api.getDedicatedNumber(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getDedicatedNumber() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # UsersInbound object\n    result = api_instance.get_dedicated_number(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_dedicated_number: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # UsersInbound object\n    my $result = $api_instance->get_dedicated_number(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_dedicated_number: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/getDedicatedNumber\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteDedicatedNumber",
        "summary": "Cancel a dedicated number subscription",
        "produces": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "The Dedicated number has been deleted with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Numbers"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteDedicatedNumber($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteDedicatedNumber: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteDedicatedNumber(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteDedicatedNumber\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteDedicatedNumber(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_dedicated_number(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_dedicated_number: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteDedicatedNumber(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteDedicatedNumber: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteDedicatedNumber(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteDedicatedNumber: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteDedicatedNumber(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteDedicatedNumber(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteDedicatedNumber() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_dedicated_number(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_dedicated_number: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_dedicated_number(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_dedicated_number: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/deleteDedicatedNumber\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/senderids": {
      "get": {
        "operationId": "getSenderIds",
        "summary": "Get all your approved Sender IDs",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Sender IDs of the current user returned with success.",
            "schema": {
              "$ref": "#/definitions/GetSenderIdsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Sender IDs"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getSenderIds method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // GetSenderIdsPaginatedResponse class object\n    $result = $api->getSenderIds($page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getSenderIds: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getSenderIds method below, default values will be used\n        int page = 1;\n        int limit = 10;\n\n        try {\n            // GetSenderIdsPaginatedResponse class object\n            GetSenderIdsPaginatedResponse obj = apiInstance.getSenderIds(page, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getSenderIds\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getSenderIds(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # GetSenderIdsPaginatedResponse object\n    result = api.get_sender_ids(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_sender_ids: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getSenderIds method below, default values will be used\n            int page = 1;\n            int limit = 10;\n\n            try {\n                // GetSenderIdsPaginatedResponse class object\n                var result = apiInstance.GetSenderIds(page, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getSenderIds: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getSenderIds method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' GetSenderIdsPaginatedResponse class object\n            Dim result = apiInstance.GetSenderIds(page, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getSenderIds: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetSenderIdsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.GetSenderIdsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetSenderIds(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<GetSenderIdsPaginatedResponse>> result = api.getSenderIds(page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getSenderIds() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # GetSenderIdsPaginatedResponse object\n    result = api_instance.get_sender_ids(page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_sender_ids: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # GetSenderIdsPaginatedResponse object\n    my $result = $api_instance->get_sender_ids(page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_sender_ids: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sender%20IDs/getSenderIds\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "post": {
        "operationId": "requestSenderId",
        "summary": "Apply for a new Sender ID",
        "parameters": [
          {
            "name": "RequestSenderIdInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "senderId",
                "explanation"
              ],
              "properties": {
                "senderId": {
                  "type": "string",
                  "description": "The Sender ID that you are applying for.\n*   11 characters maximum;\n*   Only Latin based characters and digits are allowed;\n*   Should contain at least 1 letter.\n",
                  "example": "HotRod"
                },
                "explanation": {
                  "type": "string",
                  "description": "Explanation of why you need this Sender ID.",
                  "example": "Because it equals to my company name."
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Sender ID request has been created with success.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Sender IDs"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new RequestSenderIdInputObject();\n\n// Required parameters\n$input->setSenderId(\"HotRod\");\n$input->setExplanation(\"Because it equals to my company name.\");\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->requestSenderId($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->requestSenderId: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        RequestSenderIdInputObject input = new RequestSenderIdInputObject();\n\n        // Required parameters\n        input.setSenderId(\"HotRod\");\n        input.setExplanation(\"Because it equals to my company name.\");\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.requestSenderId(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling requestSenderId\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    senderId: \"HotRod\",\n    explanation: \"Because it equals to my company name.\",\n}\n\n\napi.requestSenderId(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::RequestSenderIdInputObject.new\n\n# Required parameters\nobj.sender_id = \"HotRod\"\nobj.explanation = \"Because it equals to my company name.\"\n\nbegin\n    # ResourceLinkResponse object\n    result = api.request_sender_id(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->request_sender_id: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new RequestSenderIdInputObject();\n\n            // Required parameters\n            obj.SenderId = \"HotRod\";\n            obj.Explanation = \"Because it equals to my company name.\";\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.RequestSenderId(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling requestSenderId: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New RequestSenderIdInputObject With {\n            .SenderId = \"HotRod\",\n            .Explanation = \"Because it equals to my company name.\"\n        }\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.RequestSenderId(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling requestSenderId: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        SenderId: \"HotRod\",\n        Explanation: \"Because it equals to my company name.\",\n    }\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.RequestSenderId(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<RequestSenderIdInputObject> input(new RequestSenderIdInputObject);\n    // Required parameters\n    input->setSenderId(\"HotRod\");\n    input->setExplanation(\"Because it equals to my company name.\");\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.requestSenderId(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"requestSenderId() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.RequestSenderIdInputObject()\n\n# Required parameters\ninput.sender_id = \"HotRod\"\ninput.explanation = \"Because it equals to my company name.\"\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.request_sender_id(request_sender_id_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->request_sender_id: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::RequestSenderIdInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::RequestSenderIdInputObject->new(\n    # Required parameters\n    senderId => 'HotRod',\n    explanation => 'Because it equals to my company name.',\n);\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->request_sender_id(request_sender_id_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->request_sender_id: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sender%20IDs/requestSenderId\" target=\"_blank\">Try in sandbox</a><br>> Sender IDs are shared among all of your sub-accounts."
      }
    },
    "/api/v2/senderids/{id}": {
      "get": {
        "operationId": "getSenderId",
        "summary": "Get the details of a specific Sender ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Sender ID data returned with success.",
            "schema": {
              "$ref": "#/definitions/SenderId"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Sender IDs"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // SenderId class object\n    $result = $api->getSenderId($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getSenderId: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // SenderId class object\n            SenderId obj = apiInstance.getSenderId(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getSenderId\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getSenderId(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # SenderId object\n    result = api.get_sender_id(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_sender_id: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // SenderId class object\n                var result = apiInstance.GetSenderId(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getSenderId: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' SenderId class object\n            Dim result = apiInstance.GetSenderId(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getSenderId: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.SenderId struct\n    result, _, err := client.TextMagicApi.GetSenderId(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<SenderId>> result = api.getSenderId(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getSenderId() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # SenderId object\n    result = api_instance.get_sender_id(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_sender_id: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # SenderId object\n    my $result = $api_instance->get_sender_id(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_sender_id: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sender%20IDs/getSenderId\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteSenderId",
        "summary": "Delete a Sender ID",
        "produces": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Successful delete chat."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Sender IDs"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteSenderId($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteSenderId: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteSenderId(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteSenderId\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteSenderId(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_sender_id(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_sender_id: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteSenderId(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteSenderId: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteSenderId(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteSenderId: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteSenderId(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteSenderId(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteSenderId() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_sender_id(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_sender_id: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_sender_id(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_sender_id: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sender%20IDs/deleteSenderId\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/subaccounts": {
      "get": {
        "operationId": "getSubaccounts",
        "summary": "Get a sub-accounts list",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Sub-accounts data returned with success.",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when the current user is not allowed to manage sub-accounts."
          }
        },
        "x-internal": true,
        "tags": [
          "User Subaccounts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getSubaccounts method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // User class object\n    $result = $api->getSubaccounts($page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getSubaccounts: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getSubaccounts method below, default values will be used\n        int page = 1;\n        int limit = 10;\n\n        try {\n            // User class object\n            User obj = apiInstance.getSubaccounts(page, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getSubaccounts\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getSubaccounts(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # User object\n    result = api.get_subaccounts(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_subaccounts: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getSubaccounts method below, default values will be used\n            int page = 1;\n            int limit = 10;\n\n            try {\n                // User class object\n                var result = apiInstance.GetSubaccounts(page, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getSubaccounts: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getSubaccounts method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' User class object\n            Dim result = apiInstance.GetSubaccounts(page, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getSubaccounts: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetSubaccountsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.User struct\n    result, _, err := client.TextMagicApi.GetSubaccounts(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<User>> result = api.getSubaccounts(page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getSubaccounts() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # User object\n    result = api_instance.get_subaccounts(page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_subaccounts: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # User object\n    my $result = $api_instance->get_subaccounts(page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_subaccounts: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sub-Accounts/getSubaccounts\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "post": {
        "operationId": "inviteSubaccount",
        "summary": "Invite a new sub-account",
        "produces": [],
        "parameters": [
          {
            "name": "InviteSubaccountInputObject",
            "required": true,
            "in": "body",
            "schema": {
              "required": [
                "email",
                "role"
              ],
              "properties": {
                "email": {
                  "type": "string",
                  "format": "email",
                  "description": "The invitation email will be sent to this email address.",
                  "example": "john@example.com"
                },
                "role": {
                  "type": "string",
                  "description": "Type of account:\n*   **A** for Administrator sub-account;\n*   **U** for Regular User.\n",
                  "enum": [
                    "A",
                    "U"
                  ],
                  "example": "U"
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "x-internal": true,
        "tags": [
          "User Subaccounts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new InviteSubaccountInputObject();\n\n// Required parameters\n$input->setEmail(\"john@example.com\");\n$input->setRole(\"U\");\n\ntry {\n    $api->inviteSubaccount($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->inviteSubaccount: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        InviteSubaccountInputObject input = new InviteSubaccountInputObject();\n\n        // Required parameters\n        input.setEmail(\"john@example.com\");\n        input.setRole(\"U\");\n\n        try {\n            apiInstance.inviteSubaccount(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling inviteSubaccount\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    email: \"john@example.com\",\n    role: \"U\",\n}\n\n\napi.inviteSubaccount(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::InviteSubaccountInputObject.new\n\n# Required parameters\nobj.email = \"john@example.com\"\nobj.role = \"U\"\n\nbegin\n    api.invite_subaccount(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->invite_subaccount: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new InviteSubaccountInputObject();\n\n            // Required parameters\n            obj.Email = \"john@example.com\";\n            obj.Role = \"U\";\n\n            try {\n                apiInstance.InviteSubaccount(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling inviteSubaccount: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New InviteSubaccountInputObject With {\n            .Email = \"john@example.com\",\n            .Role = \"U\"\n        }\n\n        Try\n            apiInstance.InviteSubaccount(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling inviteSubaccount: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Email: \"john@example.com\",\n        Role: \"U\",\n    }\n\n    client.TextMagicApi.InviteSubaccount(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<InviteSubaccountInputObject> input(new InviteSubaccountInputObject);\n    // Required parameters\n    input->setEmail(\"john@example.com\");\n    input->setRole(\"U\");\n\n    try {\n        pplx::task result = api.inviteSubaccount(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"inviteSubaccount() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.InviteSubaccountInputObject()\n\n# Required parameters\ninput.email = \"john@example.com\"\ninput.role = \"U\"\n\ntry:\n    api_instance.invite_subaccount(invite_subaccount_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->invite_subaccount: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::InviteSubaccountInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::InviteSubaccountInputObject->new(\n    # Required parameters\n    email => 'john@example.com',\n    role => 'U',\n);\n\neval {\n    $api_instance->invite_subaccount(invite_subaccount_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->invite_subaccount: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sub-Accounts/inviteSubaccount\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/subaccounts/{id}": {
      "get": {
        "operationId": "getSubaccount",
        "summary": "Get sub-account information",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Sub-account data returned with success.",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when the current user is not allowed to manage sub-accounts."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "x-internal": true,
        "tags": [
          "User Subaccounts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // User class object\n    $result = $api->getSubaccount($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getSubaccount: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // User class object\n            User obj = apiInstance.getSubaccount(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getSubaccount\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getSubaccount(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # User object\n    result = api.get_subaccount(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_subaccount: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // User class object\n                var result = apiInstance.GetSubaccount(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getSubaccount: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' User class object\n            Dim result = apiInstance.GetSubaccount(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getSubaccount: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.User struct\n    result, _, err := client.TextMagicApi.GetSubaccount(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<User>> result = api.getSubaccount(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getSubaccount() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # User object\n    result = api_instance.get_subaccount(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_subaccount: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # User object\n    my $result = $api_instance->get_subaccount(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_subaccount: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sub-Accounts/getSubaccount\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "closeSubaccount",
        "produces": [],
        "summary": "Close sub-account",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when the current user is not allowed to manage sub-accounts."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "x-internal": true,
        "tags": [
          "User Subaccounts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->closeSubaccount($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->closeSubaccount: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.closeSubaccount(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling closeSubaccount\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.closeSubaccount(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.close_subaccount(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->close_subaccount: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.CloseSubaccount(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling closeSubaccount: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.CloseSubaccount(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling closeSubaccount: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.CloseSubaccount(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.closeSubaccount(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"closeSubaccount() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.close_subaccount(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->close_subaccount: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->close_subaccount(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->close_subaccount: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sub-Accounts/closeSubaccount\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/subaccounts/tokens": {
      "post": {
        "operationId": "requestNewSubaccountToken",
        "summary": "Request a new REST API token for sub-account",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sub-Accounts/requestNewSubaccountToken\" target=\"_blank\">Try in sandbox</a><br>Returning user object, key and app name.",
        "parameters": [
          {
            "name": "RequestNewSubaccountTokenInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "userId",
                "password"
              ],
              "properties": {
                "userId": {
                  "type": "integer",
                  "example": 1,
                  "description": "Sub-account ID."
                },
                "password": {
                  "type": "string",
                  "example": "strongPassword",
                  "description": "Your account password."
                },
                "appName": {
                  "type": "string",
                  "example": "sample app",
                  "description": "Application name."
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Created Sub-account data returned with success.",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when the user does not have rights to perform this action."
          }
        },
        "x-internal": true,
        "tags": [
          "User Subaccounts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new RequestNewSubaccountTokenInputObject();\n\n// Required parameters\n$input->setUserId(1);\n$input->setPassword(\"strongPassword\");\n\n// Optional parameters, you can skip these setters calls\n$input->setAppName(\"sample app\");\n\ntry {\n    // User class object\n    $result = $api->requestNewSubaccountToken($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->requestNewSubaccountToken: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        RequestNewSubaccountTokenInputObject input = new RequestNewSubaccountTokenInputObject();\n\n        // Required parameters\n        input.setUserId(1);\n        input.setPassword(\"strongPassword\");\n\n        // Optional parameters, you can skip these setters calls\n        input.setAppName(\"sample app\");\n\n        try {\n            // User class object\n            User obj = apiInstance.requestNewSubaccountToken(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling requestNewSubaccountToken\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    userId: 1,\n    password: \"strongPassword\",\n    // Optional parameters\n    appName: \"sample app\",\n}\n\n\napi.requestNewSubaccountToken(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::RequestNewSubaccountTokenInputObject.new\n\n# Required parameters\nobj.user_id = 1\nobj.password = \"strongPassword\"\n# Optional parameters, you can skip them\nobj.app_name = \"sample app\"\n\nbegin\n    # User object\n    result = api.request_new_subaccount_token(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->request_new_subaccount_token: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new RequestNewSubaccountTokenInputObject();\n\n            // Required parameters\n            obj.UserId = 1;\n            obj.Password = \"strongPassword\";\n\n            // Optional parameters, you can skip these setters calls\n            obj.AppName = \"sample app\";\n\n            try {\n                // User class object\n                var result = apiInstance.RequestNewSubaccountToken(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling requestNewSubaccountToken: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New RequestNewSubaccountTokenInputObject With {\n            .UserId = 1,\n            .Password = \"strongPassword\",\n            .AppName = \"sample app\"\n        }\n\n        Try\n            ' User class object\n            Dim result = apiInstance.RequestNewSubaccountToken(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling requestNewSubaccountToken: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        UserId: 1,\n        Password: \"strongPassword\",\n        // Optional parameters, you can skip them\n        AppName: \"sample app\",\n    }\n\n    // tm.User struct\n    result, _, err := client.TextMagicApi.RequestNewSubaccountToken(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<RequestNewSubaccountTokenInputObject> input(new RequestNewSubaccountTokenInputObject);\n    // Required parameters\n    input->setUserId(1);\n    input->setPassword(\"strongPassword\");\n    // Optional parameters, you can skip them\n    input->setAppName(\"sample app\");\n\n    try {\n        pplx::task<std::shared_ptr<User>> result = api.requestNewSubaccountToken(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"requestNewSubaccountToken() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.RequestNewSubaccountTokenInputObject()\n\n# Required parameters\ninput.user_id = 1\ninput.password = \"strongPassword\"\n# Optional parameters, you can skip them\ninput.app_name = \"sample app\"\n\ntry:\n    # User object\n    result = api_instance.request_new_subaccount_token(request_new_subaccount_token_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->request_new_subaccount_token: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::RequestNewSubaccountTokenInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::RequestNewSubaccountTokenInputObject->new(\n    # Required parameters\n    userId => 1,\n    password => 'strongPassword',\n    # Optional parameters, you can skip them\n    appName => 'sample app',\n);\n\neval {\n    # User object\n    my $result = $api_instance->request_new_subaccount_token(request_new_subaccount_token_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->request_new_subaccount_token: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/subaccounts/tokens/list": {
      "post": {
        "operationId": "getSubaccountsWithTokens",
        "summary": "Get all sub-accounts with their REST API tokens associated with a specified app name",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sub-Accounts/getSubaccountsWithTokens\" target=\"_blank\">Try in sandbox</a><br>Get all sub-accounts with their REST API tokens associated with specified app name. When more than one token related to app name, last key will be returned.",
        "parameters": [
          {
            "name": "GetSubaccountsWithTokensInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "appName",
                "password"
              ],
              "properties": {
                "appName": {
                  "description": "Application name.",
                  "type": "string",
                  "example": "sample app"
                },
                "password": {
                  "description": "Your account password.",
                  "type": "string",
                  "example": "strongPassword"
                }
              }
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "number",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetSubaccountsWithTokensResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when user has no enough rights to perform this action."
          }
        },
        "x-internal": true,
        "tags": [
          "User Subaccounts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new GetSubaccountsWithTokensInputObject();\n\n// Required parameters\n$input->setAppName(\"sample app\");\n$input->setPassword(\"strongPassword\");\n// Optional, you can pass them as null values to getSubaccountsWithTokens method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // GetSubaccountsWithTokensResponse class object\n    $result = $api->getSubaccountsWithTokens($input$page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getSubaccountsWithTokens: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        GetSubaccountsWithTokensInputObject input = new GetSubaccountsWithTokensInputObject();\n\n        // Required parameters\n        input.setAppName(\"sample app\");\n        input.setPassword(\"strongPassword\");\n        // Optional, you can pass them as null values to getSubaccountsWithTokens method below, default values will be used\n         page = 1;\n        int limit = 10;\n\n        try {\n            // GetSubaccountsWithTokensResponse class object\n            GetSubaccountsWithTokensResponse obj = apiInstance.getSubaccountsWithTokens(inputpage, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getSubaccountsWithTokens\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    appName: \"sample app\",\n    password: \"strongPassword\",\n}\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getSubaccountsWithTokens(input, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::GetSubaccountsWithTokensInputObject.new\n\n# Required parameters\nobj.app_name = \"sample app\"\nobj.password = \"strongPassword\"\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # GetSubaccountsWithTokensResponse object\n    result = api.get_subaccounts_with_tokens(input, params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_subaccounts_with_tokens: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new GetSubaccountsWithTokensInputObject();\n\n            // Required parameters\n            obj.AppName = \"sample app\";\n            obj.Password = \"strongPassword\";\n            // Optional, you can pass them as null values to getSubaccountsWithTokens method below, default values will be used\n             page = 1;\n            int limit = 10;\n\n            try {\n                // GetSubaccountsWithTokensResponse class object\n                var result = apiInstance.GetSubaccountsWithTokens(objpage, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getSubaccountsWithTokens: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New GetSubaccountsWithTokensInputObject With {\n            .AppName = \"sample app\",\n            .Password = \"strongPassword\"\n        }\n        ' Optional, you can pass them as null values to getSubaccountsWithTokens method below, default values will be used\n        Dim page As  = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' GetSubaccountsWithTokensResponse class object\n            Dim result = apiInstance.GetSubaccountsWithTokens(objpage, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getSubaccountsWithTokens: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        AppName: \"sample app\",\n        Password: \"strongPassword\",\n    }\n\n    opts := tm.GetSubaccountsWithTokensOpts{\n        // Optional parameters\n        Page: optional.(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.GetSubaccountsWithTokensResponse struct\n    result, _, err := client.TextMagicApi.GetSubaccountsWithTokens(auth, input, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<GetSubaccountsWithTokensInputObject> input(new GetSubaccountsWithTokensInputObject);\n    // Required parameters\n    input->setAppName(\"sample app\");\n    input->setPassword(\"strongPassword\");\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n     page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<GetSubaccountsWithTokensResponse>> result = api.getSubaccountsWithTokens(input, page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getSubaccountsWithTokens() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.GetSubaccountsWithTokensInputObject()\n\n# Required parameters\ninput.app_name = \"sample app\"\ninput.password = \"strongPassword\"\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # GetSubaccountsWithTokensResponse object\n    result = api_instance.get_subaccounts_with_tokens(get_subaccounts_with_tokens_input_object=input, page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_subaccounts_with_tokens: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::GetSubaccountsWithTokensInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::GetSubaccountsWithTokensInputObject->new(\n    # Required parameters\n    appName => 'sample app',\n    password => 'strongPassword',\n);\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # GetSubaccountsWithTokensResponse object\n    my $result = $api_instance->get_subaccounts_with_tokens(get_subaccounts_with_tokens_input_object => $input, page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_subaccounts_with_tokens: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/user/notification/balance/bundles": {
      "get": {
        "operationId": "getBalanceNotificationOptions",
        "summary": "Returns the list of available balance options which can be used as a bound to determine when to send email to user with low balance notification. See https://my.textmagic.com/online/account/notifications/balance",
        "responses": {
          "200": {
            "description": "Returned when the list of available balance options have been received with success.",
            "schema": {
              "$ref": "#/definitions/GetBalanceNotificationOptionsResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    // GetBalanceNotificationOptionsResponse class object\n    $result = $api->getBalanceNotificationOptions();\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getBalanceNotificationOptions: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            // GetBalanceNotificationOptionsResponse class object\n            GetBalanceNotificationOptionsResponse obj = apiInstance.getBalanceNotificationOptions();\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getBalanceNotificationOptions\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.getBalanceNotificationOptions().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    # GetBalanceNotificationOptionsResponse object\n    result = api.get_balance_notification_options()\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_balance_notification_options: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                // GetBalanceNotificationOptionsResponse class object\n                var result = apiInstance.GetBalanceNotificationOptions();\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getBalanceNotificationOptions: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            ' GetBalanceNotificationOptionsResponse class object\n            Dim result = apiInstance.GetBalanceNotificationOptions()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getBalanceNotificationOptions: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    // tm.GetBalanceNotificationOptionsResponse struct\n    result, _, err := client.TextMagicApi.GetBalanceNotificationOptions(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task<std::shared_ptr<GetBalanceNotificationOptionsResponse>> result = api.getBalanceNotificationOptions();\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getBalanceNotificationOptions() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    # GetBalanceNotificationOptionsResponse object\n    result = api_instance.get_balance_notification_options()\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_balance_notification_options: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    # GetBalanceNotificationOptionsResponse object\n    my $result = $api_instance->get_balance_notification_options();\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_balance_notification_options: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/getBalanceNotificationOptions\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/user/notification/balance": {
      "get": {
        "operationId": "getBalanceNotificationSettings",
        "summary": "Get balance notification settings",
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetBalanceNotificationSettingsResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    // GetBalanceNotificationSettingsResponse class object\n    $result = $api->getBalanceNotificationSettings();\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getBalanceNotificationSettings: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            // GetBalanceNotificationSettingsResponse class object\n            GetBalanceNotificationSettingsResponse obj = apiInstance.getBalanceNotificationSettings();\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getBalanceNotificationSettings\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.getBalanceNotificationSettings().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    # GetBalanceNotificationSettingsResponse object\n    result = api.get_balance_notification_settings()\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_balance_notification_settings: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                // GetBalanceNotificationSettingsResponse class object\n                var result = apiInstance.GetBalanceNotificationSettings();\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getBalanceNotificationSettings: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            ' GetBalanceNotificationSettingsResponse class object\n            Dim result = apiInstance.GetBalanceNotificationSettings()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getBalanceNotificationSettings: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    // tm.GetBalanceNotificationSettingsResponse struct\n    result, _, err := client.TextMagicApi.GetBalanceNotificationSettings(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task<std::shared_ptr<GetBalanceNotificationSettingsResponse>> result = api.getBalanceNotificationSettings();\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getBalanceNotificationSettings() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    # GetBalanceNotificationSettingsResponse object\n    result = api_instance.get_balance_notification_settings()\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_balance_notification_settings: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    # GetBalanceNotificationSettingsResponse object\n    my $result = $api_instance->get_balance_notification_settings();\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_balance_notification_settings: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/getBalanceNotificationSettings\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "put": {
        "operationId": "updateBalanceNotificationSettings",
        "summary": "Update balance notification settings",
        "produces": [],
        "parameters": [
          {
            "name": "UpdateBalanceNotificationSettingsInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "alertBalance"
              ],
              "properties": {
                "lowBalanceNotification": {
                  "description": "Should user receive low balance notification.",
                  "type": "boolean",
                  "example": true
                },
                "alertBalance": {
                  "description": "If balance is below this value, user receive low balance notification.",
                  "type": "string",
                  "example": "50"
                },
                "alertPhone": {
                  "description": "Low balance notification phone number.",
                  "type": "string",
                  "example": "15417543010"
                },
                "alertEmail1": {
                  "description": "Low balance notification email 1.",
                  "type": "string",
                  "example": "test@test.com"
                },
                "alertEmail2": {
                  "description": "Low balance notification email 2.",
                  "type": "string",
                  "example": "test@test.com"
                },
                "alertEmail3": {
                  "description": "Low balance notification email 3.",
                  "type": "string",
                  "example": "test@test.com"
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success"
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateBalanceNotificationSettingsInputObject();\n\n// Required parameters\n$input->setAlertBalance(\"50\");\n\n// Optional parameters, you can skip these setters calls\n$input->setLowBalanceNotification(true);\n$input->setAlertPhone(\"15417543010\");\n$input->setAlertEmail1(\"test@test.com\");\n$input->setAlertEmail2(\"test@test.com\");\n$input->setAlertEmail3(\"test@test.com\");\n\ntry {\n    $api->updateBalanceNotificationSettings($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateBalanceNotificationSettings: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateBalanceNotificationSettingsInputObject input = new UpdateBalanceNotificationSettingsInputObject();\n\n        // Required parameters\n        input.setAlertBalance(\"50\");\n\n        // Optional parameters, you can skip these setters calls\n        input.setLowBalanceNotification(true);\n        input.setAlertPhone(\"15417543010\");\n        input.setAlertEmail1(\"test@test.com\");\n        input.setAlertEmail2(\"test@test.com\");\n        input.setAlertEmail3(\"test@test.com\");\n\n        try {\n            apiInstance.updateBalanceNotificationSettings(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateBalanceNotificationSettings\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    alertBalance: \"50\",\n    // Optional parameters\n    lowBalanceNotification: true,\n    alertPhone: \"15417543010\",\n    alertEmail1: \"test@test.com\",\n    alertEmail2: \"test@test.com\",\n    alertEmail3: \"test@test.com\",\n}\n\n\napi.updateBalanceNotificationSettings(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateBalanceNotificationSettingsInputObject.new\n\n# Required parameters\nobj.alert_balance = \"50\"\n# Optional parameters, you can skip them\nobj.low_balance_notification = true\nobj.alert_phone = \"15417543010\"\nobj.alert_email1 = \"test@test.com\"\nobj.alert_email2 = \"test@test.com\"\nobj.alert_email3 = \"test@test.com\"\n\nbegin\n    api.update_balance_notification_settings(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_balance_notification_settings: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateBalanceNotificationSettingsInputObject();\n\n            // Required parameters\n            obj.AlertBalance = \"50\";\n\n            // Optional parameters, you can skip these setters calls\n            obj.LowBalanceNotification = true;\n            obj.AlertPhone = \"15417543010\";\n            obj.AlertEmail1 = \"test@test.com\";\n            obj.AlertEmail2 = \"test@test.com\";\n            obj.AlertEmail3 = \"test@test.com\";\n\n            try {\n                apiInstance.UpdateBalanceNotificationSettings(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateBalanceNotificationSettings: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateBalanceNotificationSettingsInputObject With {\n            .LowBalanceNotification = true,\n            .AlertBalance = \"50\",\n            .AlertPhone = \"15417543010\",\n            .AlertEmail1 = \"test@test.com\",\n            .AlertEmail2 = \"test@test.com\",\n            .AlertEmail3 = \"test@test.com\"\n        }\n\n        Try\n            apiInstance.UpdateBalanceNotificationSettings(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateBalanceNotificationSettings: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        AlertBalance: \"50\",\n        // Optional parameters, you can skip them\n        LowBalanceNotification: true,\n        AlertPhone: \"15417543010\",\n        AlertEmail1: \"test@test.com\",\n        AlertEmail2: \"test@test.com\",\n        AlertEmail3: \"test@test.com\",\n    }\n\n    client.TextMagicApi.UpdateBalanceNotificationSettings(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateBalanceNotificationSettingsInputObject> input(new UpdateBalanceNotificationSettingsInputObject);\n    // Required parameters\n    input->setAlertBalance(\"50\");\n    // Optional parameters, you can skip them\n    input->setLowBalanceNotification(true);\n    input->setAlertPhone(\"15417543010\");\n    input->setAlertEmail1(\"test@test.com\");\n    input->setAlertEmail2(\"test@test.com\");\n    input->setAlertEmail3(\"test@test.com\");\n\n    try {\n        pplx::task result = api.updateBalanceNotificationSettings(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"updateBalanceNotificationSettings() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateBalanceNotificationSettingsInputObject()\n\n# Required parameters\ninput.alert_balance = \"50\"\n# Optional parameters, you can skip them\ninput.low_balance_notification = true\ninput.alert_phone = \"15417543010\"\ninput.alert_email1 = \"test@test.com\"\ninput.alert_email2 = \"test@test.com\"\ninput.alert_email3 = \"test@test.com\"\n\ntry:\n    api_instance.update_balance_notification_settings(update_balance_notification_settings_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_balance_notification_settings: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateBalanceNotificationSettingsInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateBalanceNotificationSettingsInputObject->new(\n    # Required parameters\n    alertBalance => '50',\n    # Optional parameters, you can skip them\n    lowBalanceNotification => 1,\n    alertPhone => '15417543010',\n    alertEmail1 => 'test@test.com',\n    alertEmail2 => 'test@test.com',\n    alertEmail3 => 'test@test.com',\n);\n\neval {\n    $api_instance->update_balance_notification_settings(update_balance_notification_settings_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_balance_notification_settings: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/updateBalanceNotificationSettings\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/user/notification/inbound": {
      "get": {
        "operationId": "getInboundMessagesNotificationSettings",
        "summary": "Get inbound messages notification settings",
        "responses": {
          "200": {
            "description": "Returned when success.",
            "schema": {
              "$ref": "#/definitions/GetInboundMessagesNotificationSettingsResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    // GetInboundMessagesNotificationSettingsResponse class object\n    $result = $api->getInboundMessagesNotificationSettings();\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getInboundMessagesNotificationSettings: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            // GetInboundMessagesNotificationSettingsResponse class object\n            GetInboundMessagesNotificationSettingsResponse obj = apiInstance.getInboundMessagesNotificationSettings();\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getInboundMessagesNotificationSettings\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.getInboundMessagesNotificationSettings().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    # GetInboundMessagesNotificationSettingsResponse object\n    result = api.get_inbound_messages_notification_settings()\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_inbound_messages_notification_settings: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                // GetInboundMessagesNotificationSettingsResponse class object\n                var result = apiInstance.GetInboundMessagesNotificationSettings();\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getInboundMessagesNotificationSettings: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            ' GetInboundMessagesNotificationSettingsResponse class object\n            Dim result = apiInstance.GetInboundMessagesNotificationSettings()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getInboundMessagesNotificationSettings: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    // tm.GetInboundMessagesNotificationSettingsResponse struct\n    result, _, err := client.TextMagicApi.GetInboundMessagesNotificationSettings(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task<std::shared_ptr<GetInboundMessagesNotificationSettingsResponse>> result = api.getInboundMessagesNotificationSettings();\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getInboundMessagesNotificationSettings() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    # GetInboundMessagesNotificationSettingsResponse object\n    result = api_instance.get_inbound_messages_notification_settings()\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_inbound_messages_notification_settings: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    # GetInboundMessagesNotificationSettingsResponse object\n    my $result = $api_instance->get_inbound_messages_notification_settings();\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_inbound_messages_notification_settings: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/getInboundMessagesNotificationSettings\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "put": {
        "operationId": "updateInboundMessagesNotificationSettings",
        "summary": "Update inbound messages notification settings",
        "produces": [],
        "parameters": [
          {
            "name": "UpdateInboundMessagesNotificationSettingsInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "inboundMessageNotification",
                "includeSmsHistory",
                "sendInHtmlFormat"
              ],
              "additionalProperties": false,
              "properties": {
                "inboundMessageNotification": {
                  "description": "Should user receive notification about new incoming messages.",
                  "type": "boolean",
                  "example": true
                },
                "includeSmsHistory": {
                  "description": "Include SMS history into notification Email.",
                  "type": "boolean",
                  "example": true
                },
                "sendInHtmlFormat": {
                  "description": "Send Email notification in HTML format.",
                  "type": "boolean",
                  "example": true
                },
                "alertEmail1": {
                  "description": "New message notification email 2.",
                  "type": "string",
                  "format": "email",
                  "example": "test@test.com"
                },
                "alertEmail2": {
                  "description": "New message notification email 2.",
                  "type": "string",
                  "format": "email",
                  "example": "test@test.com"
                },
                "alertEmail3": {
                  "description": "New message notification email 3.",
                  "type": "string",
                  "format": "email",
                  "example": "test@test.com"
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateInboundMessagesNotificationSettingsInputObject();\n\n// Required parameters\n$input->setInboundMessageNotification(true);\n$input->setIncludeSmsHistory(true);\n$input->setSendInHtmlFormat(true);\n\n// Optional parameters, you can skip these setters calls\n$input->setAlertEmail1(\"test@test.com\");\n$input->setAlertEmail2(\"test@test.com\");\n$input->setAlertEmail3(\"test@test.com\");\n\ntry {\n    $api->updateInboundMessagesNotificationSettings($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateInboundMessagesNotificationSettings: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateInboundMessagesNotificationSettingsInputObject input = new UpdateInboundMessagesNotificationSettingsInputObject();\n\n        // Required parameters\n        input.setInboundMessageNotification(true);\n        input.setIncludeSmsHistory(true);\n        input.setSendInHtmlFormat(true);\n\n        // Optional parameters, you can skip these setters calls\n        input.setAlertEmail1(\"test@test.com\");\n        input.setAlertEmail2(\"test@test.com\");\n        input.setAlertEmail3(\"test@test.com\");\n\n        try {\n            apiInstance.updateInboundMessagesNotificationSettings(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateInboundMessagesNotificationSettings\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    inboundMessageNotification: true,\n    includeSmsHistory: true,\n    sendInHtmlFormat: true,\n    // Optional parameters\n    alertEmail1: \"test@test.com\",\n    alertEmail2: \"test@test.com\",\n    alertEmail3: \"test@test.com\",\n}\n\n\napi.updateInboundMessagesNotificationSettings(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateInboundMessagesNotificationSettingsInputObject.new\n\n# Required parameters\nobj.inbound_message_notification = true\nobj.include_sms_history = true\nobj.send_in_html_format = true\n# Optional parameters, you can skip them\nobj.alert_email1 = \"test@test.com\"\nobj.alert_email2 = \"test@test.com\"\nobj.alert_email3 = \"test@test.com\"\n\nbegin\n    api.update_inbound_messages_notification_settings(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_inbound_messages_notification_settings: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateInboundMessagesNotificationSettingsInputObject();\n\n            // Required parameters\n            obj.InboundMessageNotification = true;\n            obj.IncludeSmsHistory = true;\n            obj.SendInHtmlFormat = true;\n\n            // Optional parameters, you can skip these setters calls\n            obj.AlertEmail1 = \"test@test.com\";\n            obj.AlertEmail2 = \"test@test.com\";\n            obj.AlertEmail3 = \"test@test.com\";\n\n            try {\n                apiInstance.UpdateInboundMessagesNotificationSettings(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateInboundMessagesNotificationSettings: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateInboundMessagesNotificationSettingsInputObject With {\n            .InboundMessageNotification = true,\n            .IncludeSmsHistory = true,\n            .SendInHtmlFormat = true,\n            .AlertEmail1 = \"test@test.com\",\n            .AlertEmail2 = \"test@test.com\",\n            .AlertEmail3 = \"test@test.com\"\n        }\n\n        Try\n            apiInstance.UpdateInboundMessagesNotificationSettings(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateInboundMessagesNotificationSettings: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        InboundMessageNotification: true,\n        IncludeSmsHistory: true,\n        SendInHtmlFormat: true,\n        // Optional parameters, you can skip them\n        AlertEmail1: \"test@test.com\",\n        AlertEmail2: \"test@test.com\",\n        AlertEmail3: \"test@test.com\",\n    }\n\n    client.TextMagicApi.UpdateInboundMessagesNotificationSettings(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateInboundMessagesNotificationSettingsInputObject> input(new UpdateInboundMessagesNotificationSettingsInputObject);\n    // Required parameters\n    input->setInboundMessageNotification(true);\n    input->setIncludeSmsHistory(true);\n    input->setSendInHtmlFormat(true);\n    // Optional parameters, you can skip them\n    input->setAlertEmail1(\"test@test.com\");\n    input->setAlertEmail2(\"test@test.com\");\n    input->setAlertEmail3(\"test@test.com\");\n\n    try {\n        pplx::task result = api.updateInboundMessagesNotificationSettings(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"updateInboundMessagesNotificationSettings() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateInboundMessagesNotificationSettingsInputObject()\n\n# Required parameters\ninput.inbound_message_notification = true\ninput.include_sms_history = true\ninput.send_in_html_format = true\n# Optional parameters, you can skip them\ninput.alert_email1 = \"test@test.com\"\ninput.alert_email2 = \"test@test.com\"\ninput.alert_email3 = \"test@test.com\"\n\ntry:\n    api_instance.update_inbound_messages_notification_settings(update_inbound_messages_notification_settings_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_inbound_messages_notification_settings: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateInboundMessagesNotificationSettingsInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateInboundMessagesNotificationSettingsInputObject->new(\n    # Required parameters\n    inboundMessageNotification => 1,\n    includeSmsHistory => 1,\n    sendInHtmlFormat => 1,\n    # Optional parameters, you can skip them\n    alertEmail1 => 'test@test.com',\n    alertEmail2 => 'test@test.com',\n    alertEmail3 => 'test@test.com',\n);\n\neval {\n    $api_instance->update_inbound_messages_notification_settings(update_inbound_messages_notification_settings_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_inbound_messages_notification_settings: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/updateInboundMessagesNotificationSettings\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/user/desktop/notification": {
      "put": {
        "operationId": "updateChatDesktopNotificationSettings",
        "summary": "Update chat desktop notification settings",
        "parameters": [
          {
            "name": "UpdateChatDesktopNotificationSettingsInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "playSound",
                "showNotifications"
              ],
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "playSound": {
                  "description": "Enable notification sound?",
                  "type": "boolean",
                  "example": false
                },
                "showNotifications": {
                  "description": "Show desktop notifications about new messages.",
                  "type": "boolean",
                  "example": false
                },
                "showText": {
                  "description": "Incoming message text will be displayed in desktop notifications.",
                  "type": "boolean",
                  "example": true
                },
                "soundId": {
                  "description": "Sound Id of a notification.",
                  "type": "integer",
                  "example": 23
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateChatDesktopNotificationSettingsInputObject();\n\n// Required parameters\n$input->setPlaySound(null);\n$input->setShowNotifications(null);\n\n// Optional parameters, you can skip these setters calls\n$input->setShowText(true);\n$input->setSoundId(23);\n\ntry {\n    $api->updateChatDesktopNotificationSettings($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateChatDesktopNotificationSettings: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateChatDesktopNotificationSettingsInputObject input = new UpdateChatDesktopNotificationSettingsInputObject();\n\n        // Required parameters\n        input.setPlaySound(null);\n        input.setShowNotifications(null);\n\n        // Optional parameters, you can skip these setters calls\n        input.setShowText(true);\n        input.setSoundId(23);\n\n        try {\n            apiInstance.updateChatDesktopNotificationSettings(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateChatDesktopNotificationSettings\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    playSound: null,\n    showNotifications: null,\n    // Optional parameters\n    showText: true,\n    soundId: 23,\n}\n\n\napi.updateChatDesktopNotificationSettings(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateChatDesktopNotificationSettingsInputObject.new\n\n# Required parameters\nobj.play_sound = null\nobj.show_notifications = null\n# Optional parameters, you can skip them\nobj.show_text = true\nobj.sound_id = 23\n\nbegin\n    api.update_chat_desktop_notification_settings(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_chat_desktop_notification_settings: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateChatDesktopNotificationSettingsInputObject();\n\n            // Required parameters\n            obj.PlaySound = null;\n            obj.ShowNotifications = null;\n\n            // Optional parameters, you can skip these setters calls\n            obj.ShowText = true;\n            obj.SoundId = 23;\n\n            try {\n                apiInstance.UpdateChatDesktopNotificationSettings(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateChatDesktopNotificationSettings: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateChatDesktopNotificationSettingsInputObject With {\n            .PlaySound = null,\n            .ShowNotifications = null,\n            .ShowText = true,\n            .SoundId = 23\n        }\n\n        Try\n            apiInstance.UpdateChatDesktopNotificationSettings(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateChatDesktopNotificationSettings: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        PlaySound: null,\n        ShowNotifications: null,\n        // Optional parameters, you can skip them\n        ShowText: true,\n        SoundId: 23,\n    }\n\n    client.TextMagicApi.UpdateChatDesktopNotificationSettings(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateChatDesktopNotificationSettingsInputObject> input(new UpdateChatDesktopNotificationSettingsInputObject);\n    // Required parameters\n    input->setPlaySound(null);\n    input->setShowNotifications(null);\n    // Optional parameters, you can skip them\n    input->setShowText(true);\n    input->setSoundId(23);\n\n    try {\n        pplx::task result = api.updateChatDesktopNotificationSettings(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"updateChatDesktopNotificationSettings() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateChatDesktopNotificationSettingsInputObject()\n\n# Required parameters\ninput.play_sound = null\ninput.show_notifications = null\n# Optional parameters, you can skip them\ninput.show_text = true\ninput.sound_id = 23\n\ntry:\n    api_instance.update_chat_desktop_notification_settings(update_chat_desktop_notification_settings_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_chat_desktop_notification_settings: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateChatDesktopNotificationSettingsInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateChatDesktopNotificationSettingsInputObject->new(\n    # Required parameters\n    playSound => null,\n    showNotifications => null,\n    # Optional parameters, you can skip them\n    showText => 1,\n    soundId => 23,\n);\n\neval {\n    $api_instance->update_chat_desktop_notification_settings(update_chat_desktop_notification_settings_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_chat_desktop_notification_settings: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/updateChatDesktopNotificationSettings\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/callback/settings": {
      "get": {
        "operationId": "getCallbackSettings",
        "summary": "Fetch callback URL settings",
        "responses": {
          "200": {
            "description": "Callback settings has been returned with success.",
            "schema": {
              "$ref": "#/definitions/GetCallbackSettingsResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    // GetCallbackSettingsResponse class object\n    $result = $api->getCallbackSettings();\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getCallbackSettings: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            // GetCallbackSettingsResponse class object\n            GetCallbackSettingsResponse obj = apiInstance.getCallbackSettings();\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getCallbackSettings\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.getCallbackSettings().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    # GetCallbackSettingsResponse object\n    result = api.get_callback_settings()\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_callback_settings: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                // GetCallbackSettingsResponse class object\n                var result = apiInstance.GetCallbackSettings();\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getCallbackSettings: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            ' GetCallbackSettingsResponse class object\n            Dim result = apiInstance.GetCallbackSettings()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getCallbackSettings: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    // tm.GetCallbackSettingsResponse struct\n    result, _, err := client.TextMagicApi.GetCallbackSettings(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task<std::shared_ptr<GetCallbackSettingsResponse>> result = api.getCallbackSettings();\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getCallbackSettings() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    # GetCallbackSettingsResponse object\n    result = api_instance.get_callback_settings()\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_callback_settings: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    # GetCallbackSettingsResponse object\n    my $result = $api_instance->get_callback_settings();\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_callback_settings: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/getCallbackSettings\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "put": {
        "operationId": "updateCallbackSettings",
        "summary": "Update callback URL settings",
        "parameters": [
          {
            "name": "UpdateCallbackSettingsInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "outUrl",
                "inUrl",
                "format"
              ],
              "properties": {
                "outUrl": {
                  "type": "string",
                  "description": "This URL is used to push message delivery status updates to your application.",
                  "example": "http://www.mysite.com/delivery-callback.php",
                  "x-nullable": true
                },
                "inUrl": {
                  "type": "string",
                  "description": "This URL is used to push incoming SMS to your application.",
                  "example": "http://www.mysite.com/incoming-sms-callback.php",
                  "x-nullable": true
                },
                "format": {
                  "type": "string",
                  "enum": [
                    "m",
                    "u",
                    "j"
                  ],
                  "description": "Desired callback data format. m - multipart/form-data, u - application/x-www-form-urlencoded, j - application/json"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "User Settings"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateCallbackSettingsInputObject();\n\n// Required parameters\n$input->setOutUrl(\"http://www.mysite.com/delivery-callback.php\");\n$input->setInUrl(\"http://www.mysite.com/incoming-sms-callback.php\");\n$input->setFormat(\"\");\n\ntry {\n    $api->updateCallbackSettings($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateCallbackSettings: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateCallbackSettingsInputObject input = new UpdateCallbackSettingsInputObject();\n\n        // Required parameters\n        input.setOutUrl(\"http://www.mysite.com/delivery-callback.php\");\n        input.setInUrl(\"http://www.mysite.com/incoming-sms-callback.php\");\n        input.setFormat(\"\");\n\n        try {\n            apiInstance.updateCallbackSettings(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateCallbackSettings\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    outUrl: \"http://www.mysite.com/delivery-callback.php\",\n    inUrl: \"http://www.mysite.com/incoming-sms-callback.php\",\n    format: \"\",\n}\n\n\napi.updateCallbackSettings(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateCallbackSettingsInputObject.new\n\n# Required parameters\nobj.out_url = \"http://www.mysite.com/delivery-callback.php\"\nobj.in_url = \"http://www.mysite.com/incoming-sms-callback.php\"\nobj.format = \"\"\n\nbegin\n    api.update_callback_settings(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_callback_settings: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateCallbackSettingsInputObject();\n\n            // Required parameters\n            obj.OutUrl = \"http://www.mysite.com/delivery-callback.php\";\n            obj.InUrl = \"http://www.mysite.com/incoming-sms-callback.php\";\n            obj.Format = \"\";\n\n            try {\n                apiInstance.UpdateCallbackSettings(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateCallbackSettings: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateCallbackSettingsInputObject With {\n            .OutUrl = \"http://www.mysite.com/delivery-callback.php\",\n            .InUrl = \"http://www.mysite.com/incoming-sms-callback.php\",\n            .Format = \"\"\n        }\n\n        Try\n            apiInstance.UpdateCallbackSettings(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateCallbackSettings: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        OutUrl: \"http://www.mysite.com/delivery-callback.php\",\n        InUrl: \"http://www.mysite.com/incoming-sms-callback.php\",\n        Format: \"\",\n    }\n\n    client.TextMagicApi.UpdateCallbackSettings(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateCallbackSettingsInputObject> input(new UpdateCallbackSettingsInputObject);\n    // Required parameters\n    input->setOutUrl(\"http://www.mysite.com/delivery-callback.php\");\n    input->setInUrl(\"http://www.mysite.com/incoming-sms-callback.php\");\n    input->setFormat(\"\");\n\n    try {\n        pplx::task result = api.updateCallbackSettings(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"updateCallbackSettings() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateCallbackSettingsInputObject()\n\n# Required parameters\ninput.out_url = \"http://www.mysite.com/delivery-callback.php\"\ninput.in_url = \"http://www.mysite.com/incoming-sms-callback.php\"\ninput.format = \"\"\n\ntry:\n    api_instance.update_callback_settings(update_callback_settings_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_callback_settings: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateCallbackSettingsInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateCallbackSettingsInputObject->new(\n    # Required parameters\n    outUrl => 'http://www.mysite.com/delivery-callback.php',\n    inUrl => 'http://www.mysite.com/incoming-sms-callback.php',\n    format => '',\n);\n\neval {\n    $api_instance->update_callback_settings(update_callback_settings_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_callback_settings: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/updateCallbackSettings\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/calls/price/normalized": {},
    "/api/v2/contacts/search": {
      "get": {
        "operationId": "searchContacts",
        "summary": "Find contacts by given criteria",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "shared",
            "in": "query",
            "description": "Should shared contacts be included?",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Find contacts by IDs.",
            "type": "string",
            "pattern": "^(\\d+)(,\\d+)*$"
          },
          {
            "name": "listId",
            "in": "query",
            "description": "Find contacts by List ID.",
            "type": "integer"
          },
          {
            "name": "includeBlocked",
            "in": "query",
            "description": "Should blocked contacts be included?",
            "type": "integer",
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Find contacts by specified search query.",
            "type": "string"
          },
          {
            "name": "local",
            "in": "query",
            "description": "Treat phone number passed in the \"query\" field as local. Default is 0.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "exactMatch",
            "in": "query",
            "description": "Return only exactly matching contacts. Default is 0.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "country",
            "in": "query",
            "description": "The 2-letter ISO country code for local phone numbers, used when \"local\" is set to true. Default is the account country.",
            "type": "string"
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "firstName",
              "lastName"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          },
          {
            "name": "tagIds",
            "in": "query",
            "description": "Find contacts by tag ID(s). Multiple IDs can be separated by comma.",
            "type": "string",
            "pattern": "^(\\d+)(,\\d+)*$"
          }
        ],
        "responses": {
          "200": {
            "description": "Found contacts have been returned with success.",
            "schema": {
              "$ref": "#/definitions/SearchContactsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to searchContacts method below, default values will be used\n$page = 1;\n$limit = 10;\n$shared = 0;\n$ids = \"sampleValue\";\n$listId = 1;\n$includeBlocked = 1;\n$query = \"sampleValue\";\n$local = 0;\n$exactMatch = 0;\n$country = \"sampleValue\";\n$orderBy = \"id\";\n$direction = \"desc\";\n$tagIds = \"sampleValue\";\n\ntry {\n    // SearchContactsPaginatedResponse class object\n    $result = $api->searchContacts($page, $limit, $shared, $ids, $listId, $includeBlocked, $query, $local, $exactMatch, $country, $orderBy, $direction, $tagIds);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->searchContacts: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to searchContacts method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        int shared = 0;\n        String ids = \"sampleValue\";\n        int listId = 1;\n        int includeBlocked = 1;\n        String query = \"sampleValue\";\n        int local = 0;\n        int exactMatch = 0;\n        String country = \"sampleValue\";\n        String orderBy = \"id\";\n        String direction = \"desc\";\n        String tagIds = \"sampleValue\";\n\n        try {\n            // SearchContactsPaginatedResponse class object\n            SearchContactsPaginatedResponse obj = apiInstance.searchContacts(page, limit, shared, ids, listId, includeBlocked, query, local, exactMatch, country, orderBy, direction, tagIds);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling searchContacts\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    shared: 0,\n    ids: \"sampleValue\",\n    listId: 1,\n    includeBlocked: 1,\n    query: \"sampleValue\",\n    local: 0,\n    exactMatch: 0,\n    country: \"sampleValue\",\n    orderBy: \"id\",\n    direction: \"desc\",\n    tagIds: \"sampleValue\",\n};\n\napi.searchContacts(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  shared: 0,\n  ids: 'sampleValue',\n  list_id: 1,\n  include_blocked: 1,\n  query: 'sampleValue',\n  local: 0,\n  exact_match: 0,\n  country: 'sampleValue',\n  order_by: 'id',\n  direction: 'desc',\n  tag_ids: 'sampleValue',\n}\n\nbegin\n    # SearchContactsPaginatedResponse object\n    result = api.search_contacts(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->search_contacts: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to searchContacts method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            int shared = 0;\n            string ids = \"sampleValue\";\n            int listId = 1;\n            int includeBlocked = 1;\n            string query = \"sampleValue\";\n            int local = 0;\n            int exactMatch = 0;\n            string country = \"sampleValue\";\n            string orderBy = \"id\";\n            string direction = \"desc\";\n            string tagIds = \"sampleValue\";\n\n            try {\n                // SearchContactsPaginatedResponse class object\n                var result = apiInstance.SearchContacts(page, limit, shared, ids, listId, includeBlocked, query, local, exactMatch, country, orderBy, direction, tagIds);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling searchContacts: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to searchContacts method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim shared As Integer = 0\n        Dim ids As String = \"sampleValue\"\n        Dim listId As Integer = 1\n        Dim includeBlocked As Integer = 1\n        Dim query As String = \"sampleValue\"\n        Dim local As Integer = 0\n        Dim exactMatch As Integer = 0\n        Dim country As String = \"sampleValue\"\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n        Dim tagIds As String = \"sampleValue\"\n\n        Try\n            ' SearchContactsPaginatedResponse class object\n            Dim result = apiInstance.SearchContacts(page, limit, shared, ids, listId, includeBlocked, query, local, exactMatch, country, orderBy, direction, tagIds)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling searchContacts: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.SearchContactsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Shared: optional.NewInt32(0),\n        Ids: optional.NewString(\"sampleValue\"),\n        ListId: optional.NewInt32(1),\n        IncludeBlocked: optional.NewInt32(1),\n        Query: optional.NewString(\"sampleValue\"),\n        Local: optional.NewInt32(0),\n        ExactMatch: optional.NewInt32(0),\n        Country: optional.NewString(\"sampleValue\"),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n        TagIds: optional.NewString(\"sampleValue\"),\n    }\n\n    // tm.SearchContactsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.SearchContacts(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    int shared = 0;\n    std::string ids = \"sampleValue\";\n    int listId = 1;\n    int includeBlocked = 1;\n    std::string query = \"sampleValue\";\n    int local = 0;\n    int exactMatch = 0;\n    std::string country = \"sampleValue\";\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n    std::string tagIds = \"sampleValue\";\n\n    try {\n        pplx::task<std::shared_ptr<SearchContactsPaginatedResponse>> result = api.searchContacts(page, limit, shared, ids, listId, includeBlocked, query, local, exactMatch, country, orderBy, direction, tagIds);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"searchContacts() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nshared = 0\nids = \"sampleValue\"\nlist_id = 1\ninclude_blocked = 1\nquery = \"sampleValue\"\nlocal = 0\nexact_match = 0\ncountry = \"sampleValue\"\norder_by = \"id\"\ndirection = \"desc\"\ntag_ids = \"sampleValue\"\n\ntry:\n    # SearchContactsPaginatedResponse object\n    result = api_instance.search_contacts(page=page, limit=limit, shared=shared, ids=ids, list_id=list_id, include_blocked=include_blocked, query=query, local=local, exact_match=exact_match, country=country, order_by=order_by, direction=direction, tag_ids=tag_ids)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->search_contacts: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $shared = 0;\nmy $ids = 'sampleValue';\nmy $listId = 1;\nmy $includeBlocked = 1;\nmy $query = 'sampleValue';\nmy $local = 0;\nmy $exactMatch = 0;\nmy $country = 'sampleValue';\nmy $orderBy = 'id';\nmy $direction = 'desc';\nmy $tagIds = 'sampleValue';\n\neval {\n    # SearchContactsPaginatedResponse object\n    my $result = $api_instance->search_contacts(page => $page, limit => $limit, shared => $shared, ids => $ids, listId => $listId, includeBlocked => $includeBlocked, query => $query, local => $local, exactMatch => $exactMatch, country => $country, orderBy => $orderBy, direction => $direction, tagIds => $tagIds);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->search_contacts: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/searchContacts\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/autocomplete": {
      "get": {
        "operationId": "getContactsAutocomplete",
        "summary": "Get contacts autocomplete suggestions",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/getContactsAutocomplete\" target=\"_blank\">Try in sandbox</a><br>Get contacts autocomplete suggestions by given search terms.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "Find recipients by specified search query.",
            "type": "string",
            "x-example": "A"
          },
          {
            "name": "lists",
            "in": "query",
            "description": "Should lists be returned or not?",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Autocomplete data has been returned with success.",
            "schema": {
              "$ref": "#/definitions/GetContactsAutocompleteResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "Not supported yet."
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        String query = \"A\";\n        // Optional, you can pass them as null values to getContactsAutocomplete method below, default values will be used\n        int limit = 10;\n        int lists = 0;\n\n        try {\n            // GetContactsAutocompleteResponse class object\n            GetContactsAutocompleteResponse obj = apiInstance.getContactsAutocomplete(query, limit, lists);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getContactsAutocomplete\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst query = \"A\";\n\n// Optional parameters\nconst opts = {\n    limit: 10,\n    lists: 0,\n};\n\napi.getContactsAutocomplete(query, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  query: 'A',\n  # Optional parameters\n  limit: 10,\n  lists: 0,\n}\n\nbegin\n    # GetContactsAutocompleteResponse object\n    result = api.get_contacts_autocomplete(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_contacts_autocomplete: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            string query = \"A\";\n            // Optional, you can pass them as null values to getContactsAutocomplete method below, default values will be used\n            int limit = 10;\n            int lists = 0;\n\n            try {\n                // GetContactsAutocompleteResponse class object\n                var result = apiInstance.GetContactsAutocomplete(query, limit, lists);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getContactsAutocomplete: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim query As String = \"A\"\n        ' Optional, you can pass them as null values to getContactsAutocomplete method below, default values will be used\n        Dim limit As Integer = 10\n        Dim lists As Integer = 0\n\n        Try\n            ' GetContactsAutocompleteResponse class object\n            Dim result = apiInstance.GetContactsAutocomplete(query, limit, lists)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getContactsAutocomplete: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetContactsAutocompleteOpts{\n        // Required parameters\n        Query: \"A\",\n        // Optional parameters\n        Limit: optional.NewInt32(10),\n        Lists: optional.NewInt32(0),\n    }\n\n    // tm.GetContactsAutocompleteResponse struct\n    result, _, err := client.TextMagicApi.GetContactsAutocomplete(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "Not supported yet."
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nquery = \"A\"\n# Optional params, you can skip them\nlimit = 10\nlists = 0\n\ntry:\n    # GetContactsAutocompleteResponse object\n    result = api_instance.get_contacts_autocomplete(query=query, limit=limit, lists=lists)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_contacts_autocomplete: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $query = 'A';\n# Optional params, you can skip them\nmy $limit = 10;\nmy $lists = 0;\n\neval {\n    # GetContactsAutocompleteResponse object\n    my $result = $api_instance->get_contacts_autocomplete(query => $query, limit => $limit, lists => $lists);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_contacts_autocomplete: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/contacts": {
      "get": {
        "operationId": "getContacts",
        "summary": "Get all contacts",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "shared",
            "in": "query",
            "description": "Should shared contacts be included?",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "firstName",
              "lastName"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Requested contacts have been returned with success.",
            "schema": {
              "$ref": "#/definitions/GetContactsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getContacts method below, default values will be used\n$page = 1;\n$limit = 10;\n$shared = 0;\n$orderBy = \"id\";\n$direction = \"desc\";\n\ntry {\n    // GetContactsPaginatedResponse class object\n    $result = $api->getContacts($page, $limit, $shared, $orderBy, $direction);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getContacts: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getContacts method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        int shared = 0;\n        String orderBy = \"id\";\n        String direction = \"desc\";\n\n        try {\n            // GetContactsPaginatedResponse class object\n            GetContactsPaginatedResponse obj = apiInstance.getContacts(page, limit, shared, orderBy, direction);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getContacts\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    shared: 0,\n    orderBy: \"id\",\n    direction: \"desc\",\n};\n\napi.getContacts(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  shared: 0,\n  order_by: 'id',\n  direction: 'desc',\n}\n\nbegin\n    # GetContactsPaginatedResponse object\n    result = api.get_contacts(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_contacts: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getContacts method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            int shared = 0;\n            string orderBy = \"id\";\n            string direction = \"desc\";\n\n            try {\n                // GetContactsPaginatedResponse class object\n                var result = apiInstance.GetContacts(page, limit, shared, orderBy, direction);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getContacts: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getContacts method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim shared As Integer = 0\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n\n        Try\n            ' GetContactsPaginatedResponse class object\n            Dim result = apiInstance.GetContacts(page, limit, shared, orderBy, direction)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getContacts: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetContactsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Shared: optional.NewInt32(0),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n    }\n\n    // tm.GetContactsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetContacts(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    int shared = 0;\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n\n    try {\n        pplx::task<std::shared_ptr<GetContactsPaginatedResponse>> result = api.getContacts(page, limit, shared, orderBy, direction);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getContacts() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nshared = 0\norder_by = \"id\"\ndirection = \"desc\"\n\ntry:\n    # GetContactsPaginatedResponse object\n    result = api_instance.get_contacts(page=page, limit=limit, shared=shared, order_by=order_by, direction=direction)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_contacts: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $shared = 0;\nmy $orderBy = 'id';\nmy $direction = 'desc';\n\neval {\n    # GetContactsPaginatedResponse object\n    my $result = $api_instance->get_contacts(page => $page, limit => $limit, shared => $shared, orderBy => $orderBy, direction => $direction);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_contacts: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/getContacts\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/normalized": {
      "post": {
        "operationId": "createContact",
        "summary": "Add a new contact",
        "parameters": [
          {
            "name": "CreateContactInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "phone",
                "lists"
              ],
              "properties": {
                "firstName": {
                  "type": "string",
                  "description": "Contact first name.",
                  "example": "Charles"
                },
                "lastName": {
                  "type": "string",
                  "description": "Contact last name.",
                  "example": "Conway"
                },
                "phone": {
                  "type": "string",
                  "description": "Phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164).",
                  "example": "447860021130"
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "description": "Contact email address.",
                  "example": "charles@example.com"
                },
                "companyName": {
                  "type": "string",
                  "description": "Company name.",
                  "example": "Example Ltd."
                },
                "lists": {
                  "type": "string",
                  "description": "Contact [list](https://docs.textmagic.com/#tag/Lists) ID. Each contact must be assigned to at least one list.",
                  "example": "10541,18599"
                },
                "favorited": {
                  "type": "boolean",
                  "description": "Is the contact marked as favorite?",
                  "example": false
                },
                "blocked": {
                  "type": "boolean",
                  "description": "Is the contact blocked for outgoing and incoming messaging?",
                  "example": false
                },
                "type": {
                  "type": "integer",
                  "description": "Force type of phone. Possible values: 0 is landline; 1 is mobile; default is -1 (auto-detection).",
                  "example": 1,
                  "enum": [
                    0,
                    1
                  ]
                },
                "customFieldValues": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/CustomFieldListItem"
                  }
                },
                "local": {
                  "description": "Treat phone numbers passed in the request body as local.",
                  "type": "integer",
                  "example": 0,
                  "enum": [
                    0,
                    1
                  ]
                },
                "country": {
                  "description": "The 2-letter ISO country code for local phone numbers, used when local is  set to true. Default is the account country.",
                  "type": "string",
                  "example": "US"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "description": "An array of tag IDs that will be assigned to the contact.",
                  "example": [
                    23,
                    45
                  ]
                },
                "owner": {
                  "description": "Contact Owner ID",
                  "type": "integer",
                  "example": 2
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Contact has been created with success.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new CreateContactInputObject();\n\n// Required parameters\n$input->setPhone(\"447860021130\");\n$input->setLists(\"10541,18599\");\n\n// Optional parameters, you can skip these setters calls\n$input->setFirstName(\"Charles\");\n$input->setLastName(\"Conway\");\n$input->setEmail(\"charles@example.com\");\n$input->setCompanyName(\"Example Ltd.\");\n$input->setFavorited(null);\n$input->setBlocked(null);\n$input->setType(1);\n$input->setCustomFieldValues([]);\n$input->setLocal(null);\n$input->setCountry(\"US\");\n$input->setTags([23,45]);\n$input->setOwner(2);\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->createContact($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->createContact: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        CreateContactInputObject input = new CreateContactInputObject();\n\n        // Required parameters\n        input.setPhone(\"447860021130\");\n        input.setLists(\"10541,18599\");\n\n        // Optional parameters, you can skip these setters calls\n        input.setFirstName(\"Charles\");\n        input.setLastName(\"Conway\");\n        input.setEmail(\"charles@example.com\");\n        input.setCompanyName(\"Example Ltd.\");\n        input.setFavorited(null);\n        input.setBlocked(null);\n        input.setType(1);\n        input.setCustomFieldValues([]);\n        input.setLocal(null);\n        input.setCountry(\"US\");\n        input.setTags([23,45]);\n        input.setOwner(2);\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.createContact(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling createContact\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    phone: \"447860021130\",\n    lists: \"10541,18599\",\n    // Optional parameters\n    firstName: \"Charles\",\n    lastName: \"Conway\",\n    email: \"charles@example.com\",\n    companyName: \"Example Ltd.\",\n    favorited: null,\n    blocked: null,\n    type: 1,\n    customFieldValues: [],\n    local: null,\n    country: \"US\",\n    tags: [23,45],\n    owner: 2,\n}\n\n\napi.createContact(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::CreateContactInputObject.new\n\n# Required parameters\nobj.phone = \"447860021130\"\nobj.lists = \"10541,18599\"\n# Optional parameters, you can skip them\nobj.first_name = \"Charles\"\nobj.last_name = \"Conway\"\nobj.email = \"charles@example.com\"\nobj.company_name = \"Example Ltd.\"\nobj.favorited = null\nobj.blocked = null\nobj.type = 1\nobj.custom_field_values = []\nobj.local = null\nobj.country = \"US\"\nobj.tags = [23,45]\nobj.owner = 2\n\nbegin\n    # ResourceLinkResponse object\n    result = api.create_contact(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->create_contact: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new CreateContactInputObject();\n\n            // Required parameters\n            obj.Phone = \"447860021130\";\n            obj.Lists = \"10541,18599\";\n\n            // Optional parameters, you can skip these setters calls\n            obj.FirstName = \"Charles\";\n            obj.LastName = \"Conway\";\n            obj.Email = \"charles@example.com\";\n            obj.CompanyName = \"Example Ltd.\";\n            obj.Favorited = null;\n            obj.Blocked = null;\n            obj.Type = 1;\n            obj.CustomFieldValues = [];\n            obj.Local = null;\n            obj.Country = \"US\";\n            obj.Tags = [23,45];\n            obj.Owner = 2;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.CreateContact(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling createContact: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New CreateContactInputObject With {\n            .FirstName = \"Charles\",\n            .LastName = \"Conway\",\n            .Phone = \"447860021130\",\n            .Email = \"charles@example.com\",\n            .CompanyName = \"Example Ltd.\",\n            .Lists = \"10541,18599\",\n            .Favorited = null,\n            .Blocked = null,\n            .Type = 1,\n            .CustomFieldValues = [],\n            .Local = null,\n            .Country = \"US\",\n            .Tags = [23,45],\n            .Owner = 2\n        }\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.CreateContact(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling createContact: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Phone: \"447860021130\",\n        Lists: \"10541,18599\",\n        // Optional parameters, you can skip them\n        FirstName: \"Charles\",\n        LastName: \"Conway\",\n        Email: \"charles@example.com\",\n        CompanyName: \"Example Ltd.\",\n        Favorited: null,\n        Blocked: null,\n        Type: 1,\n        CustomFieldValues: [],\n        Local: null,\n        Country: \"US\",\n        Tags: [23,45],\n        Owner: 2,\n    }\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.CreateContact(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<CreateContactInputObject> input(new CreateContactInputObject);\n    // Required parameters\n    input->setPhone(\"447860021130\");\n    input->setLists(\"10541,18599\");\n    // Optional parameters, you can skip them\n    input->setFirstName(\"Charles\");\n    input->setLastName(\"Conway\");\n    input->setEmail(\"charles@example.com\");\n    input->setCompanyName(\"Example Ltd.\");\n    input->setFavorited(null);\n    input->setBlocked(null);\n    input->setType(1);\n    input->setCustomFieldValues([]);\n    input->setLocal(null);\n    input->setCountry(\"US\");\n    input->setTags([23,45]);\n    input->setOwner(2);\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.createContact(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"createContact() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.CreateContactInputObject()\n\n# Required parameters\ninput.phone = \"447860021130\"\ninput.lists = \"10541,18599\"\n# Optional parameters, you can skip them\ninput.first_name = \"Charles\"\ninput.last_name = \"Conway\"\ninput.email = \"charles@example.com\"\ninput.company_name = \"Example Ltd.\"\ninput.favorited = null\ninput.blocked = null\ninput.type = 1\ninput.custom_field_values = []\ninput.local = null\ninput.country = \"US\"\ninput.tags = [23,45]\ninput.owner = 2\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.create_contact(create_contact_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->create_contact: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::CreateContactInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::CreateContactInputObject->new(\n    # Required parameters\n    phone => '447860021130',\n    lists => '10541,18599',\n    # Optional parameters, you can skip them\n    firstName => 'Charles',\n    lastName => 'Conway',\n    email => 'charles@example.com',\n    companyName => 'Example Ltd.',\n    favorited => null,\n    blocked => null,\n    type => 1,\n    customFieldValues => [],\n    local => null,\n    country => 'US',\n    tags => [23,45],\n    owner => 2,\n);\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->create_contact(create_contact_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->create_contact: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/createContact\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/phone/{phone}": {
      "get": {
        "operationId": "getContactByPhone",
        "summary": "Get the details of a specific contact by phone number",
        "parameters": [
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "type": "string",
            "x-example": "447860021130"
          }
        ],
        "responses": {
          "200": {
            "description": "Contact data has been returned with success.",
            "schema": {
              "$ref": "#/definitions/Contact"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$phone = \"447860021130\";\n\ntry {\n    // Contact class object\n    $result = $api->getContactByPhone($phone);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getContactByPhone: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        String phone = \"447860021130\";\n\n        try {\n            // Contact class object\n            Contact obj = apiInstance.getContactByPhone(phone);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getContactByPhone\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst phone = \"447860021130\";\n\n\napi.getContactByPhone(phone).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nphone = '447860021130'\n\nbegin\n    # Contact object\n    result = api.get_contact_by_phone(phone)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_contact_by_phone: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            string phone = \"447860021130\";\n\n            try {\n                // Contact class object\n                var result = apiInstance.GetContactByPhone(phone);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getContactByPhone: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim phone As String = \"447860021130\"\n\n        Try\n            ' Contact class object\n            Dim result = apiInstance.GetContactByPhone(phone)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getContactByPhone: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var phone string = \"447860021130\"\n\n    // tm.Contact struct\n    result, _, err := client.TextMagicApi.GetContactByPhone(auth, phone)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::string phone = \"447860021130\";\n\n    try {\n        pplx::task<std::shared_ptr<Contact>> result = api.getContactByPhone(phone);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getContactByPhone() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nphone = \"447860021130\"\n\ntry:\n    # Contact object\n    result = api_instance.get_contact_by_phone(phone=phone)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_contact_by_phone: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $phone = '447860021130';\n\neval {\n    # Contact object\n    my $result = $api_instance->get_contact_by_phone(phone => $phone);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_contact_by_phone: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/getContactByPhone\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/{id}": {
      "get": {
        "operationId": "getContact",
        "summary": "Get the details of a specific contact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "description": "Contact ID.",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Contact data received with success.",
            "schema": {
              "$ref": "#/definitions/Contact"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // Contact class object\n    $result = $api->getContact($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getContact: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // Contact class object\n            Contact obj = apiInstance.getContact(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getContact\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getContact(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # Contact object\n    result = api.get_contact(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_contact: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // Contact class object\n                var result = apiInstance.GetContact(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getContact: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' Contact class object\n            Dim result = apiInstance.GetContact(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getContact: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.Contact struct\n    result, _, err := client.TextMagicApi.GetContact(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<Contact>> result = api.getContact(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getContact() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # Contact object\n    result = api_instance.get_contact(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_contact: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # Contact object\n    my $result = $api_instance->get_contact(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_contact: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/getContact\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteContact",
        "produces": [],
        "summary": "Delete a contact",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/deleteContact\" target=\"_blank\">Try in sandbox</a><br>> This command removes your contact completely. If it was assigned or saved to a shared list, it will disappear from there too. If you only need to remove a contact from selected lists, use the Contact assignment command in the Lists section instead, rather than deleting the contact.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when trying to delete a contact shared to a current user."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteContact($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteContact: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteContact(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteContact\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteContact(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_contact(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_contact: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteContact(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteContact: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteContact(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteContact: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteContact(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteContact(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteContact() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_contact(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_contact: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_contact(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_contact: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/contacts/{id}/normalized": {
      "put": {
        "operationId": "updateContact",
        "summary": "Edit a contact",
        "parameters": [
          {
            "name": "UpdateContactInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "phone",
                "lists"
              ],
              "properties": {
                "firstName": {
                  "type": "string",
                  "description": "Contact first name.",
                  "example": "Example first name"
                },
                "lastName": {
                  "type": "string",
                  "description": "Contact last name.",
                  "example": "Example first name"
                },
                "phone": {
                  "type": "string",
                  "description": "Phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164).",
                  "example": 447860021130
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "description": "Contact email address.",
                  "example": "charles@example.com"
                },
                "companyName": {
                  "type": "string",
                  "description": "Contact company name.",
                  "example": "My pretty company"
                },
                "lists": {
                  "type": "string",
                  "description": "Comma-separated [list](https://docs.textmagic.com/#section/Lists) ID. Each contact must be assigned to at least one list.",
                  "example": "10541,18599"
                },
                "favorited": {
                  "type": "boolean",
                  "description": "Is the contact marked as favorite?",
                  "example": false
                },
                "blocked": {
                  "type": "boolean",
                  "description": "Is the contact blocked for outgoing and incoming messaging?",
                  "example": false
                },
                "type": {
                  "type": "integer",
                  "description": "Force type of phone. Possible values: 0 is landline; 1 is mobile; default is -1 (auto-detection).",
                  "example": 1,
                  "enum": [
                    0,
                    1
                  ]
                },
                "customFieldValues": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/CustomFieldListItem"
                  }
                },
                "local": {
                  "description": "Treat phone numbers passed in the request body as **local**.",
                  "type": "integer",
                  "example": 0,
                  "enum": [
                    0,
                    1
                  ]
                },
                "country": {
                  "description": "The 2-letter ISO country code for local phone numbers, used when **local** is set to true.",
                  "type": "string",
                  "example": "US"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "description": "An array of tag IDs that will be assigned to the contact.",
                  "example": [
                    23,
                    45
                  ]
                },
                "owner": {
                  "description": "Contact Owner ID",
                  "type": "integer",
                  "example": 2
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "201": {
            "description": "The contact has been created with success.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateContactInputObject();\n\n// Required parameters\n$input->setPhone(\"447860021130\");\n$input->setLists(\"10541,18599\");\n\n// Optional parameters, you can skip these setters calls\n$input->setFirstName(\"Example first name\");\n$input->setLastName(\"Example first name\");\n$input->setEmail(\"charles@example.com\");\n$input->setCompanyName(\"My pretty company\");\n$input->setFavorited(null);\n$input->setBlocked(null);\n$input->setType(1);\n$input->setCustomFieldValues([]);\n$input->setLocal(null);\n$input->setCountry(\"US\");\n$input->setTags([23,45]);\n$input->setOwner(2);\n$id = 1;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->updateContact($input$id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateContact: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateContactInputObject input = new UpdateContactInputObject();\n\n        // Required parameters\n        input.setPhone(\"447860021130\");\n        input.setLists(\"10541,18599\");\n\n        // Optional parameters, you can skip these setters calls\n        input.setFirstName(\"Example first name\");\n        input.setLastName(\"Example first name\");\n        input.setEmail(\"charles@example.com\");\n        input.setCompanyName(\"My pretty company\");\n        input.setFavorited(null);\n        input.setBlocked(null);\n        input.setType(1);\n        input.setCustomFieldValues([]);\n        input.setLocal(null);\n        input.setCountry(\"US\");\n        input.setTags([23,45]);\n        input.setOwner(2);\n        int id = 1;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.updateContact(inputid);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateContact\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    phone: \"447860021130\",\n    lists: \"10541,18599\",\n    // Optional parameters\n    firstName: \"Example first name\",\n    lastName: \"Example first name\",\n    email: \"charles@example.com\",\n    companyName: \"My pretty company\",\n    favorited: null,\n    blocked: null,\n    type: 1,\n    customFieldValues: [],\n    local: null,\n    country: \"US\",\n    tags: [23,45],\n    owner: 2,\n}\nconst id = 1;\n\n\napi.updateContact(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateContactInputObject.new\n\n# Required parameters\nobj.phone = \"447860021130\"\nobj.lists = \"10541,18599\"\n# Optional parameters, you can skip them\nobj.first_name = \"Example first name\"\nobj.last_name = \"Example first name\"\nobj.email = \"charles@example.com\"\nobj.company_name = \"My pretty company\"\nobj.favorited = null\nobj.blocked = null\nobj.type = 1\nobj.custom_field_values = []\nobj.local = null\nobj.country = \"US\"\nobj.tags = [23,45]\nobj.owner = 2\nid = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.update_contact(input, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_contact: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateContactInputObject();\n\n            // Required parameters\n            obj.Phone = \"447860021130\";\n            obj.Lists = \"10541,18599\";\n\n            // Optional parameters, you can skip these setters calls\n            obj.FirstName = \"Example first name\";\n            obj.LastName = \"Example first name\";\n            obj.Email = \"charles@example.com\";\n            obj.CompanyName = \"My pretty company\";\n            obj.Favorited = null;\n            obj.Blocked = null;\n            obj.Type = 1;\n            obj.CustomFieldValues = [];\n            obj.Local = null;\n            obj.Country = \"US\";\n            obj.Tags = [23,45];\n            obj.Owner = 2;\n            int id = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.UpdateContact(objid);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateContact: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateContactInputObject With {\n            .FirstName = \"Example first name\",\n            .LastName = \"Example first name\",\n            .Phone = \"447860021130\",\n            .Email = \"charles@example.com\",\n            .CompanyName = \"My pretty company\",\n            .Lists = \"10541,18599\",\n            .Favorited = null,\n            .Blocked = null,\n            .Type = 1,\n            .CustomFieldValues = [],\n            .Local = null,\n            .Country = \"US\",\n            .Tags = [23,45],\n            .Owner = 2\n        }\n        Dim id As Integer = 1\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.UpdateContact(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateContact: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Phone: \"447860021130\",\n        Lists: \"10541,18599\",\n        // Optional parameters, you can skip them\n        FirstName: \"Example first name\",\n        LastName: \"Example first name\",\n        Email: \"charles@example.com\",\n        CompanyName: \"My pretty company\",\n        Favorited: null,\n        Blocked: null,\n        Type: 1,\n        CustomFieldValues: [],\n        Local: null,\n        Country: \"US\",\n        Tags: [23,45],\n        Owner: 2,\n    }\n    // Required\n    var id int32 = 1\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.UpdateContact(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateContactInputObject> input(new UpdateContactInputObject);\n    // Required parameters\n    input->setPhone(\"447860021130\");\n    input->setLists(\"10541,18599\");\n    // Optional parameters, you can skip them\n    input->setFirstName(\"Example first name\");\n    input->setLastName(\"Example first name\");\n    input->setEmail(\"charles@example.com\");\n    input->setCompanyName(\"My pretty company\");\n    input->setFavorited(null);\n    input->setBlocked(null);\n    input->setType(1);\n    input->setCustomFieldValues([]);\n    input->setLocal(null);\n    input->setCountry(\"US\");\n    input->setTags([23,45]);\n    input->setOwner(2);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.updateContact(input, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"updateContact() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateContactInputObject()\n\n# Required parameters\ninput.phone = \"447860021130\"\ninput.lists = \"10541,18599\"\n# Optional parameters, you can skip them\ninput.first_name = \"Example first name\"\ninput.last_name = \"Example first name\"\ninput.email = \"charles@example.com\"\ninput.company_name = \"My pretty company\"\ninput.favorited = null\ninput.blocked = null\ninput.type = 1\ninput.custom_field_values = []\ninput.local = null\ninput.country = \"US\"\ninput.tags = [23,45]\ninput.owner = 2\nid = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.update_contact(update_contact_input_object=input, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_contact: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateContactInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateContactInputObject->new(\n    # Required parameters\n    phone => '447860021130',\n    lists => '10541,18599',\n    # Optional parameters, you can skip them\n    firstName => 'Example first name',\n    lastName => 'Example first name',\n    email => 'charles@example.com',\n    companyName => 'My pretty company',\n    favorited => null,\n    blocked => null,\n    type => 1,\n    customFieldValues => [],\n    local => null,\n    country => 'US',\n    tags => [23,45],\n    owner => 2,\n);\nmy $id = 1;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->update_contact(update_contact_input_object => $input, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_contact: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/updateContact\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contact/all": {
      "delete": {
        "produces": [],
        "operationId": "deleteAllContacts",
        "summary": "Delete contacts (bulk)",
        "responses": {
          "204": {
            "description": "Request executed with success."
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    $api->deleteAllContacts();\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteAllContacts: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            apiInstance.deleteAllContacts();\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteAllContacts\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.deleteAllContacts().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    api.delete_all_contacts()\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_all_contacts: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                apiInstance.DeleteAllContacts();\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteAllContacts: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            apiInstance.DeleteAllContacts()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteAllContacts: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    client.TextMagicApi.DeleteAllContacts(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task result = api.deleteAllContacts();\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteAllContacts() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    api_instance.delete_all_contacts()\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_all_contacts: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    $api_instance->delete_all_contacts();\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_all_contacts: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/deleteAllContacts\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/delete": {
      "post": {
        "operationId": "deleteContactsByIds",
        "produces": [],
        "summary": "Delete contacts by IDs (bulk)",
        "parameters": [
          {
            "name": "DeleteContactsByIdsInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "integer",
                  "example": 0,
                  "enum": [
                    0,
                    1
                  ],
                  "description": "Optional. Default is 0 (false). If set to 1 all the entities will be removed."
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteContactsByIdsInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n\ntry {\n    $api->deleteContactsByIds($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteContactsByIds: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteContactsByIdsInputObject input = new DeleteContactsByIdsInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n\n        try {\n            apiInstance.deleteContactsByIds(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteContactsByIds\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\n\n\napi.deleteContactsByIds(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteContactsByIdsInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\n\nbegin\n    api.delete_contacts_by_ids(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_contacts_by_ids: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteContactsByIdsInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n\n            try {\n                apiInstance.DeleteContactsByIds(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteContactsByIds: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteContactsByIdsInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n\n        Try\n            apiInstance.DeleteContactsByIds(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteContactsByIds: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n\n    client.TextMagicApi.DeleteContactsByIds(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteContactsByIdsInputObject> input(new DeleteContactsByIdsInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    try {\n        pplx::task result = api.deleteContactsByIds(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteContactsByIds() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteContactsByIdsInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\n\ntry:\n    api_instance.delete_contacts_by_ids(delete_contacts_by_ids_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_contacts_by_ids: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteContactsByIdsInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteContactsByIdsInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\n\neval {\n    $api_instance->delete_contacts_by_ids(delete_contacts_by_ids_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_contacts_by_ids: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/deleteContactsByIds\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/unsubscribers": {
      "get": {
        "operationId": "getUnsubscribers",
        "summary": "Get all unsubscribed contacts",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/getUnsubscribers\" target=\"_blank\">Try in sandbox</a><br>When one of your message recipients sends a request with one of the [STOP-words](https://www.textmagic.com/sms-stop-command/), they will be immediately opted-out of your send lists and their contact status will change to an unsubscribed contact. To retrieve information on all contacts who have unsubscribed status, use:\n",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetUnsubscribersPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getUnsubscribers method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // GetUnsubscribersPaginatedResponse class object\n    $result = $api->getUnsubscribers($page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getUnsubscribers: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getUnsubscribers method below, default values will be used\n        int page = 1;\n        int limit = 10;\n\n        try {\n            // GetUnsubscribersPaginatedResponse class object\n            GetUnsubscribersPaginatedResponse obj = apiInstance.getUnsubscribers(page, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getUnsubscribers\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getUnsubscribers(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # GetUnsubscribersPaginatedResponse object\n    result = api.get_unsubscribers(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_unsubscribers: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getUnsubscribers method below, default values will be used\n            int page = 1;\n            int limit = 10;\n\n            try {\n                // GetUnsubscribersPaginatedResponse class object\n                var result = apiInstance.GetUnsubscribers(page, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getUnsubscribers: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getUnsubscribers method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' GetUnsubscribersPaginatedResponse class object\n            Dim result = apiInstance.GetUnsubscribers(page, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getUnsubscribers: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetUnsubscribersOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.GetUnsubscribersPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetUnsubscribers(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<GetUnsubscribersPaginatedResponse>> result = api.getUnsubscribers(page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getUnsubscribers() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # GetUnsubscribersPaginatedResponse object\n    result = api_instance.get_unsubscribers(page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_unsubscribers: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # GetUnsubscribersPaginatedResponse object\n    my $result = $api_instance->get_unsubscribers(page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_unsubscribers: $@\\n\";\n}"
          }
        ]
      },
      "post": {
        "operationId": "unsubscribeContact",
        "summary": "Manually unsubscribe a contact",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/unsubscribeContact\" target=\"_blank\">Try in sandbox</a><br>> Please note, if you unsubscribe a contact, this action cannot be reversed.\n",
        "parameters": [
          {
            "name": "UnsubscribeContactInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "phone": {
                  "type": "string",
                  "description": "Contact phone number.",
                  "example": "447860021130"
                },
                "blockIncoming": {
                  "type": "integer",
                  "example": 0,
                  "default": 0,
                  "enum": [
                    0,
                    1
                  ],
                  "description": "If set to 1, incoming messages from this number will be blocked."
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when updated with success.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UnsubscribeContactInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setPhone(\"447860021130\");\n$input->setBlockIncoming(null);\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->unsubscribeContact($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->unsubscribeContact: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UnsubscribeContactInputObject input = new UnsubscribeContactInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setPhone(\"447860021130\");\n        input.setBlockIncoming(null);\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.unsubscribeContact(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling unsubscribeContact\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    phone: \"447860021130\",\n    blockIncoming: null,\n}\n\n\napi.unsubscribeContact(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UnsubscribeContactInputObject.new\n# Optional parameters, you can skip them\nobj.phone = \"447860021130\"\nobj.block_incoming = null\n\nbegin\n    # ResourceLinkResponse object\n    result = api.unsubscribe_contact(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->unsubscribe_contact: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UnsubscribeContactInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Phone = \"447860021130\";\n            obj.BlockIncoming = null;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.UnsubscribeContact(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling unsubscribeContact: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UnsubscribeContactInputObject With {\n            .Phone = \"447860021130\",\n            .BlockIncoming = null\n        }\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.UnsubscribeContact(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling unsubscribeContact: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Phone: \"447860021130\",\n        BlockIncoming: null,\n    }\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.UnsubscribeContact(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UnsubscribeContactInputObject> input(new UnsubscribeContactInputObject);\n    // Optional parameters, you can skip them\n    input->setPhone(\"447860021130\");\n    input->setBlockIncoming(null);\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.unsubscribeContact(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"unsubscribeContact() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UnsubscribeContactInputObject()\n# Optional parameters, you can skip them\ninput.phone = \"447860021130\"\ninput.block_incoming = null\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.unsubscribe_contact(unsubscribe_contact_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->unsubscribe_contact: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UnsubscribeContactInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UnsubscribeContactInputObject->new(\n    # Optional parameters, you can skip them\n    phone => '447860021130',\n    blockIncoming => null,\n);\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->unsubscribe_contact(unsubscribe_contact_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->unsubscribe_contact: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/unsubscribers/{id}": {
      "get": {
        "operationId": "getUnsubscribedContact",
        "summary": "Get the details of a specific unsubscribed contact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/UnsubscribedContact"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // UnsubscribedContact class object\n    $result = $api->getUnsubscribedContact($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getUnsubscribedContact: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // UnsubscribedContact class object\n            UnsubscribedContact obj = apiInstance.getUnsubscribedContact(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getUnsubscribedContact\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getUnsubscribedContact(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # UnsubscribedContact object\n    result = api.get_unsubscribed_contact(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_unsubscribed_contact: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // UnsubscribedContact class object\n                var result = apiInstance.GetUnsubscribedContact(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getUnsubscribedContact: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' UnsubscribedContact class object\n            Dim result = apiInstance.GetUnsubscribedContact(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getUnsubscribedContact: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.UnsubscribedContact struct\n    result, _, err := client.TextMagicApi.GetUnsubscribedContact(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<UnsubscribedContact>> result = api.getUnsubscribedContact(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getUnsubscribedContact() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # UnsubscribedContact object\n    result = api_instance.get_unsubscribed_contact(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_unsubscribed_contact: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # UnsubscribedContact object\n    my $result = $api_instance->get_unsubscribed_contact(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_unsubscribed_contact: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/getUnsubscribedContact\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/customfields": {
      "get": {
        "operationId": "getCustomFields",
        "summary": "Get all custom fields",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Requested custom fields have been returned with success.",
            "schema": {
              "$ref": "#/definitions/GetCustomFieldsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Custom Fields"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getCustomFields method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // GetCustomFieldsPaginatedResponse class object\n    $result = $api->getCustomFields($page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getCustomFields: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getCustomFields method below, default values will be used\n        int page = 1;\n        int limit = 10;\n\n        try {\n            // GetCustomFieldsPaginatedResponse class object\n            GetCustomFieldsPaginatedResponse obj = apiInstance.getCustomFields(page, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getCustomFields\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getCustomFields(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # GetCustomFieldsPaginatedResponse object\n    result = api.get_custom_fields(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_custom_fields: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getCustomFields method below, default values will be used\n            int page = 1;\n            int limit = 10;\n\n            try {\n                // GetCustomFieldsPaginatedResponse class object\n                var result = apiInstance.GetCustomFields(page, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getCustomFields: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getCustomFields method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' GetCustomFieldsPaginatedResponse class object\n            Dim result = apiInstance.GetCustomFields(page, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getCustomFields: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetCustomFieldsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.GetCustomFieldsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetCustomFields(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<GetCustomFieldsPaginatedResponse>> result = api.getCustomFields(page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getCustomFields() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # GetCustomFieldsPaginatedResponse object\n    result = api_instance.get_custom_fields(page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_custom_fields: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # GetCustomFieldsPaginatedResponse object\n    my $result = $api_instance->get_custom_fields(page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_custom_fields: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Custom%20Fields/getCustomFields\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "post": {
        "operationId": "createCustomField",
        "summary": "Add a new custom field",
        "parameters": [
          {
            "name": "CreateCustomFieldInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "name"
              ],
              "additionalProperties": false,
              "properties": {
                "name": {
                  "description": "Custom field name.",
                  "type": "string",
                  "example": "DOB"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Contact has been created with success.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Custom Fields"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new CreateCustomFieldInputObject();\n\n// Required parameters\n$input->setName(\"DOB\");\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->createCustomField($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->createCustomField: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        CreateCustomFieldInputObject input = new CreateCustomFieldInputObject();\n\n        // Required parameters\n        input.setName(\"DOB\");\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.createCustomField(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling createCustomField\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    name: \"DOB\",\n}\n\n\napi.createCustomField(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::CreateCustomFieldInputObject.new\n\n# Required parameters\nobj.name = \"DOB\"\n\nbegin\n    # ResourceLinkResponse object\n    result = api.create_custom_field(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->create_custom_field: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new CreateCustomFieldInputObject();\n\n            // Required parameters\n            obj.Name = \"DOB\";\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.CreateCustomField(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling createCustomField: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New CreateCustomFieldInputObject With {\n            .Name = \"DOB\"\n        }\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.CreateCustomField(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling createCustomField: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Name: \"DOB\",\n    }\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.CreateCustomField(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<CreateCustomFieldInputObject> input(new CreateCustomFieldInputObject);\n    // Required parameters\n    input->setName(\"DOB\");\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.createCustomField(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"createCustomField() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.CreateCustomFieldInputObject()\n\n# Required parameters\ninput.name = \"DOB\"\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.create_custom_field(create_custom_field_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->create_custom_field: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::CreateCustomFieldInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::CreateCustomFieldInputObject->new(\n    # Required parameters\n    name => 'DOB',\n);\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->create_custom_field(create_custom_field_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->create_custom_field: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Custom%20Fields/createCustomField\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/customfields/{id}": {
      "get": {
        "operationId": "getCustomField",
        "summary": "Get the details of a specific custom field",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/UserCustomField"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Custom Fields"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // UserCustomField class object\n    $result = $api->getCustomField($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getCustomField: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // UserCustomField class object\n            UserCustomField obj = apiInstance.getCustomField(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getCustomField\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getCustomField(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # UserCustomField object\n    result = api.get_custom_field(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_custom_field: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // UserCustomField class object\n                var result = apiInstance.GetCustomField(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getCustomField: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' UserCustomField class object\n            Dim result = apiInstance.GetCustomField(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getCustomField: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.UserCustomField struct\n    result, _, err := client.TextMagicApi.GetCustomField(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<UserCustomField>> result = api.getCustomField(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getCustomField() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # UserCustomField object\n    result = api_instance.get_custom_field(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_custom_field: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # UserCustomField object\n    my $result = $api_instance->get_custom_field(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_custom_field: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Custom%20Fields/getCustomField\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "put": {
        "operationId": "updateCustomField",
        "summary": "Edit a custom field",
        "parameters": [
          {
            "name": "UpdateCustomFieldInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "name"
              ],
              "additionalProperties": false,
              "properties": {
                "name": {
                  "description": "Custom field name.",
                  "type": "string",
                  "example": "DOB"
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when updated with success.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Custom Fields"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateCustomFieldInputObject();\n\n// Required parameters\n$input->setName(\"DOB\");\n$id = 1;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->updateCustomField($input$id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateCustomField: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateCustomFieldInputObject input = new UpdateCustomFieldInputObject();\n\n        // Required parameters\n        input.setName(\"DOB\");\n        int id = 1;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.updateCustomField(inputid);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateCustomField\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    name: \"DOB\",\n}\nconst id = 1;\n\n\napi.updateCustomField(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateCustomFieldInputObject.new\n\n# Required parameters\nobj.name = \"DOB\"\nid = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.update_custom_field(input, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_custom_field: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateCustomFieldInputObject();\n\n            // Required parameters\n            obj.Name = \"DOB\";\n            int id = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.UpdateCustomField(objid);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateCustomField: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateCustomFieldInputObject With {\n            .Name = \"DOB\"\n        }\n        Dim id As Integer = 1\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.UpdateCustomField(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateCustomField: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Name: \"DOB\",\n    }\n    // Required\n    var id int32 = 1\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.UpdateCustomField(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateCustomFieldInputObject> input(new UpdateCustomFieldInputObject);\n    // Required parameters\n    input->setName(\"DOB\");\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.updateCustomField(input, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"updateCustomField() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateCustomFieldInputObject()\n\n# Required parameters\ninput.name = \"DOB\"\nid = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.update_custom_field(update_custom_field_input_object=input, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_custom_field: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateCustomFieldInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateCustomFieldInputObject->new(\n    # Required parameters\n    name => 'DOB',\n);\nmy $id = 1;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->update_custom_field(update_custom_field_input_object => $input, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_custom_field: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Custom%20Fields/updateCustomField\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteCustomField",
        "produces": [],
        "summary": "Delete a custom field",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Custom%20Fields/deleteCustomField\" target=\"_blank\">Try in sandbox</a><br>> When a custom field is deleted, all the information that was added to contacts under this custom field will also be lost.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Returned when deleted with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Custom Fields"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteCustomField($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteCustomField: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteCustomField(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteCustomField\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteCustomField(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_custom_field(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_custom_field: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteCustomField(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteCustomField: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteCustomField(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteCustomField: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteCustomField(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteCustomField(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteCustomField() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_custom_field(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_custom_field: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_custom_field(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_custom_field: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/customfields/{id}/update": {
      "put": {
        "operationId": "updateCustomFieldValue",
        "summary": "Edit the custom field value of a specified contact",
        "parameters": [
          {
            "name": "UpdateCustomFieldValueInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "contactId": {
                  "type": "integer",
                  "example": 50315,
                  "description": "Contact ID. See [Contact](https://docs.textmagic.com/#tag/Contacts).\n"
                },
                "value": {
                  "type": "string",
                  "description": "Custom field value. Note that this value is not parsed in any way; it is stored and used in dynamic fields exactly as you send it.",
                  "example": "1983-08-31T00:00:00.000Z"
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 554
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when updated with success.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Custom Fields"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateCustomFieldValueInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setContactId(50315);\n$input->setValue(\"1983-08-31T00:00:00.000Z\");\n$id = 554;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->updateCustomFieldValue($input$id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateCustomFieldValue: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateCustomFieldValueInputObject input = new UpdateCustomFieldValueInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setContactId(50315);\n        input.setValue(\"1983-08-31T00:00:00.000Z\");\n        int id = 554;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.updateCustomFieldValue(inputid);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateCustomFieldValue\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    contactId: 50315,\n    value: \"1983-08-31T00:00:00.000Z\",\n}\nconst id = 554;\n\n\napi.updateCustomFieldValue(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateCustomFieldValueInputObject.new\n# Optional parameters, you can skip them\nobj.contact_id = 50315\nobj.value = \"1983-08-31T00:00:00.000Z\"\nid = 554\n\nbegin\n    # ResourceLinkResponse object\n    result = api.update_custom_field_value(input, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_custom_field_value: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateCustomFieldValueInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.ContactId = 50315;\n            obj.Value = \"1983-08-31T00:00:00.000Z\";\n            int id = 554;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.UpdateCustomFieldValue(objid);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateCustomFieldValue: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateCustomFieldValueInputObject With {\n            .ContactId = 50315,\n            .Value = \"1983-08-31T00:00:00.000Z\"\n        }\n        Dim id As Integer = 554\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.UpdateCustomFieldValue(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateCustomFieldValue: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        ContactId: 50315,\n        Value: \"1983-08-31T00:00:00.000Z\",\n    }\n    // Required\n    var id int32 = 554\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.UpdateCustomFieldValue(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateCustomFieldValueInputObject> input(new UpdateCustomFieldValueInputObject);\n    // Optional parameters, you can skip them\n    input->setContactId(50315);\n    input->setValue(\"1983-08-31T00:00:00.000Z\");\n\n    int id = 554;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.updateCustomFieldValue(input, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"updateCustomFieldValue() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateCustomFieldValueInputObject()\n# Optional parameters, you can skip them\ninput.contact_id = 50315\ninput.value = \"1983-08-31T00:00:00.000Z\"\nid = 554\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.update_custom_field_value(update_custom_field_value_input_object=input, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_custom_field_value: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateCustomFieldValueInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateCustomFieldValueInputObject->new(\n    # Optional parameters, you can skip them\n    contactId => 50315,\n    value => \"1983-08-31T00:00:00.000Z\",\n);\nmy $id = 554;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->update_custom_field_value(update_custom_field_value_input_object => $input, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_custom_field_value: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Custom%20Fields/updateCustomFieldValue\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/lists": {
      "get": {
        "operationId": "getLists",
        "summary": "Get all lists",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "The current fetched page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "firstName",
              "lastName"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          },
          {
            "name": "favoriteOnly",
            "in": "query",
            "required": false,
            "description": "Return only favorited lists.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "onlyMine",
            "in": "query",
            "required": false,
            "description": "Return only current user lists.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetListsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getLists method below, default values will be used\n$page = 1;\n$limit = 10;\n$orderBy = \"id\";\n$direction = \"desc\";\n$favoriteOnly = 0;\n$onlyMine = 0;\n\ntry {\n    // GetListsPaginatedResponse class object\n    $result = $api->getLists($page, $limit, $orderBy, $direction, $favoriteOnly, $onlyMine);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getLists: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getLists method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String orderBy = \"id\";\n        String direction = \"desc\";\n        int favoriteOnly = 0;\n        int onlyMine = 0;\n\n        try {\n            // GetListsPaginatedResponse class object\n            GetListsPaginatedResponse obj = apiInstance.getLists(page, limit, orderBy, direction, favoriteOnly, onlyMine);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getLists\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    orderBy: \"id\",\n    direction: \"desc\",\n    favoriteOnly: 0,\n    onlyMine: 0,\n};\n\napi.getLists(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  order_by: 'id',\n  direction: 'desc',\n  favorite_only: 0,\n  only_mine: 0,\n}\n\nbegin\n    # GetListsPaginatedResponse object\n    result = api.get_lists(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_lists: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getLists method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string orderBy = \"id\";\n            string direction = \"desc\";\n            int favoriteOnly = 0;\n            int onlyMine = 0;\n\n            try {\n                // GetListsPaginatedResponse class object\n                var result = apiInstance.GetLists(page, limit, orderBy, direction, favoriteOnly, onlyMine);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getLists: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getLists method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n        Dim favoriteOnly As Integer = 0\n        Dim onlyMine As Integer = 0\n\n        Try\n            ' GetListsPaginatedResponse class object\n            Dim result = apiInstance.GetLists(page, limit, orderBy, direction, favoriteOnly, onlyMine)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getLists: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetListsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n        FavoriteOnly: optional.NewInt32(0),\n        OnlyMine: optional.NewInt32(0),\n    }\n\n    // tm.GetListsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetLists(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n    int favoriteOnly = 0;\n    int onlyMine = 0;\n\n    try {\n        pplx::task<std::shared_ptr<GetListsPaginatedResponse>> result = api.getLists(page, limit, orderBy, direction, favoriteOnly, onlyMine);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getLists() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\norder_by = \"id\"\ndirection = \"desc\"\nfavorite_only = 0\nonly_mine = 0\n\ntry:\n    # GetListsPaginatedResponse object\n    result = api_instance.get_lists(page=page, limit=limit, order_by=order_by, direction=direction, favorite_only=favorite_only, only_mine=only_mine)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_lists: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $orderBy = 'id';\nmy $direction = 'desc';\nmy $favoriteOnly = 0;\nmy $onlyMine = 0;\n\neval {\n    # GetListsPaginatedResponse object\n    my $result = $api_instance->get_lists(page => $page, limit => $limit, orderBy => $orderBy, direction => $direction, favoriteOnly => $favoriteOnly, onlyMine => $onlyMine);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_lists: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/getLists\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "post": {
        "operationId": "createList",
        "summary": "Create a new list",
        "parameters": [
          {
            "name": "CreateListInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "name"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "List name.",
                  "example": "Private list"
                },
                "shared": {
                  "description": "Should the new list be **shared** among all the sub-accounts?",
                  "type": "boolean",
                  "default": false,
                  "example": false
                },
                "favorited": {
                  "description": "Is the list favorited? Default is false.",
                  "type": "boolean",
                  "default": false,
                  "example": false
                },
                "isDefault": {
                  "description": "Is the list default for new contacts (web only)?",
                  "type": "boolean",
                  "default": false,
                  "example": false
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new CreateListInputObject();\n\n// Required parameters\n$input->setName(\"Private list\");\n\n// Optional parameters, you can skip these setters calls\n$input->setShared(null);\n$input->setFavorited(null);\n$input->setIsDefault(null);\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->createList($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->createList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        CreateListInputObject input = new CreateListInputObject();\n\n        // Required parameters\n        input.setName(\"Private list\");\n\n        // Optional parameters, you can skip these setters calls\n        input.setShared(null);\n        input.setFavorited(null);\n        input.setIsDefault(null);\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.createList(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling createList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    name: \"Private list\",\n    // Optional parameters\n    shared: null,\n    favorited: null,\n    isDefault: null,\n}\n\n\napi.createList(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::CreateListInputObject.new\n\n# Required parameters\nobj.name = \"Private list\"\n# Optional parameters, you can skip them\nobj.shared = null\nobj.favorited = null\nobj.is_default = null\n\nbegin\n    # ResourceLinkResponse object\n    result = api.create_list(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->create_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new CreateListInputObject();\n\n            // Required parameters\n            obj.Name = \"Private list\";\n\n            // Optional parameters, you can skip these setters calls\n            obj.Shared = null;\n            obj.Favorited = null;\n            obj.IsDefault = null;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.CreateList(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling createList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New CreateListInputObject With {\n            .Name = \"Private list\",\n            .Shared = null,\n            .Favorited = null,\n            .IsDefault = null\n        }\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.CreateList(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling createList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Name: \"Private list\",\n        // Optional parameters, you can skip them\n        Shared: null,\n        Favorited: null,\n        IsDefault: null,\n    }\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.CreateList(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<CreateListInputObject> input(new CreateListInputObject);\n    // Required parameters\n    input->setName(\"Private list\");\n    // Optional parameters, you can skip them\n    input->setShared(null);\n    input->setFavorited(null);\n    input->setIsDefault(null);\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.createList(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"createList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.CreateListInputObject()\n\n# Required parameters\ninput.name = \"Private list\"\n# Optional parameters, you can skip them\ninput.shared = null\ninput.favorited = null\ninput.is_default = null\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.create_list(create_list_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->create_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::CreateListInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::CreateListInputObject->new(\n    # Required parameters\n    name => 'Private list',\n    # Optional parameters, you can skip them\n    shared => null,\n    favorited => null,\n    isDefault => null,\n);\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->create_list(create_list_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->create_list: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/createList\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/lists/search": {
      "get": {
        "operationId": "searchLists",
        "summary": "Find lists by given criteria",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "description": "Find lists by IDs.",
            "type": "string",
            "x-example": "1,2,3,4"
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Find lists by specified search query.",
            "type": "string",
            "x-example": "A"
          },
          {
            "name": "onlyMine",
            "in": "query",
            "required": false,
            "description": "Return only current user lists.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "onlyDefault",
            "in": "query",
            "required": false,
            "description": "Return only default lists.",
            "type": "integer",
            "default": 0
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "firstName",
              "lastName"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/SearchListsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to searchLists method below, default values will be used\n$page = 1;\n$limit = 10;\n$ids = \"1,2,3,4\";\n$query = \"A\";\n$onlyMine = 0;\n$onlyDefault = 0;\n$orderBy = \"id\";\n$direction = \"desc\";\n\ntry {\n    // SearchListsPaginatedResponse class object\n    $result = $api->searchLists($page, $limit, $ids, $query, $onlyMine, $onlyDefault, $orderBy, $direction);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->searchLists: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to searchLists method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String ids = \"1,2,3,4\";\n        String query = \"A\";\n        int onlyMine = 0;\n        int onlyDefault = 0;\n        String orderBy = \"id\";\n        String direction = \"desc\";\n\n        try {\n            // SearchListsPaginatedResponse class object\n            SearchListsPaginatedResponse obj = apiInstance.searchLists(page, limit, ids, query, onlyMine, onlyDefault, orderBy, direction);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling searchLists\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    ids: \"1,2,3,4\",\n    query: \"A\",\n    onlyMine: 0,\n    onlyDefault: 0,\n    orderBy: \"id\",\n    direction: \"desc\",\n};\n\napi.searchLists(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  ids: '1,2,3,4',\n  query: 'A',\n  only_mine: 0,\n  only_default: 0,\n  order_by: 'id',\n  direction: 'desc',\n}\n\nbegin\n    # SearchListsPaginatedResponse object\n    result = api.search_lists(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->search_lists: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to searchLists method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string ids = \"1,2,3,4\";\n            string query = \"A\";\n            int onlyMine = 0;\n            int onlyDefault = 0;\n            string orderBy = \"id\";\n            string direction = \"desc\";\n\n            try {\n                // SearchListsPaginatedResponse class object\n                var result = apiInstance.SearchLists(page, limit, ids, query, onlyMine, onlyDefault, orderBy, direction);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling searchLists: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to searchLists method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim ids As String = \"1,2,3,4\"\n        Dim query As String = \"A\"\n        Dim onlyMine As Integer = 0\n        Dim onlyDefault As Integer = 0\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n\n        Try\n            ' SearchListsPaginatedResponse class object\n            Dim result = apiInstance.SearchLists(page, limit, ids, query, onlyMine, onlyDefault, orderBy, direction)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling searchLists: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.SearchListsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Ids: optional.NewString(\"1,2,3,4\"),\n        Query: optional.NewString(\"A\"),\n        OnlyMine: optional.NewInt32(0),\n        OnlyDefault: optional.NewInt32(0),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n    }\n\n    // tm.SearchListsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.SearchLists(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string ids = \"1,2,3,4\";\n    std::string query = \"A\";\n    int onlyMine = 0;\n    int onlyDefault = 0;\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n\n    try {\n        pplx::task<std::shared_ptr<SearchListsPaginatedResponse>> result = api.searchLists(page, limit, ids, query, onlyMine, onlyDefault, orderBy, direction);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"searchLists() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nids = \"1,2,3,4\"\nquery = \"A\"\nonly_mine = 0\nonly_default = 0\norder_by = \"id\"\ndirection = \"desc\"\n\ntry:\n    # SearchListsPaginatedResponse object\n    result = api_instance.search_lists(page=page, limit=limit, ids=ids, query=query, only_mine=only_mine, only_default=only_default, order_by=order_by, direction=direction)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->search_lists: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $ids = '1,2,3,4';\nmy $query = 'A';\nmy $onlyMine = 0;\nmy $onlyDefault = 0;\nmy $orderBy = 'id';\nmy $direction = 'desc';\n\neval {\n    # SearchListsPaginatedResponse object\n    my $result = $api_instance->search_lists(page => $page, limit => $limit, ids => $ids, query => $query, onlyMine => $onlyMine, onlyDefault => $onlyDefault, orderBy => $orderBy, direction => $direction);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->search_lists: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/searchLists\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/{id}/lists": {
      "get": {
        "operationId": "getListsOfContact",
        "summary": "Get a contact's lists",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/getListsOfContact\" target=\"_blank\">Try in sandbox</a><br>Get all the lists in which a contact is included.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetListsOfContactPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n// Optional, you can pass them as null values to getListsOfContact method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // GetListsOfContactPaginatedResponse class object\n    $result = $api->getListsOfContact($id, $page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getListsOfContact: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n        // Optional, you can pass them as null values to getListsOfContact method below, default values will be used\n        int page = 1;\n        int limit = 10;\n\n        try {\n            // GetListsOfContactPaginatedResponse class object\n            GetListsOfContactPaginatedResponse obj = apiInstance.getListsOfContact(id, page, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getListsOfContact\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getListsOfContact(id, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # GetListsOfContactPaginatedResponse object\n    result = api.get_lists_of_contact(id, params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_lists_of_contact: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n            // Optional, you can pass them as null values to getListsOfContact method below, default values will be used\n            int page = 1;\n            int limit = 10;\n\n            try {\n                // GetListsOfContactPaginatedResponse class object\n                var result = apiInstance.GetListsOfContact(id, page, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getListsOfContact: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n        ' Optional, you can pass them as null values to getListsOfContact method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' GetListsOfContactPaginatedResponse class object\n            Dim result = apiInstance.GetListsOfContact(id, page, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getListsOfContact: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    opts := tm.GetListsOfContactOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.GetListsOfContactPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetListsOfContact(auth, id, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<GetListsOfContactPaginatedResponse>> result = api.getListsOfContact(id, page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getListsOfContact() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # GetListsOfContactPaginatedResponse object\n    result = api_instance.get_lists_of_contact(id=id, page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_lists_of_contact: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # GetListsOfContactPaginatedResponse object\n    my $result = $api_instance->get_lists_of_contact(id => $id, page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_lists_of_contact: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/contacts/favorite": {
      "get": {
        "operationId": "getFavorites",
        "summary": "Get favorite contacts and lists",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Find contacts or lists by specified search query.",
            "type": "string",
            "x-example": "A"
          }
        ],
        "responses": {
          "200": {
            "description": "Favorite entities have been returned with success.",
            "schema": {
              "$ref": "#/definitions/GetFavoritesPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getFavorites method below, default values will be used\n$page = 1;\n$limit = 10;\n$query = \"A\";\n\ntry {\n    // GetFavoritesPaginatedResponse class object\n    $result = $api->getFavorites($page, $limit, $query);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getFavorites: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getFavorites method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String query = \"A\";\n\n        try {\n            // GetFavoritesPaginatedResponse class object\n            GetFavoritesPaginatedResponse obj = apiInstance.getFavorites(page, limit, query);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getFavorites\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    query: \"A\",\n};\n\napi.getFavorites(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  query: 'A',\n}\n\nbegin\n    # GetFavoritesPaginatedResponse object\n    result = api.get_favorites(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_favorites: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getFavorites method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string query = \"A\";\n\n            try {\n                // GetFavoritesPaginatedResponse class object\n                var result = apiInstance.GetFavorites(page, limit, query);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getFavorites: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getFavorites method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim query As String = \"A\"\n\n        Try\n            ' GetFavoritesPaginatedResponse class object\n            Dim result = apiInstance.GetFavorites(page, limit, query)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getFavorites: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetFavoritesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Query: optional.NewString(\"A\"),\n    }\n\n    // tm.GetFavoritesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetFavorites(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string query = \"A\";\n\n    try {\n        pplx::task<std::shared_ptr<GetFavoritesPaginatedResponse>> result = api.getFavorites(page, limit, query);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getFavorites() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nquery = \"A\"\n\ntry:\n    # GetFavoritesPaginatedResponse object\n    result = api_instance.get_favorites(page=page, limit=limit, query=query)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_favorites: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $query = 'A';\n\neval {\n    # GetFavoritesPaginatedResponse object\n    my $result = $api_instance->get_favorites(page => $page, limit => $limit, query => $query);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_favorites: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/getFavorites\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/lists/{id}": {
      "get": {
        "operationId": "getList",
        "summary": "Get the details of a specific list",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/List"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // List class object\n    $result = $api->getList($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // List class object\n            List obj = apiInstance.getList(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getList(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # List object\n    result = api.get_list(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // List class object\n                var result = apiInstance.GetList(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' List class object\n            Dim result = apiInstance.GetList(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.List struct\n    result, _, err := client.TextMagicApi.GetList(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<List>> result = api.getList(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # List object\n    result = api_instance.get_list(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # List object\n    my $result = $api_instance->get_list(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_list: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/getList\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "put": {
        "operationId": "updateList",
        "summary": "Edit a list",
        "parameters": [
          {
            "name": "updateListObject",
            "in": "body",
            "schema": {
              "required": [
                "name"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "List name.",
                  "example": "Private list"
                },
                "shared": {
                  "type": "boolean",
                  "description": "Make this list shared or not?",
                  "example": true,
                  "default": false
                },
                "favorited": {
                  "type": "boolean",
                  "description": "Is list favorited.",
                  "example": true,
                  "default": false
                },
                "isDefault": {
                  "type": "boolean",
                  "description": "Is list default for new contacts (web only).",
                  "example": true,
                  "default": false
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Returned when the form has errors."
          },
          "403": {
            "description": "Returned when trying to edit a list shared to a current user."
          },
          "404": {
            "description": "Returned when no list found."
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateListInputObject();\n\n// Required parameters\n$input->setName(\"Private list\");\n\n// Optional parameters, you can skip these setters calls\n$input->setShared(true);\n$input->setFavorited(true);\n$input->setIsDefault(true);\n$id = 1;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->updateList($input$id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateListInputObject input = new UpdateListInputObject();\n\n        // Required parameters\n        input.setName(\"Private list\");\n\n        // Optional parameters, you can skip these setters calls\n        input.setShared(true);\n        input.setFavorited(true);\n        input.setIsDefault(true);\n        int id = 1;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.updateList(inputid);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    name: \"Private list\",\n    // Optional parameters\n    shared: true,\n    favorited: true,\n    isDefault: true,\n}\nconst id = 1;\n\n\napi.updateList(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateListInputObject.new\n\n# Required parameters\nobj.name = \"Private list\"\n# Optional parameters, you can skip them\nobj.shared = true\nobj.favorited = true\nobj.is_default = true\nid = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.update_list(input, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateListInputObject();\n\n            // Required parameters\n            obj.Name = \"Private list\";\n\n            // Optional parameters, you can skip these setters calls\n            obj.Shared = true;\n            obj.Favorited = true;\n            obj.IsDefault = true;\n            int id = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.UpdateList(objid);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateListInputObject With {\n            .Name = \"Private list\",\n            .Shared = true,\n            .Favorited = true,\n            .IsDefault = true\n        }\n        Dim id As Integer = 1\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.UpdateList(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Name: \"Private list\",\n        // Optional parameters, you can skip them\n        Shared: true,\n        Favorited: true,\n        IsDefault: true,\n    }\n    // Required\n    var id int32 = 1\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.UpdateList(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateListInputObject> input(new UpdateListInputObject);\n    // Required parameters\n    input->setName(\"Private list\");\n    // Optional parameters, you can skip them\n    input->setShared(true);\n    input->setFavorited(true);\n    input->setIsDefault(true);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.updateList(input, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"updateList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateListInputObject()\n\n# Required parameters\ninput.name = \"Private list\"\n# Optional parameters, you can skip them\ninput.shared = true\ninput.favorited = true\ninput.is_default = true\nid = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.update_list(update_list_input_object=input, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateListInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateListInputObject->new(\n    # Required parameters\n    name => 'Private list',\n    # Optional parameters, you can skip them\n    shared => 1,\n    favorited => 1,\n    isDefault => 1,\n);\nmy $id = 1;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->update_list(update_list_input_object => $input, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_list: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/updateList\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteList",
        "summary": "Delete a list",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/deleteList\" target=\"_blank\">Try in sandbox</a><br>This command has no parameters. If successful, this command will return the standard delete response (204 No Content); otherwise, a standard error response will be returned.\n\nWhen you delete a list, the contacts in it are deleted as well, unless they were saved in another list.",
        "produces": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Returned when trying to remove a list associated with a signup form."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when trying to remove a list shared to you."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteList($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteList(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteList(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_list(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteList(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteList(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteList(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteList(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_list(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_list(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_list: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/lists/delete": {
      "post": {
        "operationId": "deleteListsBulk",
        "summary": "Delete lists (bulk)",
        "produces": [],
        "parameters": [
          {
            "name": "DeleteListsBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "integer",
                  "example": 0,
                  "enum": [
                    0,
                    1
                  ],
                  "description": "Default is 0 (false). If set to 1, all the entities will be removed."
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteListsBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n\ntry {\n    $api->deleteListsBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteListsBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteListsBulkInputObject input = new DeleteListsBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n\n        try {\n            apiInstance.deleteListsBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteListsBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\n\n\napi.deleteListsBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteListsBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\n\nbegin\n    api.delete_lists_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_lists_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteListsBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n\n            try {\n                apiInstance.DeleteListsBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteListsBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteListsBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n\n        Try\n            apiInstance.DeleteListsBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteListsBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n\n    client.TextMagicApi.DeleteListsBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteListsBulkInputObject> input(new DeleteListsBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    try {\n        pplx::task result = api.deleteListsBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteListsBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteListsBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\n\ntry:\n    api_instance.delete_lists_bulk(delete_lists_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_lists_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteListsBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteListsBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\n\neval {\n    $api_instance->delete_lists_bulk(delete_lists_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_lists_bulk: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/deleteListsBulk\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/distribution-lists": {
      "get": {
        "operationId": "getDistributionLists",
        "summary": "Get all distribution lists",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "The current fetched page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Find distribution lists by name or email.",
            "type": "string",
            "x-example": "alerts"
          },
          {
            "name": "orderBy",
            "in": "query",
            "required": false,
            "description": "Order results by some field. Default is email.",
            "type": "string",
            "default": "email",
            "enum": [
              "email",
              "name",
              "membersCount"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetDistributionListsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Distribution Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getDistributionLists method below, default values will be used\n$page = 1;\n$limit = 10;\n$query = \"alerts\";\n$orderBy = \"email\";\n$direction = \"desc\";\n\ntry {\n    // GetDistributionListsPaginatedResponse class object\n    $result = $api->getDistributionLists($page, $limit, $query, $orderBy, $direction);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getDistributionLists: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getDistributionLists method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String query = \"alerts\";\n        String orderBy = \"email\";\n        String direction = \"desc\";\n\n        try {\n            // GetDistributionListsPaginatedResponse class object\n            GetDistributionListsPaginatedResponse obj = apiInstance.getDistributionLists(page, limit, query, orderBy, direction);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getDistributionLists\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    query: \"alerts\",\n    orderBy: \"email\",\n    direction: \"desc\",\n};\n\napi.getDistributionLists(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  query: 'alerts',\n  order_by: 'email',\n  direction: 'desc',\n}\n\nbegin\n    # GetDistributionListsPaginatedResponse object\n    result = api.get_distribution_lists(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_distribution_lists: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getDistributionLists method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string query = \"alerts\";\n            string orderBy = \"email\";\n            string direction = \"desc\";\n\n            try {\n                // GetDistributionListsPaginatedResponse class object\n                var result = apiInstance.GetDistributionLists(page, limit, query, orderBy, direction);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getDistributionLists: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getDistributionLists method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim query As String = \"alerts\"\n        Dim orderBy As String = \"email\"\n        Dim direction As String = \"desc\"\n\n        Try\n            ' GetDistributionListsPaginatedResponse class object\n            Dim result = apiInstance.GetDistributionLists(page, limit, query, orderBy, direction)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getDistributionLists: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetDistributionListsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Query: optional.NewString(\"alerts\"),\n        OrderBy: optional.NewString(\"email\"),\n        Direction: optional.NewString(\"desc\"),\n    }\n\n    // tm.GetDistributionListsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetDistributionLists(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string query = \"alerts\";\n    std::string orderBy = \"email\";\n    std::string direction = \"desc\";\n\n    try {\n        pplx::task<std::shared_ptr<GetDistributionListsPaginatedResponse>> result = api.getDistributionLists(page, limit, query, orderBy, direction);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getDistributionLists() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nquery = \"alerts\"\norder_by = \"email\"\ndirection = \"desc\"\n\ntry:\n    # GetDistributionListsPaginatedResponse object\n    result = api_instance.get_distribution_lists(page=page, limit=limit, query=query, order_by=order_by, direction=direction)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_distribution_lists: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $query = 'alerts';\nmy $orderBy = 'email';\nmy $direction = 'desc';\n\neval {\n    # GetDistributionListsPaginatedResponse object\n    my $result = $api_instance->get_distribution_lists(page => $page, limit => $limit, query => $query, orderBy => $orderBy, direction => $direction);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_distribution_lists: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Distribution%20Lists/getDistributionLists\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "post": {
        "operationId": "createDistributionList",
        "summary": "Create a new distribution list",
        "parameters": [
          {
            "name": "CreateDistributionListInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "name",
                "recipients",
                "includeOptions",
                "maxLength"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Distribution list name.",
                  "example": "Support alerts"
                },
                "recipients": {
                  "type": "object",
                  "description": "Recipients of the distribution list. At least one recipient must be provided across contactIds, groupIds, segmentIds and numbers.",
                  "properties": {
                    "contactIds": {
                      "type": "array",
                      "description": "Contact IDs to include.",
                      "items": {
                        "type": "integer"
                      },
                      "example": [
                        1,
                        2
                      ]
                    },
                    "groupIds": {
                      "type": "array",
                      "description": "List (group) IDs to include.",
                      "items": {
                        "type": "integer"
                      },
                      "example": [
                        3
                      ]
                    },
                    "segmentIds": {
                      "type": "array",
                      "description": "Segment (saved filter view) IDs to include.",
                      "items": {
                        "type": "integer"
                      },
                      "example": [
                        4,
                        5
                      ]
                    },
                    "numbers": {
                      "type": "array",
                      "description": "Plain phone numbers (E.164) to include.",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "+15551234567"
                      ]
                    }
                  }
                },
                "includeOptions": {
                  "type": "string",
                  "description": "Which part of the incoming email to include in the outgoing SMS.",
                  "enum": [
                    "body",
                    "subject",
                    "both"
                  ],
                  "example": "both"
                },
                "maxLength": {
                  "type": "integer",
                  "description": "Maximum number of SMS parts per message (1-6).",
                  "enum": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                  ],
                  "example": 6
                },
                "sender": {
                  "type": "string",
                  "x-nullable": true,
                  "description": "Phone number or sender ID the forwarded messages are sent from (reply-to). Leave empty to use the account default.",
                  "example": "+15551234567"
                },
                "sourceType": {
                  "type": "string",
                  "x-nullable": true,
                  "description": "Sender source type for the sender field (see Sender settings)."
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/DistributionList"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Distribution Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new CreateDistributionListInputObject();\n\n// Required parameters\n$input->setName(\"Support alerts\");\n$input->setRecipients({});\n$input->setIncludeOptions(\"both\");\n$input->setMaxLength(6);\n\n// Optional parameters, you can skip these setters calls\n$input->setSender(\"+15551234567\");\n$input->setSourceType(\"\");\n\ntry {\n    // DistributionList class object\n    $result = $api->createDistributionList($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->createDistributionList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        CreateDistributionListInputObject input = new CreateDistributionListInputObject();\n\n        // Required parameters\n        input.setName(\"Support alerts\");\n        input.setRecipients({});\n        input.setIncludeOptions(\"both\");\n        input.setMaxLength(6);\n\n        // Optional parameters, you can skip these setters calls\n        input.setSender(\"+15551234567\");\n        input.setSourceType(\"\");\n\n        try {\n            // DistributionList class object\n            DistributionList obj = apiInstance.createDistributionList(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling createDistributionList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    name: \"Support alerts\",\n    recipients: {},\n    includeOptions: \"both\",\n    maxLength: 6,\n    // Optional parameters\n    sender: \"+15551234567\",\n    sourceType: \"\",\n}\n\n\napi.createDistributionList(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::CreateDistributionListInputObject.new\n\n# Required parameters\nobj.name = \"Support alerts\"\nobj.recipients = {}\nobj.include_options = \"both\"\nobj.max_length = 6\n# Optional parameters, you can skip them\nobj.sender = \"+15551234567\"\nobj.source_type = \"\"\n\nbegin\n    # DistributionList object\n    result = api.create_distribution_list(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->create_distribution_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new CreateDistributionListInputObject();\n\n            // Required parameters\n            obj.Name = \"Support alerts\";\n            obj.Recipients = {};\n            obj.IncludeOptions = \"both\";\n            obj.MaxLength = 6;\n\n            // Optional parameters, you can skip these setters calls\n            obj.Sender = \"+15551234567\";\n            obj.SourceType = \"\";\n\n            try {\n                // DistributionList class object\n                var result = apiInstance.CreateDistributionList(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling createDistributionList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New CreateDistributionListInputObject With {\n            .Name = \"Support alerts\",\n            .Recipients = {},\n            .IncludeOptions = \"both\",\n            .MaxLength = 6,\n            .Sender = \"+15551234567\",\n            .SourceType = \"\"\n        }\n\n        Try\n            ' DistributionList class object\n            Dim result = apiInstance.CreateDistributionList(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling createDistributionList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Name: \"Support alerts\",\n        Recipients: {},\n        IncludeOptions: \"both\",\n        MaxLength: 6,\n        // Optional parameters, you can skip them\n        Sender: \"+15551234567\",\n        SourceType: \"\",\n    }\n\n    // tm.DistributionList struct\n    result, _, err := client.TextMagicApi.CreateDistributionList(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<CreateDistributionListInputObject> input(new CreateDistributionListInputObject);\n    // Required parameters\n    input->setName(\"Support alerts\");\n    input->setRecipients({});\n    input->setIncludeOptions(\"both\");\n    input->setMaxLength(6);\n    // Optional parameters, you can skip them\n    input->setSender(\"+15551234567\");\n    input->setSourceType(\"\");\n\n    try {\n        pplx::task<std::shared_ptr<DistributionList>> result = api.createDistributionList(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"createDistributionList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.CreateDistributionListInputObject()\n\n# Required parameters\ninput.name = \"Support alerts\"\ninput.recipients = {}\ninput.include_options = \"both\"\ninput.max_length = 6\n# Optional parameters, you can skip them\ninput.sender = \"+15551234567\"\ninput.source_type = \"\"\n\ntry:\n    # DistributionList object\n    result = api_instance.create_distribution_list(create_distribution_list_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->create_distribution_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::CreateDistributionListInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::CreateDistributionListInputObject->new(\n    # Required parameters\n    name => 'Support alerts',\n    recipients => {},\n    includeOptions => 'both',\n    maxLength => 6,\n    # Optional parameters, you can skip them\n    sender => '+15551234567',\n    sourceType => '',\n);\n\neval {\n    # DistributionList object\n    my $result = $api_instance->create_distribution_list(create_distribution_list_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->create_distribution_list: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Distribution%20Lists/createDistributionList\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/distribution-lists/{id}": {
      "get": {
        "operationId": "getDistributionList",
        "summary": "Get the details of a specific distribution list",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/DistributionList"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Distribution Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // DistributionList class object\n    $result = $api->getDistributionList($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getDistributionList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // DistributionList class object\n            DistributionList obj = apiInstance.getDistributionList(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getDistributionList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getDistributionList(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # DistributionList object\n    result = api.get_distribution_list(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_distribution_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // DistributionList class object\n                var result = apiInstance.GetDistributionList(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getDistributionList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' DistributionList class object\n            Dim result = apiInstance.GetDistributionList(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getDistributionList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.DistributionList struct\n    result, _, err := client.TextMagicApi.GetDistributionList(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<DistributionList>> result = api.getDistributionList(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getDistributionList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # DistributionList object\n    result = api_instance.get_distribution_list(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_distribution_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # DistributionList object\n    my $result = $api_instance->get_distribution_list(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_distribution_list: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Distribution%20Lists/getDistributionList\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "put": {
        "operationId": "updateDistributionList",
        "summary": "Edit a distribution list",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Distribution%20Lists/updateDistributionList\" target=\"_blank\">Try in sandbox</a><br>> This replaces the whole recipient set — submit the complete list of `contactIds`, `groupIds` and `numbers` you want the distribution list to have, not just the additions.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          },
          {
            "name": "UpdateDistributionListInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "name",
                "recipients",
                "includeOptions",
                "maxLength"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Distribution list name.",
                  "example": "Support alerts"
                },
                "recipients": {
                  "type": "object",
                  "description": "Recipients of the distribution list. At least one recipient must be provided across contactIds, groupIds, segmentIds and numbers.",
                  "properties": {
                    "contactIds": {
                      "type": "array",
                      "description": "Contact IDs to include.",
                      "items": {
                        "type": "integer"
                      },
                      "example": [
                        1,
                        2
                      ]
                    },
                    "groupIds": {
                      "type": "array",
                      "description": "List (group) IDs to include.",
                      "items": {
                        "type": "integer"
                      },
                      "example": [
                        3
                      ]
                    },
                    "segmentIds": {
                      "type": "array",
                      "description": "Segment (saved filter view) IDs to include.",
                      "items": {
                        "type": "integer"
                      },
                      "example": [
                        4,
                        5
                      ]
                    },
                    "numbers": {
                      "type": "array",
                      "description": "Plain phone numbers (E.164) to include.",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "+15551234567"
                      ]
                    }
                  }
                },
                "includeOptions": {
                  "type": "string",
                  "description": "Which part of the incoming email to include in the outgoing SMS.",
                  "enum": [
                    "body",
                    "subject",
                    "both"
                  ],
                  "example": "both"
                },
                "maxLength": {
                  "type": "integer",
                  "description": "Maximum number of SMS parts per message (1-6).",
                  "enum": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6
                  ],
                  "example": 6
                },
                "sender": {
                  "type": "string",
                  "x-nullable": true,
                  "description": "Phone number or sender ID the forwarded messages are sent from (reply-to). Leave empty to use the account default.",
                  "example": "+15551234567"
                },
                "sourceType": {
                  "type": "string",
                  "x-nullable": true,
                  "description": "Sender source type for the sender field (see Sender settings)."
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/DistributionList"
            }
          },
          "400": {
            "description": "Returned when the form has errors.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Returned when no distribution list found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Distribution Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateDistributionListInputObject();\n\n// Required parameters\n$input->setName(\"Support alerts\");\n$input->setRecipients({});\n$input->setIncludeOptions(\"both\");\n$input->setMaxLength(6);\n\n// Optional parameters, you can skip these setters calls\n$input->setSender(\"+15551234567\");\n$input->setSourceType(\"\");\n$id = 1;\n\ntry {\n    // DistributionList class object\n    $result = $api->updateDistributionList($input$id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateDistributionList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateDistributionListInputObject input = new UpdateDistributionListInputObject();\n\n        // Required parameters\n        input.setName(\"Support alerts\");\n        input.setRecipients({});\n        input.setIncludeOptions(\"both\");\n        input.setMaxLength(6);\n\n        // Optional parameters, you can skip these setters calls\n        input.setSender(\"+15551234567\");\n        input.setSourceType(\"\");\n        int id = 1;\n\n        try {\n            // DistributionList class object\n            DistributionList obj = apiInstance.updateDistributionList(inputid);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateDistributionList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    name: \"Support alerts\",\n    recipients: {},\n    includeOptions: \"both\",\n    maxLength: 6,\n    // Optional parameters\n    sender: \"+15551234567\",\n    sourceType: \"\",\n}\nconst id = 1;\n\n\napi.updateDistributionList(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateDistributionListInputObject.new\n\n# Required parameters\nobj.name = \"Support alerts\"\nobj.recipients = {}\nobj.include_options = \"both\"\nobj.max_length = 6\n# Optional parameters, you can skip them\nobj.sender = \"+15551234567\"\nobj.source_type = \"\"\nid = 1\n\nbegin\n    # DistributionList object\n    result = api.update_distribution_list(input, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_distribution_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateDistributionListInputObject();\n\n            // Required parameters\n            obj.Name = \"Support alerts\";\n            obj.Recipients = {};\n            obj.IncludeOptions = \"both\";\n            obj.MaxLength = 6;\n\n            // Optional parameters, you can skip these setters calls\n            obj.Sender = \"+15551234567\";\n            obj.SourceType = \"\";\n            int id = 1;\n\n            try {\n                // DistributionList class object\n                var result = apiInstance.UpdateDistributionList(objid);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateDistributionList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateDistributionListInputObject With {\n            .Name = \"Support alerts\",\n            .Recipients = {},\n            .IncludeOptions = \"both\",\n            .MaxLength = 6,\n            .Sender = \"+15551234567\",\n            .SourceType = \"\"\n        }\n        Dim id As Integer = 1\n\n        Try\n            ' DistributionList class object\n            Dim result = apiInstance.UpdateDistributionList(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateDistributionList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Name: \"Support alerts\",\n        Recipients: {},\n        IncludeOptions: \"both\",\n        MaxLength: 6,\n        // Optional parameters, you can skip them\n        Sender: \"+15551234567\",\n        SourceType: \"\",\n    }\n    // Required\n    var id int32 = 1\n\n    // tm.DistributionList struct\n    result, _, err := client.TextMagicApi.UpdateDistributionList(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateDistributionListInputObject> input(new UpdateDistributionListInputObject);\n    // Required parameters\n    input->setName(\"Support alerts\");\n    input->setRecipients({});\n    input->setIncludeOptions(\"both\");\n    input->setMaxLength(6);\n    // Optional parameters, you can skip them\n    input->setSender(\"+15551234567\");\n    input->setSourceType(\"\");\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<DistributionList>> result = api.updateDistributionList(input, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"updateDistributionList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateDistributionListInputObject()\n\n# Required parameters\ninput.name = \"Support alerts\"\ninput.recipients = {}\ninput.include_options = \"both\"\ninput.max_length = 6\n# Optional parameters, you can skip them\ninput.sender = \"+15551234567\"\ninput.source_type = \"\"\nid = 1\n\ntry:\n    # DistributionList object\n    result = api_instance.update_distribution_list(update_distribution_list_input_object=input, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_distribution_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateDistributionListInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateDistributionListInputObject->new(\n    # Required parameters\n    name => 'Support alerts',\n    recipients => {},\n    includeOptions => 'both',\n    maxLength => 6,\n    # Optional parameters, you can skip them\n    sender => '+15551234567',\n    sourceType => '',\n);\nmy $id = 1;\n\neval {\n    # DistributionList object\n    my $result = $api_instance->update_distribution_list(update_distribution_list_input_object => $input, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_distribution_list: $@\\n\";\n}"
          }
        ]
      },
      "delete": {
        "operationId": "deleteDistributionList",
        "summary": "Delete a distribution list",
        "produces": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Distribution Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteDistributionList($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteDistributionList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteDistributionList(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteDistributionList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteDistributionList(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_distribution_list(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_distribution_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteDistributionList(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteDistributionList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteDistributionList(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteDistributionList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteDistributionList(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteDistributionList(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteDistributionList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_distribution_list(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_distribution_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_distribution_list(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_distribution_list: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Distribution%20Lists/deleteDistributionList\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/block/list": {
      "get": {
        "operationId": "getBlockedContacts",
        "summary": "Get blocked contacts",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "query",
            "in": "query",
            "description": "Find blocked contacts by specified search query.",
            "type": "string"
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "firstName",
              "lastName"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetBlockedContactsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getBlockedContacts method below, default values will be used\n$page = 1;\n$limit = 10;\n$query = \"sampleValue\";\n$orderBy = \"id\";\n$direction = \"desc\";\n\ntry {\n    // GetBlockedContactsPaginatedResponse class object\n    $result = $api->getBlockedContacts($page, $limit, $query, $orderBy, $direction);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getBlockedContacts: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getBlockedContacts method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String query = \"sampleValue\";\n        String orderBy = \"id\";\n        String direction = \"desc\";\n\n        try {\n            // GetBlockedContactsPaginatedResponse class object\n            GetBlockedContactsPaginatedResponse obj = apiInstance.getBlockedContacts(page, limit, query, orderBy, direction);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getBlockedContacts\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    query: \"sampleValue\",\n    orderBy: \"id\",\n    direction: \"desc\",\n};\n\napi.getBlockedContacts(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  query: 'sampleValue',\n  order_by: 'id',\n  direction: 'desc',\n}\n\nbegin\n    # GetBlockedContactsPaginatedResponse object\n    result = api.get_blocked_contacts(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_blocked_contacts: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getBlockedContacts method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string query = \"sampleValue\";\n            string orderBy = \"id\";\n            string direction = \"desc\";\n\n            try {\n                // GetBlockedContactsPaginatedResponse class object\n                var result = apiInstance.GetBlockedContacts(page, limit, query, orderBy, direction);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getBlockedContacts: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getBlockedContacts method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim query As String = \"sampleValue\"\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n\n        Try\n            ' GetBlockedContactsPaginatedResponse class object\n            Dim result = apiInstance.GetBlockedContacts(page, limit, query, orderBy, direction)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getBlockedContacts: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetBlockedContactsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Query: optional.NewString(\"sampleValue\"),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n    }\n\n    // tm.GetBlockedContactsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetBlockedContacts(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string query = \"sampleValue\";\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n\n    try {\n        pplx::task<std::shared_ptr<GetBlockedContactsPaginatedResponse>> result = api.getBlockedContacts(page, limit, query, orderBy, direction);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getBlockedContacts() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nquery = \"sampleValue\"\norder_by = \"id\"\ndirection = \"desc\"\n\ntry:\n    # GetBlockedContactsPaginatedResponse object\n    result = api_instance.get_blocked_contacts(page=page, limit=limit, query=query, order_by=order_by, direction=direction)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_blocked_contacts: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $query = 'sampleValue';\nmy $orderBy = 'id';\nmy $direction = 'desc';\n\neval {\n    # GetBlockedContactsPaginatedResponse object\n    my $result = $api_instance->get_blocked_contacts(page => $page, limit => $limit, query => $query, orderBy => $orderBy, direction => $direction);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_blocked_contacts: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/getBlockedContacts\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/block/phone": {
      "get": {
        "operationId": "getContactIfBlocked",
        "summary": "Check if a phone number is blocked",
        "parameters": [
          {
            "name": "phone",
            "in": "query",
            "description": "Phone number to check.",
            "type": "string",
            "required": true,
            "x-example": "447860021130"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when contact is blocked.",
            "schema": {
              "$ref": "#/definitions/Contact"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "When the contact is not blocked."
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$phone = \"447860021130\";\n\ntry {\n    // Contact class object\n    $result = $api->getContactIfBlocked($phone);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getContactIfBlocked: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        String phone = \"447860021130\";\n\n        try {\n            // Contact class object\n            Contact obj = apiInstance.getContactIfBlocked(phone);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getContactIfBlocked\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst phone = \"447860021130\";\n\n\napi.getContactIfBlocked(phone).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  phone: '447860021130',\n}\n\nbegin\n    # Contact object\n    result = api.get_contact_if_blocked(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_contact_if_blocked: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            string phone = \"447860021130\";\n\n            try {\n                // Contact class object\n                var result = apiInstance.GetContactIfBlocked(phone);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getContactIfBlocked: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim phone As String = \"447860021130\"\n\n        Try\n            ' Contact class object\n            Dim result = apiInstance.GetContactIfBlocked(phone)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getContactIfBlocked: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetContactIfBlockedOpts{\n        // Required parameters\n        Phone: \"447860021130\",\n    }\n\n    // tm.Contact struct\n    result, _, err := client.TextMagicApi.GetContactIfBlocked(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::string phone = \"447860021130\";\n\n    try {\n        pplx::task<std::shared_ptr<Contact>> result = api.getContactIfBlocked(phone);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getContactIfBlocked() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nphone = \"447860021130\"\n\ntry:\n    # Contact object\n    result = api_instance.get_contact_if_blocked(phone=phone)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_contact_if_blocked: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $phone = '447860021130';\n\neval {\n    # Contact object\n    my $result = $api_instance->get_contact_if_blocked(phone => $phone);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_contact_if_blocked: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/getContactIfBlocked\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/block": {
      "post": {
        "operationId": "blockContact",
        "summary": "Block a contact by phone number",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/blockContact\" target=\"_blank\">Try in sandbox</a><br>Block a contact from inbound and outbound communication by phone number.",
        "parameters": [
          {
            "name": "BlockContactInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "phone": {
                  "description": "Contact phone number.",
                  "type": "string",
                  "example": "447860021130"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when updated with success.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new BlockContactInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setPhone(\"447860021130\");\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->blockContact($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->blockContact: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        BlockContactInputObject input = new BlockContactInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setPhone(\"447860021130\");\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.blockContact(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling blockContact\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    phone: \"447860021130\",\n}\n\n\napi.blockContact(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::BlockContactInputObject.new\n# Optional parameters, you can skip them\nobj.phone = \"447860021130\"\n\nbegin\n    # ResourceLinkResponse object\n    result = api.block_contact(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->block_contact: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new BlockContactInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Phone = \"447860021130\";\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.BlockContact(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling blockContact: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New BlockContactInputObject With {\n            .Phone = \"447860021130\"\n        }\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.BlockContact(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling blockContact: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Phone: \"447860021130\",\n    }\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.BlockContact(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<BlockContactInputObject> input(new BlockContactInputObject);\n    // Optional parameters, you can skip them\n    input->setPhone(\"447860021130\");\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.blockContact(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"blockContact() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.BlockContactInputObject()\n# Optional parameters, you can skip them\ninput.phone = \"447860021130\"\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.block_contact(block_contact_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->block_contact: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::BlockContactInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::BlockContactInputObject->new(\n    # Optional parameters, you can skip them\n    phone => '447860021130',\n);\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->block_contact(block_contact_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->block_contact: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/contacts/unblock": {
      "post": {
        "operationId": "unblockContact",
        "summary": "Unblock a contact by phone number",
        "produces": [],
        "parameters": [
          {
            "name": "UnblockContactInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "phone": {
                  "description": "Contact phone number.",
                  "type": "string",
                  "example": "447860021130"
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UnblockContactInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setPhone(\"447860021130\");\n\ntry {\n    $api->unblockContact($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->unblockContact: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UnblockContactInputObject input = new UnblockContactInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setPhone(\"447860021130\");\n\n        try {\n            apiInstance.unblockContact(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling unblockContact\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    phone: \"447860021130\",\n}\n\n\napi.unblockContact(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UnblockContactInputObject.new\n# Optional parameters, you can skip them\nobj.phone = \"447860021130\"\n\nbegin\n    api.unblock_contact(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->unblock_contact: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UnblockContactInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Phone = \"447860021130\";\n\n            try {\n                apiInstance.UnblockContact(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling unblockContact: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UnblockContactInputObject With {\n            .Phone = \"447860021130\"\n        }\n\n        Try\n            apiInstance.UnblockContact(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling unblockContact: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Phone: \"447860021130\",\n    }\n\n    client.TextMagicApi.UnblockContact(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UnblockContactInputObject> input(new UnblockContactInputObject);\n    // Optional parameters, you can skip them\n    input->setPhone(\"447860021130\");\n\n    try {\n        pplx::task result = api.unblockContact(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"unblockContact() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UnblockContactInputObject()\n# Optional parameters, you can skip them\ninput.phone = \"447860021130\"\n\ntry:\n    api_instance.unblock_contact(unblock_contact_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->unblock_contact: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UnblockContactInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UnblockContactInputObject->new(\n    # Optional parameters, you can skip them\n    phone => '447860021130',\n);\n\neval {\n    $api_instance->unblock_contact(unblock_contact_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->unblock_contact: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/unblockContact\" target=\"_blank\">Try in sandbox</a><br>Unblock a contact by phone number"
      }
    },
    "/api/v2/contacts/unblock/bulk": {
      "post": {
        "operationId": "unblockContactsBulk",
        "summary": "Unblock contacts (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/unblockContactsBulk\" target=\"_blank\">Try in sandbox</a><br>Unblock several contacts by blocked contact IDs or unblock all contacts.",
        "produces": [],
        "parameters": [
          {
            "name": "UnblockContactsBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "integer",
                  "example": 0,
                  "enum": [
                    0,
                    1
                  ],
                  "description": "Default is 0 (false). If set to 1, all entities will be removed."
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success"
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UnblockContactsBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n\ntry {\n    $api->unblockContactsBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->unblockContactsBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UnblockContactsBulkInputObject input = new UnblockContactsBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n\n        try {\n            apiInstance.unblockContactsBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling unblockContactsBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\n\n\napi.unblockContactsBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UnblockContactsBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\n\nbegin\n    api.unblock_contacts_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->unblock_contacts_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UnblockContactsBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n\n            try {\n                apiInstance.UnblockContactsBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling unblockContactsBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UnblockContactsBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n\n        Try\n            apiInstance.UnblockContactsBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling unblockContactsBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n\n    client.TextMagicApi.UnblockContactsBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UnblockContactsBulkInputObject> input(new UnblockContactsBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    try {\n        pplx::task result = api.unblockContactsBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"unblockContactsBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UnblockContactsBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\n\ntry:\n    api_instance.unblock_contacts_bulk(unblock_contacts_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->unblock_contacts_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UnblockContactsBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UnblockContactsBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\n\neval {\n    $api_instance->unblock_contacts_bulk(unblock_contacts_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->unblock_contacts_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/contacts/{id}/notes": {
      "get": {
        "operationId": "getContactNotes",
        "summary": "Fetch notes assigned to a given contact",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetContactNotesPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contact Notes"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n// Optional, you can pass them as null values to getContactNotes method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // GetContactNotesPaginatedResponse class object\n    $result = $api->getContactNotes($id, $page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getContactNotes: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n        // Optional, you can pass them as null values to getContactNotes method below, default values will be used\n        int page = 1;\n        int limit = 10;\n\n        try {\n            // GetContactNotesPaginatedResponse class object\n            GetContactNotesPaginatedResponse obj = apiInstance.getContactNotes(id, page, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getContactNotes\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getContactNotes(id, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # GetContactNotesPaginatedResponse object\n    result = api.get_contact_notes(id, params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_contact_notes: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n            // Optional, you can pass them as null values to getContactNotes method below, default values will be used\n            int page = 1;\n            int limit = 10;\n\n            try {\n                // GetContactNotesPaginatedResponse class object\n                var result = apiInstance.GetContactNotes(id, page, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getContactNotes: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n        ' Optional, you can pass them as null values to getContactNotes method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' GetContactNotesPaginatedResponse class object\n            Dim result = apiInstance.GetContactNotes(id, page, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getContactNotes: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    opts := tm.GetContactNotesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.GetContactNotesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetContactNotes(auth, id, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<GetContactNotesPaginatedResponse>> result = api.getContactNotes(id, page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getContactNotes() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # GetContactNotesPaginatedResponse object\n    result = api_instance.get_contact_notes(id=id, page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_contact_notes: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # GetContactNotesPaginatedResponse object\n    my $result = $api_instance->get_contact_notes(id => $id, page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_contact_notes: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contact%20Notes/getContactNotes\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "post": {
        "operationId": "createContactNote",
        "summary": "Create a new contact note",
        "parameters": [
          {
            "name": "CreateContactNoteInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "note": {
                  "type": "string",
                  "example": "My new note",
                  "description": "Contact Note text."
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when created with success.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contact Notes"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new CreateContactNoteInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setNote(\"My new note\");\n$id = 1;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->createContactNote($input$id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->createContactNote: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        CreateContactNoteInputObject input = new CreateContactNoteInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setNote(\"My new note\");\n        int id = 1;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.createContactNote(inputid);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling createContactNote\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    note: \"My new note\",\n}\nconst id = 1;\n\n\napi.createContactNote(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::CreateContactNoteInputObject.new\n# Optional parameters, you can skip them\nobj.note = \"My new note\"\nid = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.create_contact_note(input, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->create_contact_note: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new CreateContactNoteInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Note = \"My new note\";\n            int id = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.CreateContactNote(objid);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling createContactNote: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New CreateContactNoteInputObject With {\n            .Note = \"My new note\"\n        }\n        Dim id As Integer = 1\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.CreateContactNote(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling createContactNote: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Note: \"My new note\",\n    }\n    // Required\n    var id int32 = 1\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.CreateContactNote(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<CreateContactNoteInputObject> input(new CreateContactNoteInputObject);\n    // Optional parameters, you can skip them\n    input->setNote(\"My new note\");\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.createContactNote(input, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"createContactNote() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.CreateContactNoteInputObject()\n# Optional parameters, you can skip them\ninput.note = \"My new note\"\nid = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.create_contact_note(create_contact_note_input_object=input, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->create_contact_note: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::CreateContactNoteInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::CreateContactNoteInputObject->new(\n    # Optional parameters, you can skip them\n    note => 'My new note',\n);\nmy $id = 1;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->create_contact_note(create_contact_note_input_object => $input, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->create_contact_note: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contact%20Notes/createContactNote\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/notes/{id}": {
      "get": {
        "operationId": "getContactNote",
        "summary": "Get a contact note",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ContactNote"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contact Notes"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // ContactNote class object\n    $result = $api->getContactNote($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getContactNote: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // ContactNote class object\n            ContactNote obj = apiInstance.getContactNote(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getContactNote\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getContactNote(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # ContactNote object\n    result = api.get_contact_note(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_contact_note: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // ContactNote class object\n                var result = apiInstance.GetContactNote(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getContactNote: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' ContactNote class object\n            Dim result = apiInstance.GetContactNote(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getContactNote: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.ContactNote struct\n    result, _, err := client.TextMagicApi.GetContactNote(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ContactNote>> result = api.getContactNote(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getContactNote() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # ContactNote object\n    result = api_instance.get_contact_note(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_contact_note: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # ContactNote object\n    my $result = $api_instance->get_contact_note(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_contact_note: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contact%20Notes/getContactNote\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "put": {
        "operationId": "updateContactNote",
        "summary": "Update a contact note",
        "parameters": [
          {
            "name": "UpdateContactNoteInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "note"
              ],
              "additionalProperties": false,
              "properties": {
                "note": {
                  "type": "string",
                  "example": "My new note",
                  "description": "Contact Note text."
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when trying to edit a contact note shared to a current user."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contact Notes"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateContactNoteInputObject();\n\n// Required parameters\n$input->setNote(\"My new note\");\n$id = 1;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->updateContactNote($input$id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateContactNote: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateContactNoteInputObject input = new UpdateContactNoteInputObject();\n\n        // Required parameters\n        input.setNote(\"My new note\");\n        int id = 1;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.updateContactNote(inputid);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateContactNote\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    note: \"My new note\",\n}\nconst id = 1;\n\n\napi.updateContactNote(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateContactNoteInputObject.new\n\n# Required parameters\nobj.note = \"My new note\"\nid = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.update_contact_note(input, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_contact_note: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateContactNoteInputObject();\n\n            // Required parameters\n            obj.Note = \"My new note\";\n            int id = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.UpdateContactNote(objid);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateContactNote: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateContactNoteInputObject With {\n            .Note = \"My new note\"\n        }\n        Dim id As Integer = 1\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.UpdateContactNote(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateContactNote: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Note: \"My new note\",\n    }\n    // Required\n    var id int32 = 1\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.UpdateContactNote(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateContactNoteInputObject> input(new UpdateContactNoteInputObject);\n    // Required parameters\n    input->setNote(\"My new note\");\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.updateContactNote(input, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"updateContactNote() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateContactNoteInputObject()\n\n# Required parameters\ninput.note = \"My new note\"\nid = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.update_contact_note(update_contact_note_input_object=input, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_contact_note: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateContactNoteInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateContactNoteInputObject->new(\n    # Required parameters\n    note => 'My new note',\n);\nmy $id = 1;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->update_contact_note(update_contact_note_input_object => $input, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_contact_note: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contact%20Notes/updateContactNote\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteContactNote",
        "summary": "Delete a contact note",
        "produces": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contact Notes"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteContactNote($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteContactNote: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteContactNote(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteContactNote\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteContactNote(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_contact_note(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_contact_note: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteContactNote(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteContactNote: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteContactNote(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteContactNote: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteContactNote(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteContactNote(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteContactNote() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_contact_note(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_contact_note: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_contact_note(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_contact_note: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contact%20Notes/deleteContactNote\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/{id}/notes/delete": {
      "post": {
        "operationId": "deleteContactNotesBulk",
        "produces": [],
        "summary": "Delete contact notes (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contact%20Notes/deleteContactNotesBulk\" target=\"_blank\">Try in sandbox</a><br>",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          },
          {
            "name": "DeleteContactNotesBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "boolean",
                  "description": "Entity ID(s), separated by comma.",
                  "example": true
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contact Notes"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteContactNotesBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(true);\n$id = 1;\n\ntry {\n    $api->deleteContactNotesBulk($input$id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteContactNotesBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteContactNotesBulkInputObject input = new DeleteContactNotesBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(true);\n        int id = 1;\n\n        try {\n            apiInstance.deleteContactNotesBulk(inputid);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteContactNotesBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: true,\n}\nconst id = 1;\n\n\napi.deleteContactNotesBulk(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteContactNotesBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = true\nid = 1\n\nbegin\n    api.delete_contact_notes_bulk(input, id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_contact_notes_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteContactNotesBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = true;\n            int id = 1;\n\n            try {\n                apiInstance.DeleteContactNotesBulk(objid);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteContactNotesBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteContactNotesBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = true\n        }\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteContactNotesBulk(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteContactNotesBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: true,\n    }\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteContactNotesBulk(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteContactNotesBulkInputObject> input(new DeleteContactNotesBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(true);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteContactNotesBulk(input, id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteContactNotesBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteContactNotesBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = true\nid = 1\n\ntry:\n    api_instance.delete_contact_notes_bulk(delete_contact_notes_bulk_input_object=input, id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_contact_notes_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteContactNotesBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteContactNotesBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => 1,\n);\nmy $id = 1;\n\neval {\n    $api_instance->delete_contact_notes_bulk(delete_contact_notes_bulk_input_object => $input, id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_contact_notes_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/contacts/{id}/avatar": {
      "post": {
        "operationId": "uploadContactAvatar",
        "consumes": [
          "multipart/form-data"
        ],
        "summary": "Upload an avatar",
        "parameters": [
          {
            "name": "image",
            "in": "formData",
            "required": true,
            "description": "Contact avatar. Should be a PNG or JPG file not more than 10 MB.",
            "type": "file"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when trying to edit a contact shared to a current user."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$image = new \\SplFileObject(\"test.jpg\");\n$id = 1;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->uploadContactAvatar($image, $id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->uploadContactAvatar: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\nimport java.io.File;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // change to your file path\n        File image = new File(\"test.jpg\");\n        int id = 1;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.uploadContactAvatar(image, id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling uploadContactAvatar\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst fs = require('fs');\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n// change to your file path.\nconst image = new fs.ReadStream('filePath');\nconst id = 1;\n\n\napi.uploadContactAvatar(image, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nimage = File.open('test.png', 'r')\nid = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.upload_contact_avatar(image, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->upload_contact_avatar: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // change to your file path\n            var image = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open);\n            int id = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.UploadContactAvatar(image, id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling uploadContactAvatar: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' change to your file path\n        Dim image = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open)\n        Dim id As Integer = 1\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.UploadContactAvatar(image, id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling uploadContactAvatar: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\nSorry, file upload calls for Go SDK do not supported yet.\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::filebuf fb;\n    fb.open (\"test.jpg\", std::ios::in);\n    std::shared_ptr<std::istream> is(new std::istream(&fb));\n\n    std::shared_ptr<HttpContent> image(new HttpContent);\n    image->setName(\"test\");\n    image->setContentDisposition(\"attachment\");\n    image->setFileName(\"test.jpg\");\n\n    image->setContentType(\"image/jpeg\");\n    image->setData(is);\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.uploadContactAvatar(image, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"uploadContactAvatar() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# change to your file path\nimage = \"test.jpg\"\nid = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.upload_contact_avatar(image=image, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->upload_contact_avatar: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# change to your file path\nmy $image = 'test.jpg';\nmy $id = 1;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->upload_contact_avatar(image => $image, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->upload_contact_avatar: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/uploadContactAvatar\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteContactAvatar",
        "summary": "Delete an avatar",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when trying to delete a contact shared to a current user."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteContactAvatar($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteContactAvatar: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteContactAvatar(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteContactAvatar\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteContactAvatar(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_contact_avatar(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_contact_avatar: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteContactAvatar(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteContactAvatar: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteContactAvatar(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteContactAvatar: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteContactAvatar(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteContactAvatar(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteContactAvatar() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_contact_avatar(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_contact_avatar: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_contact_avatar(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_contact_avatar: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/deleteContactAvatar\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/contacts/import/normalized": {
      "post": {
        "operationId": "importContacts",
        "consumes": [
          "multipart/form-data"
        ],
        "summary": "Import contacts",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/importContacts\" target=\"_blank\">Try in sandbox</a><br>Import contacts from the CSV, XLS or XLSX file.",
        "parameters": [
          {
            "name": "file",
            "in": "formData",
            "required": true,
            "description": "File containing contacts in csv or xls(x) formats.",
            "type": "file"
          },
          {
            "name": "column",
            "in": "query",
            "type": "string",
            "description": "Import file column mapping. The string must contain sub-strings of mapping in format `columnNumber:field` glued by `;`. For example: `0:firstName;1:lastName;3:phone;4:email` where the value before `:` is a number of the column in the file, and the value after `:` is a field of the newly created contact or the ID of a custom field. Numbers of columns begin from zero. Allowed built-in contact fields are: `firstName`, `lastName`, `phone`, `email`. Existing of `phone` mapping is required.\n",
            "x-example": "0:firstName;1:lastName;3:phone;4:email",
            "required": true
          },
          {
            "name": "listId",
            "description": "List that ID contacts will be imported to. Ignored if `listName` is specified.\n",
            "type": "integer",
            "in": "query",
            "x-example": 443
          },
          {
            "name": "listName",
            "description": "List name. This list will be created during import. If such name is already taken, an ordinal (1, 2, ...) will be added to the end. Ignored if `listId` is specified.\n",
            "type": "string",
            "in": "query",
            "x-example": "A new list"
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$file = new \\SplFileObject(\"test.jpg\");\n$column = \"0:firstName;1:lastName;3:phone;4:email\";\n// Optional, you can pass them as null values to importContacts method below, default values will be used\n$listId = 443;\n$listName = \"A new list\";\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->importContacts($file, $column, $listId, $listName);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->importContacts: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\nimport java.io.File;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // change to your file path\n        File file = new File(\"test.jpg\");\n        String column = \"0:firstName;1:lastName;3:phone;4:email\";\n        // Optional, you can pass them as null values to importContacts method below, default values will be used\n        int listId = 443;\n        String listName = \"A new list\";\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.importContacts(file, column, listId, listName);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling importContacts\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst fs = require('fs');\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n// change to your file path.\nconst file = new fs.ReadStream('filePath');\nconst column = \"0:firstName;1:lastName;3:phone;4:email\";\n\n// Optional parameters\nconst opts = {\n    listId: 443,\n    listName: \"A new list\",\n};\n\napi.importContacts(file, column, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nfile = File.open('test.png', 'r')\nparams = {\n  column: '0:firstName;1:lastName;3:phone;4:email',\n  # Optional parameters\n  list_id: 443,\n  list_name: 'A new list',\n}\n\nbegin\n    # ResourceLinkResponse object\n    result = api.import_contacts(file, params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->import_contacts: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // change to your file path\n            var file = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open);\n            string column = \"0:firstName;1:lastName;3:phone;4:email\";\n            // Optional, you can pass them as null values to importContacts method below, default values will be used\n            int listId = 443;\n            string listName = \"A new list\";\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.ImportContacts(file, column, listId, listName);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling importContacts: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' change to your file path\n        Dim file = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open)\n        Dim column As String = \"0:firstName;1:lastName;3:phone;4:email\"\n        ' Optional, you can pass them as null values to importContacts method below, default values will be used\n        Dim listId As Integer = 443\n        Dim listName As String = \"A new list\"\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.ImportContacts(file, column, listId, listName)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling importContacts: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\nSorry, file upload calls for Go SDK do not supported yet.\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::filebuf fb;\n    fb.open (\"test.jpg\", std::ios::in);\n    std::shared_ptr<std::istream> is(new std::istream(&fb));\n\n    std::shared_ptr<HttpContent> file(new HttpContent);\n    file->setName(\"test\");\n    file->setContentDisposition(\"attachment\");\n    file->setFileName(\"test.jpg\");\n\n    file->setContentType(\"image/jpeg\");\n    file->setData(is);\n    std::string column = \"0:firstName;1:lastName;3:phone;4:email\";\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int listId = 443;\n    std::string listName = \"A new list\";\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.importContacts(file, column, listId, listName);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"importContacts() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# change to your file path\nfile = \"test.jpg\"\ncolumn = \"0:firstName;1:lastName;3:phone;4:email\"\n# Optional params, you can skip them\nlist_id = 443\nlist_name = \"A new list\"\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.import_contacts(file=file, column=column, list_id=list_id, list_name=list_name)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->import_contacts: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# change to your file path\nmy $file = 'test.jpg';\nmy $column = '0:firstName;1:lastName;3:phone;4:email';\n# Optional params, you can skip them\nmy $listId = 443;\nmy $listName = 'A new list';\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->import_contacts(file => $file, column => $column, listId => $listId, listName => $listName);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->import_contacts: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/contacts/import/progress/{id}": {
      "get": {
        "operationId": "getContactImportSessionProgress",
        "summary": "Check import progress",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Contacts/getContactImportSessionProgress\" target=\"_blank\">Try in sandbox</a><br>Get contact import session progress.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetContactImportSessionProgressResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Contacts"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // GetContactImportSessionProgressResponse class object\n    $result = $api->getContactImportSessionProgress($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getContactImportSessionProgress: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // GetContactImportSessionProgressResponse class object\n            GetContactImportSessionProgressResponse obj = apiInstance.getContactImportSessionProgress(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getContactImportSessionProgress\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getContactImportSessionProgress(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # GetContactImportSessionProgressResponse object\n    result = api.get_contact_import_session_progress(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_contact_import_session_progress: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // GetContactImportSessionProgressResponse class object\n                var result = apiInstance.GetContactImportSessionProgress(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getContactImportSessionProgress: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' GetContactImportSessionProgressResponse class object\n            Dim result = apiInstance.GetContactImportSessionProgress(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getContactImportSessionProgress: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.GetContactImportSessionProgressResponse struct\n    result, _, err := client.TextMagicApi.GetContactImportSessionProgress(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<GetContactImportSessionProgressResponse>> result = api.getContactImportSessionProgress(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getContactImportSessionProgress() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # GetContactImportSessionProgressResponse object\n    result = api_instance.get_contact_import_session_progress(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_contact_import_session_progress: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # GetContactImportSessionProgressResponse object\n    my $result = $api_instance->get_contact_import_session_progress(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_contact_import_session_progress: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/email-lookups/{email}": {
      "get": {
        "operationId": "doEmailLookup",
        "summary": "Email Lookup",
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "email",
            "x-example": "john@sample.com",
            "description": "Email address."
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/DoEmailLookupResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lookup"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$email = \"john@sample.com\";\n\ntry {\n    // DoEmailLookupResponse class object\n    $result = $api->doEmailLookup($email);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->doEmailLookup: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        String email = \"john@sample.com\";\n\n        try {\n            // DoEmailLookupResponse class object\n            DoEmailLookupResponse obj = apiInstance.doEmailLookup(email);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling doEmailLookup\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst email = \"john@sample.com\";\n\n\napi.doEmailLookup(email).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nemail = 'john@sample.com'\n\nbegin\n    # DoEmailLookupResponse object\n    result = api.do_email_lookup(email)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->do_email_lookup: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            string email = \"john@sample.com\";\n\n            try {\n                // DoEmailLookupResponse class object\n                var result = apiInstance.DoEmailLookup(email);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling doEmailLookup: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim email As String = \"john@sample.com\"\n\n        Try\n            ' DoEmailLookupResponse class object\n            Dim result = apiInstance.DoEmailLookup(email)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling doEmailLookup: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var email string = \"john@sample.com\"\n\n    // tm.DoEmailLookupResponse struct\n    result, _, err := client.TextMagicApi.DoEmailLookup(auth, email)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::string email = \"john@sample.com\";\n\n    try {\n        pplx::task<std::shared_ptr<DoEmailLookupResponse>> result = api.doEmailLookup(email);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"doEmailLookup() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nemail = \"john@sample.com\"\n\ntry:\n    # DoEmailLookupResponse object\n    result = api_instance.do_email_lookup(email=email)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->do_email_lookup: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $email = 'john@sample.com';\n\neval {\n    # DoEmailLookupResponse object\n    my $result = $api_instance->do_email_lookup(email => $email);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->do_email_lookup: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lookup/doEmailLookup\" target=\"_blank\">Try in sandbox</a><br>To get more details about an email address or to check whether it is a valid email or not, you can use the Email Lookup command. To upload and check emails in bulk, please use our [Web app](https://my.textmagic.com/online/email-lookup/).\n\nThis API call allows you to retrieve additional information about an email address, such as mailbox detection, syntax checks, DNS validation, deliverability status, and many more helpful values (see the table below).\n\n> Emails must be checked one by one. You cannot check multiple emails in one request. To upload and check emails in bulk, please use our [Web app](https://my.textmagic.com/online/email-lookup/)."
      }
    },
    "/api/v2/lists/{id}/contacts/ids": {
      "get": {
        "operationId": "getListContactsIds",
        "summary": "Get all contact IDs in a list",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetListContactsIdsResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // GetListContactsIdsResponse class object\n    $result = $api->getListContactsIds($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getListContactsIds: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // GetListContactsIdsResponse class object\n            GetListContactsIdsResponse obj = apiInstance.getListContactsIds(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getListContactsIds\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getListContactsIds(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # GetListContactsIdsResponse object\n    result = api.get_list_contacts_ids(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_list_contacts_ids: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // GetListContactsIdsResponse class object\n                var result = apiInstance.GetListContactsIds(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getListContactsIds: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' GetListContactsIdsResponse class object\n            Dim result = apiInstance.GetListContactsIds(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getListContactsIds: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.GetListContactsIdsResponse struct\n    result, _, err := client.TextMagicApi.GetListContactsIds(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<GetListContactsIdsResponse>> result = api.getListContactsIds(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getListContactsIds() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # GetListContactsIdsResponse object\n    result = api_instance.get_list_contacts_ids(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_list_contacts_ids: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # GetListContactsIdsResponse object\n    my $result = $api_instance->get_list_contacts_ids(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_list_contacts_ids: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/getListContactsIds\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/lists/{id}/contacts": {
      "get": {
        "operationId": "getContactsByListId",
        "summary": "Get all contacts in a list",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/getContactsByListId\" target=\"_blank\">Try in sandbox</a><br>A useful synonym for the \"contacts/search\" command with the provided \"listId\" parameter.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "firstName",
              "lastName"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "description": "Given group ID.",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetContactsByListIdPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n// Optional, you can pass them as null values to getContactsByListId method below, default values will be used\n$page = 1;\n$limit = 10;\n$orderBy = \"id\";\n$direction = \"desc\";\n\ntry {\n    // GetContactsByListIdPaginatedResponse class object\n    $result = $api->getContactsByListId($id, $page, $limit, $orderBy, $direction);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getContactsByListId: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n        // Optional, you can pass them as null values to getContactsByListId method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String orderBy = \"id\";\n        String direction = \"desc\";\n\n        try {\n            // GetContactsByListIdPaginatedResponse class object\n            GetContactsByListIdPaginatedResponse obj = apiInstance.getContactsByListId(id, page, limit, orderBy, direction);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getContactsByListId\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    orderBy: \"id\",\n    direction: \"desc\",\n};\n\napi.getContactsByListId(id, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  order_by: 'id',\n  direction: 'desc',\n}\n\nbegin\n    # GetContactsByListIdPaginatedResponse object\n    result = api.get_contacts_by_list_id(id, params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_contacts_by_list_id: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n            // Optional, you can pass them as null values to getContactsByListId method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string orderBy = \"id\";\n            string direction = \"desc\";\n\n            try {\n                // GetContactsByListIdPaginatedResponse class object\n                var result = apiInstance.GetContactsByListId(id, page, limit, orderBy, direction);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getContactsByListId: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n        ' Optional, you can pass them as null values to getContactsByListId method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n\n        Try\n            ' GetContactsByListIdPaginatedResponse class object\n            Dim result = apiInstance.GetContactsByListId(id, page, limit, orderBy, direction)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getContactsByListId: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    opts := tm.GetContactsByListIdOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n    }\n\n    // tm.GetContactsByListIdPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetContactsByListId(auth, id, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n\n    try {\n        pplx::task<std::shared_ptr<GetContactsByListIdPaginatedResponse>> result = api.getContactsByListId(id, page, limit, orderBy, direction);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getContactsByListId() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n# Optional params, you can skip them\npage = 1\nlimit = 10\norder_by = \"id\"\ndirection = \"desc\"\n\ntry:\n    # GetContactsByListIdPaginatedResponse object\n    result = api_instance.get_contacts_by_list_id(id=id, page=page, limit=limit, order_by=order_by, direction=direction)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_contacts_by_list_id: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $orderBy = 'id';\nmy $direction = 'desc';\n\neval {\n    # GetContactsByListIdPaginatedResponse object\n    my $result = $api_instance->get_contacts_by_list_id(id => $id, page => $page, limit => $limit, orderBy => $orderBy, direction => $direction);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_contacts_by_list_id: $@\\n\";\n}"
          }
        ]
      },
      "post": {
        "operationId": "clearAndAssignContactsToList",
        "summary": "Reset list members to the specified contacts",
        "parameters": [
          {
            "name": "ClearAndAssignContactsToListInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "contacts"
              ],
              "properties": {
                "contacts": {
                  "type": "string",
                  "example": "1,2",
                  "description": "Contact ID(s), separated by a comma or \"all\" to add all contacts belonging to the current user."
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when trying to edit a list shared to the current user."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new ClearAndAssignContactsToListInputObject();\n\n// Required parameters\n$input->setContacts(\"1,2\");\n$id = 1;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->clearAndAssignContactsToList($input$id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->clearAndAssignContactsToList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        ClearAndAssignContactsToListInputObject input = new ClearAndAssignContactsToListInputObject();\n\n        // Required parameters\n        input.setContacts(\"1,2\");\n        int id = 1;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.clearAndAssignContactsToList(inputid);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling clearAndAssignContactsToList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    contacts: \"1,2\",\n}\nconst id = 1;\n\n\napi.clearAndAssignContactsToList(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::ClearAndAssignContactsToListInputObject.new\n\n# Required parameters\nobj.contacts = \"1,2\"\nid = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.clear_and_assign_contacts_to_list(input, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->clear_and_assign_contacts_to_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new ClearAndAssignContactsToListInputObject();\n\n            // Required parameters\n            obj.Contacts = \"1,2\";\n            int id = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.ClearAndAssignContactsToList(objid);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling clearAndAssignContactsToList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New ClearAndAssignContactsToListInputObject With {\n            .Contacts = \"1,2\"\n        }\n        Dim id As Integer = 1\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.ClearAndAssignContactsToList(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling clearAndAssignContactsToList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Contacts: \"1,2\",\n    }\n    // Required\n    var id int32 = 1\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.ClearAndAssignContactsToList(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<ClearAndAssignContactsToListInputObject> input(new ClearAndAssignContactsToListInputObject);\n    // Required parameters\n    input->setContacts(\"1,2\");\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.clearAndAssignContactsToList(input, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"clearAndAssignContactsToList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.ClearAndAssignContactsToListInputObject()\n\n# Required parameters\ninput.contacts = \"1,2\"\nid = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.clear_and_assign_contacts_to_list(clear_and_assign_contacts_to_list_input_object=input, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->clear_and_assign_contacts_to_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::ClearAndAssignContactsToListInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::ClearAndAssignContactsToListInputObject->new(\n    # Required parameters\n    contacts => '1,2',\n);\nmy $id = 1;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->clear_and_assign_contacts_to_list(clear_and_assign_contacts_to_list_input_object => $input, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->clear_and_assign_contacts_to_list: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/clearAndAssignContactsToList\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "put": {
        "operationId": "assignContactsToList",
        "summary": "Assign contacts to a list",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/assignContactsToList\" target=\"_blank\">Try in sandbox</a><br>> Unlike all other PUT requests, this command does not need old contact IDs to be submitted. For example, if you have a list with contacts 150, 151 and 152 and you want to add contact ID 153, you only need to submit 153 as a parameter of PUT /api/v2/lists/{id}/contacts.\n",
        "parameters": [
          {
            "name": "AssignContactsToListInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "contacts"
              ],
              "properties": {
                "contacts": {
                  "type": "string",
                  "example": "318,454,30091",
                  "description": "Comma-separated array of [Contacts](https://docs.textmagic.com/#tag/Contacts) IDs."
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when trying to edit a list shared to the current user."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new AssignContactsToListInputObject();\n\n// Required parameters\n$input->setContacts(\"318,454,30091\");\n$id = 1;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->assignContactsToList($input$id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->assignContactsToList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        AssignContactsToListInputObject input = new AssignContactsToListInputObject();\n\n        // Required parameters\n        input.setContacts(\"318,454,30091\");\n        int id = 1;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.assignContactsToList(inputid);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling assignContactsToList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    contacts: \"318,454,30091\",\n}\nconst id = 1;\n\n\napi.assignContactsToList(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::AssignContactsToListInputObject.new\n\n# Required parameters\nobj.contacts = \"318,454,30091\"\nid = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.assign_contacts_to_list(input, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->assign_contacts_to_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new AssignContactsToListInputObject();\n\n            // Required parameters\n            obj.Contacts = \"318,454,30091\";\n            int id = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.AssignContactsToList(objid);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling assignContactsToList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New AssignContactsToListInputObject With {\n            .Contacts = \"318,454,30091\"\n        }\n        Dim id As Integer = 1\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.AssignContactsToList(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling assignContactsToList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Contacts: \"318,454,30091\",\n    }\n    // Required\n    var id int32 = 1\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.AssignContactsToList(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<AssignContactsToListInputObject> input(new AssignContactsToListInputObject);\n    // Required parameters\n    input->setContacts(\"318,454,30091\");\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.assignContactsToList(input, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"assignContactsToList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.AssignContactsToListInputObject()\n\n# Required parameters\ninput.contacts = \"318,454,30091\"\nid = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.assign_contacts_to_list(assign_contacts_to_list_input_object=input, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->assign_contacts_to_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::AssignContactsToListInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::AssignContactsToListInputObject->new(\n    # Required parameters\n    contacts => '318,454,30091',\n);\nmy $id = 1;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->assign_contacts_to_list(assign_contacts_to_list_input_object => $input, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->assign_contacts_to_list: $@\\n\";\n}"
          }
        ]
      },
      "delete": {
        "operationId": "deleteContactsFromList",
        "produces": [],
        "summary": "Unassign contacts from a list",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/deleteContactsFromList\" target=\"_blank\">Try in sandbox</a><br>> When you remove contacts from a specific list, they will be deleted permanently, unless they are first saved in another list.\n",
        "parameters": [
          {
            "name": "deleteContacsFromListObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "contacts"
              ],
              "properties": {
                "contacts": {
                  "type": "string",
                  "example": "318,454,30091",
                  "description": "Comma-separated array of [Contacts](https://docs.textmagic.com/#tag/Contacts) IDs.\n"
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when trying to edit a list shared to the current user."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteContactsFromList($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteContactsFromList: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteContactsFromList(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteContactsFromList\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteContactsFromList(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_contacts_from_list(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_contacts_from_list: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteContactsFromList(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteContactsFromList: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteContactsFromList(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteContactsFromList: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteContactsFromList(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteContactsFromList(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteContactsFromList() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_contacts_from_list(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_contacts_from_list: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_contacts_from_list(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_contacts_from_list: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/lists/{id}/contacts/delete": {
      "post": {
        "operationId": "deleteListContactsBulk",
        "summary": "Delete contacts from a list (bulk)",
        "produces": [],
        "parameters": [
          {
            "name": "DeleteListContactsBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "integer",
                  "example": 0,
                  "enum": [
                    0,
                    1
                  ],
                  "description": "Default is 0 (false). If set to 1, all entities will be removed."
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteListContactsBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n$id = 1;\n\ntry {\n    $api->deleteListContactsBulk($input$id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteListContactsBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteListContactsBulkInputObject input = new DeleteListContactsBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n        int id = 1;\n\n        try {\n            apiInstance.deleteListContactsBulk(inputid);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteListContactsBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\nconst id = 1;\n\n\napi.deleteListContactsBulk(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteListContactsBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\nid = 1\n\nbegin\n    api.delete_list_contacts_bulk(input, id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_list_contacts_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteListContactsBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n            int id = 1;\n\n            try {\n                apiInstance.DeleteListContactsBulk(objid);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteListContactsBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteListContactsBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteListContactsBulk(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteListContactsBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteListContactsBulk(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteListContactsBulkInputObject> input(new DeleteListContactsBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteListContactsBulk(input, id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteListContactsBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteListContactsBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\nid = 1\n\ntry:\n    api_instance.delete_list_contacts_bulk(delete_list_contacts_bulk_input_object=input, id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_list_contacts_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteListContactsBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteListContactsBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\nmy $id = 1;\n\neval {\n    $api_instance->delete_list_contacts_bulk(delete_list_contacts_bulk_input_object => $input, id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_list_contacts_bulk: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/deleteListContactsBulk\" target=\"_blank\">Try in sandbox</a><br>Delete contacts from a list (bulk)"
      }
    },
    "/api/v2/lists/{id}/avatar": {
      "post": {
        "operationId": "uploadListAvatar",
        "summary": "Add an avatar for a list",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "image",
            "in": "formData",
            "required": true,
            "description": "List avatar. Should be a PNG or JPG file not more than 10 MB.",
            "type": "file",
            "format": "binary"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "201": {
            "description": "Avatar uploaded with success.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when trying to edit a list shared to the current user."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$image = new \\SplFileObject(\"test.jpg\");\n$id = 1;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->uploadListAvatar($image, $id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->uploadListAvatar: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\nimport java.io.File;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // change to your file path\n        File image = new File(\"test.jpg\");\n        int id = 1;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.uploadListAvatar(image, id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling uploadListAvatar\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst fs = require('fs');\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n// change to your file path.\nconst image = new fs.ReadStream('filePath');\nconst id = 1;\n\n\napi.uploadListAvatar(image, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nimage = File.open('test.png', 'r')\nid = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.upload_list_avatar(image, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->upload_list_avatar: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // change to your file path\n            var image = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open);\n            int id = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.UploadListAvatar(image, id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling uploadListAvatar: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' change to your file path\n        Dim image = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open)\n        Dim id As Integer = 1\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.UploadListAvatar(image, id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling uploadListAvatar: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\nSorry, file upload calls for Go SDK do not supported yet.\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::filebuf fb;\n    fb.open (\"test.jpg\", std::ios::in);\n    std::shared_ptr<std::istream> is(new std::istream(&fb));\n\n    std::shared_ptr<HttpContent> image(new HttpContent);\n    image->setName(\"test\");\n    image->setContentDisposition(\"attachment\");\n    image->setFileName(\"test.jpg\");\n\n    image->setContentType(\"image/jpeg\");\n    image->setData(is);\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.uploadListAvatar(image, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"uploadListAvatar() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# change to your file path\nimage = \"test.jpg\"\nid = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.upload_list_avatar(image=image, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->upload_list_avatar: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# change to your file path\nmy $image = 'test.jpg';\nmy $id = 1;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->upload_list_avatar(image => $image, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->upload_list_avatar: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/uploadListAvatar\" target=\"_blank\">Try in sandbox</a><br>Add an avatar for a list"
      },
      "delete": {
        "operationId": "deleteListAvatar",
        "summary": "Delete an avatar for a list",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Avatar has been deleted with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when trying to edit a list shared to the current user."
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Lists"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteListAvatar($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteListAvatar: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteListAvatar(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteListAvatar\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteListAvatar(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_list_avatar(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_list_avatar: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteListAvatar(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteListAvatar: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteListAvatar(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteListAvatar: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteListAvatar(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteListAvatar(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteListAvatar() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_list_avatar(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_list_avatar: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_list_avatar(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_list_avatar: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Lists/deleteListAvatar\" target=\"_blank\">Try in sandbox</a><br>Delete an avatar for a list"
      }
    },
    "/api/v2/templates": {
      "post": {
        "operationId": "createTemplate",
        "summary": "Create a template",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Templates/createTemplate\" target=\"_blank\">Try in sandbox</a><br>There are times when creating a new template makes sense (such as when targeting specific clients or improving your business strategies). \nYou can create new SMS templates for marketing purposes or SMS templates for business campaigns.\n",
        "parameters": [
          {
            "name": "CreateTemplateInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "name",
                "content"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Template name.",
                  "example": "New template name"
                },
                "content": {
                  "type": "string",
                  "description": "Template text. May contain dynamic fields inside braces. See [Custom fields list](https://docs.textmagic.com/#tag/Templates/Custom-fields-list-(Merge-dynamic-fields)).",
                  "example": "New template content"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Returned when the form has errors."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Templates"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new CreateTemplateInputObject();\n\n// Required parameters\n$input->setName(\"New template name\");\n$input->setContent(\"New template content\");\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->createTemplate($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->createTemplate: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        CreateTemplateInputObject input = new CreateTemplateInputObject();\n\n        // Required parameters\n        input.setName(\"New template name\");\n        input.setContent(\"New template content\");\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.createTemplate(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling createTemplate\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    name: \"New template name\",\n    content: \"New template content\",\n}\n\n\napi.createTemplate(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::CreateTemplateInputObject.new\n\n# Required parameters\nobj.name = \"New template name\"\nobj.content = \"New template content\"\n\nbegin\n    # ResourceLinkResponse object\n    result = api.create_template(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->create_template: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new CreateTemplateInputObject();\n\n            // Required parameters\n            obj.Name = \"New template name\";\n            obj.Content = \"New template content\";\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.CreateTemplate(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling createTemplate: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New CreateTemplateInputObject With {\n            .Name = \"New template name\",\n            .Content = \"New template content\"\n        }\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.CreateTemplate(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling createTemplate: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Name: \"New template name\",\n        Content: \"New template content\",\n    }\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.CreateTemplate(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<CreateTemplateInputObject> input(new CreateTemplateInputObject);\n    // Required parameters\n    input->setName(\"New template name\");\n    input->setContent(\"New template content\");\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.createTemplate(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"createTemplate() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.CreateTemplateInputObject()\n\n# Required parameters\ninput.name = \"New template name\"\ninput.content = \"New template content\"\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.create_template(create_template_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->create_template: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::CreateTemplateInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::CreateTemplateInputObject->new(\n    # Required parameters\n    name => 'New template name',\n    content => 'New template content',\n);\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->create_template(create_template_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->create_template: $@\\n\";\n}"
          }
        ]
      },
      "get": {
        "operationId": "getAllTemplates",
        "summary": "Get all templates",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "x-example": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "x-example": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetAllTemplatesPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Templates"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getAllTemplates method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // GetAllTemplatesPaginatedResponse class object\n    $result = $api->getAllTemplates($page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getAllTemplates: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getAllTemplates method below, default values will be used\n        int page = 1;\n        int limit = 10;\n\n        try {\n            // GetAllTemplatesPaginatedResponse class object\n            GetAllTemplatesPaginatedResponse obj = apiInstance.getAllTemplates(page, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getAllTemplates\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getAllTemplates(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # GetAllTemplatesPaginatedResponse object\n    result = api.get_all_templates(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_all_templates: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getAllTemplates method below, default values will be used\n            int page = 1;\n            int limit = 10;\n\n            try {\n                // GetAllTemplatesPaginatedResponse class object\n                var result = apiInstance.GetAllTemplates(page, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getAllTemplates: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getAllTemplates method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' GetAllTemplatesPaginatedResponse class object\n            Dim result = apiInstance.GetAllTemplates(page, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getAllTemplates: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetAllTemplatesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.GetAllTemplatesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetAllTemplates(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<GetAllTemplatesPaginatedResponse>> result = api.getAllTemplates(page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getAllTemplates() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # GetAllTemplatesPaginatedResponse object\n    result = api_instance.get_all_templates(page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_all_templates: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # GetAllTemplatesPaginatedResponse object\n    my $result = $api_instance->get_all_templates(page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_all_templates: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Templates/getAllTemplates\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/templates/search": {
      "get": {
        "operationId": "searchTemplates",
        "summary": "Find templates by criteria",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Templates/searchTemplates\" target=\"_blank\">Try in sandbox</a><br>Find user templates by given parameters.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Find template by ID(s).",
            "type": "string"
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Find template by name.",
            "type": "string"
          },
          {
            "name": "content",
            "in": "query",
            "required": false,
            "description": "Find template by content.",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/SearchTemplatesPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Templates"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to searchTemplates method below, default values will be used\n$page = 1;\n$limit = 10;\n$ids = \"sampleValue\";\n$name = \"sampleValue\";\n$content = \"sampleValue\";\n\ntry {\n    // SearchTemplatesPaginatedResponse class object\n    $result = $api->searchTemplates($page, $limit, $ids, $name, $content);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->searchTemplates: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to searchTemplates method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String ids = \"sampleValue\";\n        String name = \"sampleValue\";\n        String content = \"sampleValue\";\n\n        try {\n            // SearchTemplatesPaginatedResponse class object\n            SearchTemplatesPaginatedResponse obj = apiInstance.searchTemplates(page, limit, ids, name, content);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling searchTemplates\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    ids: \"sampleValue\",\n    name: \"sampleValue\",\n    content: \"sampleValue\",\n};\n\napi.searchTemplates(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  ids: 'sampleValue',\n  name: 'sampleValue',\n  content: 'sampleValue',\n}\n\nbegin\n    # SearchTemplatesPaginatedResponse object\n    result = api.search_templates(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->search_templates: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to searchTemplates method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string ids = \"sampleValue\";\n            string name = \"sampleValue\";\n            string content = \"sampleValue\";\n\n            try {\n                // SearchTemplatesPaginatedResponse class object\n                var result = apiInstance.SearchTemplates(page, limit, ids, name, content);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling searchTemplates: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to searchTemplates method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim ids As String = \"sampleValue\"\n        Dim name As String = \"sampleValue\"\n        Dim content As String = \"sampleValue\"\n\n        Try\n            ' SearchTemplatesPaginatedResponse class object\n            Dim result = apiInstance.SearchTemplates(page, limit, ids, name, content)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling searchTemplates: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.SearchTemplatesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Ids: optional.NewString(\"sampleValue\"),\n        Name: optional.NewString(\"sampleValue\"),\n        Content: optional.NewString(\"sampleValue\"),\n    }\n\n    // tm.SearchTemplatesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.SearchTemplates(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string ids = \"sampleValue\";\n    std::string name = \"sampleValue\";\n    std::string content = \"sampleValue\";\n\n    try {\n        pplx::task<std::shared_ptr<SearchTemplatesPaginatedResponse>> result = api.searchTemplates(page, limit, ids, name, content);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"searchTemplates() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nids = \"sampleValue\"\nname = \"sampleValue\"\ncontent = \"sampleValue\"\n\ntry:\n    # SearchTemplatesPaginatedResponse object\n    result = api_instance.search_templates(page=page, limit=limit, ids=ids, name=name, content=content)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->search_templates: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $ids = 'sampleValue';\nmy $name = 'sampleValue';\nmy $content = 'sampleValue';\n\neval {\n    # SearchTemplatesPaginatedResponse object\n    my $result = $api_instance->search_templates(page => $page, limit => $limit, ids => $ids, name => $name, content => $content);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->search_templates: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/templates/{id}": {
      "get": {
        "operationId": "getTemplate",
        "summary": "Get a template`s details",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Templates/getTemplate\" target=\"_blank\">Try in sandbox</a><br>Get a single template.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/MessageTemplate"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Templates"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // MessageTemplate class object\n    $result = $api->getTemplate($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getTemplate: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // MessageTemplate class object\n            MessageTemplate obj = apiInstance.getTemplate(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getTemplate\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getTemplate(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # MessageTemplate object\n    result = api.get_template(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_template: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // MessageTemplate class object\n                var result = apiInstance.GetTemplate(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getTemplate: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' MessageTemplate class object\n            Dim result = apiInstance.GetTemplate(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getTemplate: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.MessageTemplate struct\n    result, _, err := client.TextMagicApi.GetTemplate(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<MessageTemplate>> result = api.getTemplate(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getTemplate() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # MessageTemplate object\n    result = api_instance.get_template(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_template: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # MessageTemplate object\n    my $result = $api_instance->get_template(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_template: $@\\n\";\n}"
          }
        ]
      },
      "put": {
        "operationId": "updateTemplate",
        "summary": "Update a template",
        "parameters": [
          {
            "name": "UpdateTemplateInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "name",
                "content"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Template name.",
                  "example": "New template name"
                },
                "content": {
                  "type": "string",
                  "description": "Template text. May contain dynamic fields inside braces. See [Custom fields list](https://docs.textmagic.com/#tag/Templates/Custom-fields-list-(Merge-dynamic-fields)).",
                  "example": "New template content"
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Returned when the form has errors."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Templates"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UpdateTemplateInputObject();\n\n// Required parameters\n$input->setName(\"New template name\");\n$input->setContent(\"New template content\");\n$id = 1;\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->updateTemplate($input$id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->updateTemplate: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UpdateTemplateInputObject input = new UpdateTemplateInputObject();\n\n        // Required parameters\n        input.setName(\"New template name\");\n        input.setContent(\"New template content\");\n        int id = 1;\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.updateTemplate(inputid);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling updateTemplate\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    name: \"New template name\",\n    content: \"New template content\",\n}\nconst id = 1;\n\n\napi.updateTemplate(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UpdateTemplateInputObject.new\n\n# Required parameters\nobj.name = \"New template name\"\nobj.content = \"New template content\"\nid = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.update_template(input, id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->update_template: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UpdateTemplateInputObject();\n\n            // Required parameters\n            obj.Name = \"New template name\";\n            obj.Content = \"New template content\";\n            int id = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.UpdateTemplate(objid);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling updateTemplate: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UpdateTemplateInputObject With {\n            .Name = \"New template name\",\n            .Content = \"New template content\"\n        }\n        Dim id As Integer = 1\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.UpdateTemplate(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling updateTemplate: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Name: \"New template name\",\n        Content: \"New template content\",\n    }\n    // Required\n    var id int32 = 1\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.UpdateTemplate(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UpdateTemplateInputObject> input(new UpdateTemplateInputObject);\n    // Required parameters\n    input->setName(\"New template name\");\n    input->setContent(\"New template content\");\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.updateTemplate(input, id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"updateTemplate() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UpdateTemplateInputObject()\n\n# Required parameters\ninput.name = \"New template name\"\ninput.content = \"New template content\"\nid = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.update_template(update_template_input_object=input, id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->update_template: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UpdateTemplateInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UpdateTemplateInputObject->new(\n    # Required parameters\n    name => 'New template name',\n    content => 'New template content',\n);\nmy $id = 1;\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->update_template(update_template_input_object => $input, id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->update_template: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Templates/updateTemplate\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteTemplate",
        "summary": "Delete a template",
        "produces": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Templates"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteTemplate($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteTemplate: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteTemplate(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteTemplate\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteTemplate(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_template(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_template: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteTemplate(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteTemplate: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteTemplate(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteTemplate: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteTemplate(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteTemplate(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteTemplate() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_template(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_template: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_template(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_template: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Templates/deleteTemplate\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/templates/delete": {
      "post": {
        "operationId": "deleteTemplatesBulk",
        "summary": "Delete templates (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Templates/deleteTemplatesBulk\" target=\"_blank\">Try in sandbox</a><br>Delete templates by given IDs or delete all templates.",
        "produces": [],
        "parameters": [
          {
            "name": "DeleteTemplatesBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "boolean",
                  "description": "Entity ID(s), separated by comma.",
                  "example": true
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Templates"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteTemplatesBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(true);\n\ntry {\n    $api->deleteTemplatesBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteTemplatesBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteTemplatesBulkInputObject input = new DeleteTemplatesBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(true);\n\n        try {\n            apiInstance.deleteTemplatesBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteTemplatesBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: true,\n}\n\n\napi.deleteTemplatesBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteTemplatesBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = true\n\nbegin\n    api.delete_templates_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_templates_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteTemplatesBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = true;\n\n            try {\n                apiInstance.DeleteTemplatesBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteTemplatesBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteTemplatesBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = true\n        }\n\n        Try\n            apiInstance.DeleteTemplatesBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteTemplatesBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: true,\n    }\n\n    client.TextMagicApi.DeleteTemplatesBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteTemplatesBulkInputObject> input(new DeleteTemplatesBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(true);\n\n    try {\n        pplx::task result = api.deleteTemplatesBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteTemplatesBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteTemplatesBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = true\n\ntry:\n    api_instance.delete_templates_bulk(delete_templates_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_templates_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteTemplatesBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteTemplatesBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => 1,\n);\n\neval {\n    $api_instance->delete_templates_bulk(delete_templates_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_templates_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/messages": {
      "post": {
        "operationId": "sendMessage",
        "summary": "Send message",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/sendMessage\" target=\"_blank\">Try in sandbox</a><br>This is the main entrypoint to send messages. See the examples above for the reference.",
        "parameters": [
          {
            "name": "SendMessageInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "text",
                "phones"
              ],
              "properties": {
                "text": {
                  "type": "string",
                  "description": "Message text. Required if the **template_id** is not set.",
                  "example": "Hello, how are you?"
                },
                "templateId": {
                  "type": "integer",
                  "description": "Template used instead of message text. Required if the **text** is not set.",
                  "example": 1
                },
                "sendingTime": {
                  "type": "integer",
                  "description": "DEPRECATED, consider using sendingDateTime and sendingTimezone parameters instead: Optional (required with rrule set). Message sending time in unix timestamp format. Default is now.",
                  "example": 1565606455,
                  "deprecated": true
                },
                "sendingDateTime": {
                  "type": "string",
                  "description": "Sending time in Y-m-d H:i:s format (e.g. 2022-05-27 13:05:10). This time is relative to **sendingTimezone**. Note: for correct operation, the value of seconds must not be less than 10.",
                  "example": "2020-05-27 13:02:33"
                },
                "sendingTimezone": {
                  "type": "string",
                  "description": "ID or ISO-name of timezone used for sending when sendingDateTime parameter is set. E.g. if you specify sendingDateTime = \\\"2016-05-27 13:02:33\\\" and sendingTimezone = \\\"America/Buenos_Aires\\\", your message will be sent at May 27, 2016 13:02:33 Buenos Aires time, or 16:02:33 UTC. Default is account timezone.",
                  "example": "America/Buenos_Aires"
                },
                "contacts": {
                  "type": "string",
                  "description": "Comma separated array of contact resources id message will be sent to.",
                  "example": "1,2,3,4"
                },
                "lists": {
                  "type": "string",
                  "description": "Comma separated array of list resources id message will be sent to.",
                  "example": "1,2,3,4"
                },
                "phones": {
                  "type": "string",
                  "description": "Comma separated array of E.164 phone numbers message will be sent to.",
                  "example": "447860021130,447860021131"
                },
                "cutExtra": {
                  "type": "boolean",
                  "description": "Should sending method cut extra characters which not fit supplied partsCount or return 400 Bad request response instead.",
                  "example": true,
                  "default": false
                },
                "partsCount": {
                  "type": "integer",
                  "description": "Maximum message parts count (Textmagic allows sending 1 to 6 message parts).",
                  "example": 6,
                  "default": 6
                },
                "referenceId": {
                  "type": "integer",
                  "description": "Custom message reference id which can be used in your application infrastructure.",
                  "example": 1
                },
                "from": {
                  "type": "string",
                  "description": "One of allowed Sender ID (phone number or alphanumeric sender ID). If specified Sender ID is not allowed for some destinations, a fallback default Sender ID will be used to ensure delivery. See [Get timezones](https://docs.textmagic.com/#tag/Sender-IDs).",
                  "example": "Test sender id"
                },
                "rrule": {
                  "type": "string",
                  "description": "iCal RRULE parameter to create recurrent scheduled messages. When used, sendingTime is mandatory as start point of sending. See https://www.textmagic.com/free-tools/rrule-generator for format details.",
                  "example": "FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1"
                },
                "createChat": {
                  "type": "boolean",
                  "description": "Should sending method try to create new Chat (if not exist) with specified recipients?",
                  "example": false,
                  "default": false
                },
                "tts": {
                  "type": "boolean",
                  "description": "Send a Text-to-Speech message.",
                  "example": false,
                  "default": false
                },
                "local": {
                  "type": "boolean",
                  "description": "Treat phone numbers passed in the \\'phones\\' field as local.",
                  "example": false,
                  "default": false
                },
                "localCountry": {
                  "type": "string",
                  "description": "The 2-letter ISO country code for local phone numbers, used when \\'local\\' is set to true. Default is the account country.",
                  "example": "US"
                },
                "destination": {
                  "type": "string",
                  "description": "Messsage destination type allowed [mms, tts].",
                  "example": "mms"
                },
                "resources": {
                  "type": "string",
                  "description": "File name from mms attachment response (named as resource)",
                  "example": "tmauKcSmwflB77kLQ15904023426649.jpg"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/SendMessageResponse"
            }
          },
          "202": {
            "description": "Returned when a bulk session has been created."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new SendMessageInputObject();\n\n// Required parameters\n$input->setText(\"Hello, how are you?\");\n$input->setPhones(\"447860021130,447860021131\");\n\n// Optional parameters, you can skip these setters calls\n$input->setTemplateId(1);\n$input->setSendingTime(1565606455);\n$input->setSendingDateTime(\"2020-05-27 13:02:33\");\n$input->setSendingTimezone(\"America/Buenos_Aires\");\n$input->setContacts(\"1,2,3,4\");\n$input->setLists(\"1,2,3,4\");\n$input->setCutExtra(true);\n$input->setPartsCount(6);\n$input->setReferenceId(1);\n$input->setFrom(\"Test sender id\");\n$input->setRrule(\"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\");\n$input->setCreateChat(null);\n$input->setTts(null);\n$input->setLocal(null);\n$input->setLocalCountry(\"US\");\n$input->setDestination(\"mms\");\n$input->setResources(\"tmauKcSmwflB77kLQ15904023426649.jpg\");\n\ntry {\n    // SendMessageResponse class object\n    $result = $api->sendMessage($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->sendMessage: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        SendMessageInputObject input = new SendMessageInputObject();\n\n        // Required parameters\n        input.setText(\"Hello, how are you?\");\n        input.setPhones(\"447860021130,447860021131\");\n\n        // Optional parameters, you can skip these setters calls\n        input.setTemplateId(1);\n        input.setSendingTime(1565606455);\n        input.setSendingDateTime(\"2020-05-27 13:02:33\");\n        input.setSendingTimezone(\"America/Buenos_Aires\");\n        input.setContacts(\"1,2,3,4\");\n        input.setLists(\"1,2,3,4\");\n        input.setCutExtra(true);\n        input.setPartsCount(6);\n        input.setReferenceId(1);\n        input.setFrom(\"Test sender id\");\n        input.setRrule(\"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\");\n        input.setCreateChat(null);\n        input.setTts(null);\n        input.setLocal(null);\n        input.setLocalCountry(\"US\");\n        input.setDestination(\"mms\");\n        input.setResources(\"tmauKcSmwflB77kLQ15904023426649.jpg\");\n\n        try {\n            // SendMessageResponse class object\n            SendMessageResponse obj = apiInstance.sendMessage(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling sendMessage\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    text: \"Hello, how are you?\",\n    phones: \"447860021130,447860021131\",\n    // Optional parameters\n    templateId: 1,\n    sendingTime: 1565606455,\n    sendingDateTime: \"2020-05-27 13:02:33\",\n    sendingTimezone: \"America/Buenos_Aires\",\n    contacts: \"1,2,3,4\",\n    lists: \"1,2,3,4\",\n    cutExtra: true,\n    partsCount: 6,\n    referenceId: 1,\n    from: \"Test sender id\",\n    rrule: \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\",\n    createChat: null,\n    tts: null,\n    local: null,\n    localCountry: \"US\",\n    destination: \"mms\",\n    resources: \"tmauKcSmwflB77kLQ15904023426649.jpg\",\n}\n\n\napi.sendMessage(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::SendMessageInputObject.new\n\n# Required parameters\nobj.text = \"Hello, how are you?\"\nobj.phones = \"447860021130,447860021131\"\n# Optional parameters, you can skip them\nobj.template_id = 1\nobj.sending_time = 1565606455\nobj.sending_date_time = \"2020-05-27 13:02:33\"\nobj.sending_timezone = \"America/Buenos_Aires\"\nobj.contacts = \"1,2,3,4\"\nobj.lists = \"1,2,3,4\"\nobj.cut_extra = true\nobj.parts_count = 6\nobj.reference_id = 1\nobj.from = \"Test sender id\"\nobj.rrule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\"\nobj.create_chat = null\nobj.tts = null\nobj.local = null\nobj.local_country = \"US\"\nobj.destination = \"mms\"\nobj.resources = \"tmauKcSmwflB77kLQ15904023426649.jpg\"\n\nbegin\n    # SendMessageResponse object\n    result = api.send_message(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->send_message: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new SendMessageInputObject();\n\n            // Required parameters\n            obj.Text = \"Hello, how are you?\";\n            obj.Phones = \"447860021130,447860021131\";\n\n            // Optional parameters, you can skip these setters calls\n            obj.TemplateId = 1;\n            obj.SendingTime = 1565606455;\n            obj.SendingDateTime = \"2020-05-27 13:02:33\";\n            obj.SendingTimezone = \"America/Buenos_Aires\";\n            obj.Contacts = \"1,2,3,4\";\n            obj.Lists = \"1,2,3,4\";\n            obj.CutExtra = true;\n            obj.PartsCount = 6;\n            obj.ReferenceId = 1;\n            obj.From = \"Test sender id\";\n            obj.Rrule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\";\n            obj.CreateChat = null;\n            obj.Tts = null;\n            obj.Local = null;\n            obj.LocalCountry = \"US\";\n            obj.Destination = \"mms\";\n            obj.Resources = \"tmauKcSmwflB77kLQ15904023426649.jpg\";\n\n            try {\n                // SendMessageResponse class object\n                var result = apiInstance.SendMessage(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling sendMessage: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New SendMessageInputObject With {\n            .Text = \"Hello, how are you?\",\n            .TemplateId = 1,\n            .SendingTime = 1565606455,\n            .SendingDateTime = \"2020-05-27 13:02:33\",\n            .SendingTimezone = \"America/Buenos_Aires\",\n            .Contacts = \"1,2,3,4\",\n            .Lists = \"1,2,3,4\",\n            .Phones = \"447860021130,447860021131\",\n            .CutExtra = true,\n            .PartsCount = 6,\n            .ReferenceId = 1,\n            .From = \"Test sender id\",\n            .Rrule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\",\n            .CreateChat = null,\n            .Tts = null,\n            .Local = null,\n            .LocalCountry = \"US\",\n            .Destination = \"mms\",\n            .Resources = \"tmauKcSmwflB77kLQ15904023426649.jpg\"\n        }\n\n        Try\n            ' SendMessageResponse class object\n            Dim result = apiInstance.SendMessage(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling sendMessage: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Text: \"Hello, how are you?\",\n        Phones: \"447860021130,447860021131\",\n        // Optional parameters, you can skip them\n        TemplateId: 1,\n        SendingTime: 1565606455,\n        SendingDateTime: \"2020-05-27 13:02:33\",\n        SendingTimezone: \"America/Buenos_Aires\",\n        Contacts: \"1,2,3,4\",\n        Lists: \"1,2,3,4\",\n        CutExtra: true,\n        PartsCount: 6,\n        ReferenceId: 1,\n        From: \"Test sender id\",\n        Rrule: \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\",\n        CreateChat: null,\n        Tts: null,\n        Local: null,\n        LocalCountry: \"US\",\n        Destination: \"mms\",\n        Resources: \"tmauKcSmwflB77kLQ15904023426649.jpg\",\n    }\n\n    // tm.SendMessageResponse struct\n    result, _, err := client.TextMagicApi.SendMessage(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<SendMessageInputObject> input(new SendMessageInputObject);\n    // Required parameters\n    input->setText(\"Hello, how are you?\");\n    input->setPhones(\"447860021130,447860021131\");\n    // Optional parameters, you can skip them\n    input->setTemplateId(1);\n    input->setSendingTime(1565606455);\n    input->setSendingDateTime(\"2020-05-27 13:02:33\");\n    input->setSendingTimezone(\"America/Buenos_Aires\");\n    input->setContacts(\"1,2,3,4\");\n    input->setLists(\"1,2,3,4\");\n    input->setCutExtra(true);\n    input->setPartsCount(6);\n    input->setReferenceId(1);\n    input->setFrom(\"Test sender id\");\n    input->setRrule(\"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\");\n    input->setCreateChat(null);\n    input->setTts(null);\n    input->setLocal(null);\n    input->setLocalCountry(\"US\");\n    input->setDestination(\"mms\");\n    input->setResources(\"tmauKcSmwflB77kLQ15904023426649.jpg\");\n\n    try {\n        pplx::task<std::shared_ptr<SendMessageResponse>> result = api.sendMessage(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"sendMessage() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.SendMessageInputObject()\n\n# Required parameters\ninput.text = \"Hello, how are you?\"\ninput.phones = \"447860021130,447860021131\"\n# Optional parameters, you can skip them\ninput.template_id = 1\ninput.sending_time = 1565606455\ninput.sending_date_time = \"2020-05-27 13:02:33\"\ninput.sending_timezone = \"America/Buenos_Aires\"\ninput.contacts = \"1,2,3,4\"\ninput.lists = \"1,2,3,4\"\ninput.cut_extra = true\ninput.parts_count = 6\ninput.reference_id = 1\ninput._from = \"Test sender id\"\ninput.rrule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\"\ninput.create_chat = null\ninput.tts = null\ninput.local = null\ninput.local_country = \"US\"\ninput.destination = \"mms\"\ninput.resources = \"tmauKcSmwflB77kLQ15904023426649.jpg\"\n\ntry:\n    # SendMessageResponse object\n    result = api_instance.send_message(send_message_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->send_message: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::SendMessageInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::SendMessageInputObject->new(\n    # Required parameters\n    text => 'Hello, how are you?',\n    phones => '447860021130,447860021131',\n    # Optional parameters, you can skip them\n    templateId => 1,\n    sendingTime => 1565606455,\n    sendingDateTime => '2020-05-27 13:02:33',\n    sendingTimezone => 'America/Buenos_Aires',\n    contacts => '1,2,3,4',\n    lists => '1,2,3,4',\n    cutExtra => 1,\n    partsCount => 6,\n    referenceId => 1,\n    from => 'Test sender id',\n    rrule => 'FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1',\n    createChat => null,\n    tts => null,\n    local => null,\n    localCountry => 'US',\n    destination => 'mms',\n    resources => 'tmauKcSmwflB77kLQ15904023426649.jpg',\n);\n\neval {\n    # SendMessageResponse object\n    my $result = $api_instance->send_message(send_message_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->send_message: $@\\n\";\n}"
          }
        ]
      },
      "get": {
        "operationId": "getAllOutboundMessages",
        "summary": "Get all messages",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/getAllOutboundMessages\" target=\"_blank\">Try in sandbox</a><br>Get all user oubound messages.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "lastId",
            "in": "query",
            "description": "Filter results by ID, selecting all values lesser than the specified ID. Note that the \\'page\\' parameter is ignored when \\'lastId\\' is specified.",
            "type": "integer"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetAllOutboundMessagesPaginatedResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getAllOutboundMessages method below, default values will be used\n$page = 1;\n$limit = 10;\n$lastId = 1;\n\ntry {\n    // GetAllOutboundMessagesPaginatedResponse class object\n    $result = $api->getAllOutboundMessages($page, $limit, $lastId);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getAllOutboundMessages: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getAllOutboundMessages method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        int lastId = 1;\n\n        try {\n            // GetAllOutboundMessagesPaginatedResponse class object\n            GetAllOutboundMessagesPaginatedResponse obj = apiInstance.getAllOutboundMessages(page, limit, lastId);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getAllOutboundMessages\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    lastId: 1,\n};\n\napi.getAllOutboundMessages(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  last_id: 1,\n}\n\nbegin\n    # GetAllOutboundMessagesPaginatedResponse object\n    result = api.get_all_outbound_messages(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_all_outbound_messages: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getAllOutboundMessages method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            int lastId = 1;\n\n            try {\n                // GetAllOutboundMessagesPaginatedResponse class object\n                var result = apiInstance.GetAllOutboundMessages(page, limit, lastId);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getAllOutboundMessages: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getAllOutboundMessages method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim lastId As Integer = 1\n\n        Try\n            ' GetAllOutboundMessagesPaginatedResponse class object\n            Dim result = apiInstance.GetAllOutboundMessages(page, limit, lastId)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getAllOutboundMessages: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetAllOutboundMessagesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        LastId: optional.NewInt32(1),\n    }\n\n    // tm.GetAllOutboundMessagesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetAllOutboundMessages(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    int lastId = 1;\n\n    try {\n        pplx::task<std::shared_ptr<GetAllOutboundMessagesPaginatedResponse>> result = api.getAllOutboundMessages(page, limit, lastId);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getAllOutboundMessages() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nlast_id = 1\n\ntry:\n    # GetAllOutboundMessagesPaginatedResponse object\n    result = api_instance.get_all_outbound_messages(page=page, limit=limit, last_id=last_id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_all_outbound_messages: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $lastId = 1;\n\neval {\n    # GetAllOutboundMessagesPaginatedResponse object\n    my $result = $api_instance->get_all_outbound_messages(page => $page, limit => $limit, lastId => $lastId);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_all_outbound_messages: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/messages/price/normalized": {
      "get": {
        "operationId": "getMessagePrice",
        "summary": "Check message price",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/getMessagePrice\" target=\"_blank\">Try in sandbox</a><br>Check pricing for a new outbound message.",
        "parameters": [
          {
            "name": "includeBlocked",
            "in": "query",
            "description": "Should we show the pricing for blocked contacts?",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "text",
            "in": "query",
            "type": "string",
            "description": "Message text. Required if the **template_id** is not set.",
            "x-example": "Test message test"
          },
          {
            "name": "templateId",
            "in": "query",
            "type": "integer",
            "description": "Template used instead of message text. Required if the **text** is not set.",
            "x-example": 1
          },
          {
            "name": "sendingTime",
            "in": "query",
            "type": "integer",
            "description": "DEPRECATED, consider using the sendingDateTime and sendingTimezone parameters instead: optional (required with rrule set). Message sending time is in unix timestamp format. Default is now.",
            "x-example": 1565606455,
            "deprecated": true
          },
          {
            "name": "sendingDateTime",
            "in": "query",
            "type": "string",
            "description": "Sending time is in Y-m-d H:i:s format (e.g. 2016-05-27 13:02:33). This time is relative to the sendingTimezone.",
            "x-example": "2020-05-27 13:02:33"
          },
          {
            "name": "sendingTimezone",
            "in": "query",
            "type": "string",
            "description": "The ID or ISO-name of the timezone used for sending when sendingDateTime parameter is set, e.g. if you specify sendingDateTime = \\\"2016-05-27 13:02:33\\\" and sendingTimezone = \\\"America/Buenos_Aires\\\", your message will be sent on May 27, 2016 13:02:33 Buenos Aires time, or 16:02:33 UTC. Default is the account timezone.",
            "x-example": "America/Buenos_Aires"
          },
          {
            "name": "contacts",
            "in": "query",
            "type": "string",
            "description": "Comma-separated array of contact resources id message will be sent to.",
            "x-example": "1,2,3,4"
          },
          {
            "name": "lists",
            "in": "query",
            "type": "string",
            "description": "Comma-separated array of list resources id message will be sent to.",
            "x-example": "1,2,3,4"
          },
          {
            "name": "phones",
            "in": "query",
            "type": "string",
            "description": "Comma-separated array of E.164 phone numbers message will be sent to.",
            "x-example": "447860021130,447860021131"
          },
          {
            "name": "cutExtra",
            "in": "query",
            "type": "integer",
            "description": "Should sending method cut extra characters which not fit supplied partsCount or return 400 Bad request response instead.",
            "enum": [
              0,
              1
            ],
            "default": 0
          },
          {
            "name": "partsCount",
            "in": "query",
            "type": "integer",
            "description": "Maximum message parts count (Textmagic allows sending 1 to 6 message parts).",
            "default": 6
          },
          {
            "name": "referenceId",
            "in": "query",
            "type": "integer",
            "description": "Custom message reference id which can be used in your application infrastructure.",
            "x-example": 1
          },
          {
            "name": "from",
            "in": "query",
            "type": "string",
            "description": "One of the allowed Sender ID (phone number or alphanumeric sender ID). If the specified Sender ID is not allowed for some destinations, a fallback default Sender ID will be used to ensure delivery. See [Get timezones](https://docs.textmagic.com/#tag/Sender-IDs).",
            "x-example": "Test Sender ID"
          },
          {
            "name": "rule",
            "in": "query",
            "type": "string",
            "description": "An iCal RRULE parameter to create recurrent scheduled messages. When used, sendingTime is mandatory as the start point of sending. See https://www.textmagic.com/free-tools/rrule-generator for format details.",
            "x-example": "FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1"
          },
          {
            "name": "createChat",
            "in": "query",
            "type": "integer",
            "description": "Should the sending method try to create new Chat (if not exist) with specified recipients?",
            "enum": [
              0,
              1
            ],
            "default": 0
          },
          {
            "name": "tts",
            "in": "query",
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "Send a Text-to-Speech message.",
            "default": 0
          },
          {
            "name": "local",
            "in": "query",
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "Treat phone numbers passed in the \\'phones\\' field as local.",
            "default": 0
          },
          {
            "name": "localCountry",
            "in": "query",
            "type": "string",
            "description": "The 2-letter ISO country code for local phone numbers, used when \\'local\\' is set to true. Default is the account country.",
            "x-example": "US"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetMessagePriceResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getMessagePrice method below, default values will be used\n$includeBlocked = 0;\n$text = \"Test message test\";\n$templateId = 1;\n$sendingTime = 1565606455;\n$sendingDateTime = \"2020-05-27 13:02:33\";\n$sendingTimezone = \"America/Buenos_Aires\";\n$contacts = \"1,2,3,4\";\n$lists = \"1,2,3,4\";\n$phones = \"447860021130,447860021131\";\n$cutExtra = 0;\n$partsCount = 6;\n$referenceId = 1;\n$from = \"Test Sender ID\";\n$rule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\";\n$createChat = 0;\n$tts = 0;\n$local = 0;\n$localCountry = \"US\";\n\ntry {\n    // GetMessagePriceResponse class object\n    $result = $api->getMessagePrice($includeBlocked, $text, $templateId, $sendingTime, $sendingDateTime, $sendingTimezone, $contacts, $lists, $phones, $cutExtra, $partsCount, $referenceId, $from, $rule, $createChat, $tts, $local, $localCountry);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getMessagePrice: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getMessagePrice method below, default values will be used\n        int includeBlocked = 0;\n        String text = \"Test message test\";\n        int templateId = 1;\n        int sendingTime = 1565606455;\n        String sendingDateTime = \"2020-05-27 13:02:33\";\n        String sendingTimezone = \"America/Buenos_Aires\";\n        String contacts = \"1,2,3,4\";\n        String lists = \"1,2,3,4\";\n        String phones = \"447860021130,447860021131\";\n        int cutExtra = 0;\n        int partsCount = 6;\n        int referenceId = 1;\n        String from = \"Test Sender ID\";\n        String rule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\";\n        int createChat = 0;\n        int tts = 0;\n        int local = 0;\n        String localCountry = \"US\";\n\n        try {\n            // GetMessagePriceResponse class object\n            GetMessagePriceResponse obj = apiInstance.getMessagePrice(includeBlocked, text, templateId, sendingTime, sendingDateTime, sendingTimezone, contacts, lists, phones, cutExtra, partsCount, referenceId, from, rule, createChat, tts, local, localCountry);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getMessagePrice\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    includeBlocked: 0,\n    text: \"Test message test\",\n    templateId: 1,\n    sendingTime: 1565606455,\n    sendingDateTime: \"2020-05-27 13:02:33\",\n    sendingTimezone: \"America/Buenos_Aires\",\n    contacts: \"1,2,3,4\",\n    lists: \"1,2,3,4\",\n    phones: \"447860021130,447860021131\",\n    cutExtra: 0,\n    partsCount: 6,\n    referenceId: 1,\n    from: \"Test Sender ID\",\n    rule: \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\",\n    createChat: 0,\n    tts: 0,\n    local: 0,\n    localCountry: \"US\",\n};\n\napi.getMessagePrice(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  include_blocked: 0,\n  text: 'Test message test',\n  template_id: 1,\n  sending_time: 1565606455,\n  sending_date_time: '2020-05-27 13:02:33',\n  sending_timezone: 'America/Buenos_Aires',\n  contacts: '1,2,3,4',\n  lists: '1,2,3,4',\n  phones: '447860021130,447860021131',\n  cut_extra: 0,\n  parts_count: 6,\n  reference_id: 1,\n  from: 'Test Sender ID',\n  rule: 'FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1',\n  create_chat: 0,\n  tts: 0,\n  local: 0,\n  local_country: 'US',\n}\n\nbegin\n    # GetMessagePriceResponse object\n    result = api.get_message_price(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_message_price: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getMessagePrice method below, default values will be used\n            int includeBlocked = 0;\n            string text = \"Test message test\";\n            int templateId = 1;\n            int sendingTime = 1565606455;\n            string sendingDateTime = \"2020-05-27 13:02:33\";\n            string sendingTimezone = \"America/Buenos_Aires\";\n            string contacts = \"1,2,3,4\";\n            string lists = \"1,2,3,4\";\n            string phones = \"447860021130,447860021131\";\n            int cutExtra = 0;\n            int partsCount = 6;\n            int referenceId = 1;\n            string from = \"Test Sender ID\";\n            string rule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\";\n            int createChat = 0;\n            int tts = 0;\n            int local = 0;\n            string localCountry = \"US\";\n\n            try {\n                // GetMessagePriceResponse class object\n                var result = apiInstance.GetMessagePrice(includeBlocked, text, templateId, sendingTime, sendingDateTime, sendingTimezone, contacts, lists, phones, cutExtra, partsCount, referenceId, from, rule, createChat, tts, local, localCountry);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getMessagePrice: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getMessagePrice method below, default values will be used\n        Dim includeBlocked As Integer = 0\n        Dim text As String = \"Test message test\"\n        Dim templateId As Integer = 1\n        Dim sendingTime As Integer = 1565606455\n        Dim sendingDateTime As String = \"2020-05-27 13:02:33\"\n        Dim sendingTimezone As String = \"America/Buenos_Aires\"\n        Dim contacts As String = \"1,2,3,4\"\n        Dim lists As String = \"1,2,3,4\"\n        Dim phones As String = \"447860021130,447860021131\"\n        Dim cutExtra As Integer = 0\n        Dim partsCount As Integer = 6\n        Dim referenceId As Integer = 1\n        Dim from As String = \"Test Sender ID\"\n        Dim rule As String = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\"\n        Dim createChat As Integer = 0\n        Dim tts As Integer = 0\n        Dim local As Integer = 0\n        Dim localCountry As String = \"US\"\n\n        Try\n            ' GetMessagePriceResponse class object\n            Dim result = apiInstance.GetMessagePrice(includeBlocked, text, templateId, sendingTime, sendingDateTime, sendingTimezone, contacts, lists, phones, cutExtra, partsCount, referenceId, from, rule, createChat, tts, local, localCountry)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getMessagePrice: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetMessagePriceOpts{\n        // Optional parameters\n        IncludeBlocked: optional.NewInt32(0),\n        Text: optional.NewString(\"Test message test\"),\n        TemplateId: optional.NewInt32(1),\n        SendingTime: optional.NewInt32(1565606455),\n        SendingDateTime: optional.NewString(\"2020-05-27 13:02:33\"),\n        SendingTimezone: optional.NewString(\"America/Buenos_Aires\"),\n        Contacts: optional.NewString(\"1,2,3,4\"),\n        Lists: optional.NewString(\"1,2,3,4\"),\n        Phones: optional.NewString(\"447860021130,447860021131\"),\n        CutExtra: optional.NewInt32(0),\n        PartsCount: optional.NewInt32(6),\n        ReferenceId: optional.NewInt32(1),\n        From: optional.NewString(\"Test Sender ID\"),\n        Rule: optional.NewString(\"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\"),\n        CreateChat: optional.NewInt32(0),\n        Tts: optional.NewInt32(0),\n        Local: optional.NewInt32(0),\n        LocalCountry: optional.NewString(\"US\"),\n    }\n\n    // tm.GetMessagePriceResponse struct\n    result, _, err := client.TextMagicApi.GetMessagePrice(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int includeBlocked = 0;\n    std::string text = \"Test message test\";\n    int templateId = 1;\n    int sendingTime = 1565606455;\n    std::string sendingDateTime = \"2020-05-27 13:02:33\";\n    std::string sendingTimezone = \"America/Buenos_Aires\";\n    std::string contacts = \"1,2,3,4\";\n    std::string lists = \"1,2,3,4\";\n    std::string phones = \"447860021130,447860021131\";\n    int cutExtra = 0;\n    int partsCount = 6;\n    int referenceId = 1;\n    std::string from = \"Test Sender ID\";\n    std::string rule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\";\n    int createChat = 0;\n    int tts = 0;\n    int local = 0;\n    std::string localCountry = \"US\";\n\n    try {\n        pplx::task<std::shared_ptr<GetMessagePriceResponse>> result = api.getMessagePrice(includeBlocked, text, templateId, sendingTime, sendingDateTime, sendingTimezone, contacts, lists, phones, cutExtra, partsCount, referenceId, from, rule, createChat, tts, local, localCountry);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getMessagePrice() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\ninclude_blocked = 0\ntext = \"Test message test\"\ntemplate_id = 1\nsending_time = 1565606455\nsending_date_time = \"2020-05-27 13:02:33\"\nsending_timezone = \"America/Buenos_Aires\"\ncontacts = \"1,2,3,4\"\nlists = \"1,2,3,4\"\nphones = \"447860021130,447860021131\"\ncut_extra = 0\nparts_count = 6\nreference_id = 1\n_from = \"Test Sender ID\"\nrule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\"\ncreate_chat = 0\ntts = 0\nlocal = 0\nlocal_country = \"US\"\n\ntry:\n    # GetMessagePriceResponse object\n    result = api_instance.get_message_price(include_blocked=include_blocked, text=text, template_id=template_id, sending_time=sending_time, sending_date_time=sending_date_time, sending_timezone=sending_timezone, contacts=contacts, lists=lists, phones=phones, cut_extra=cut_extra, parts_count=parts_count, reference_id=reference_id, _from=_from, rule=rule, create_chat=create_chat, tts=tts, local=local, local_country=local_country)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_message_price: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $includeBlocked = 0;\nmy $text = 'Test message test';\nmy $templateId = 1;\nmy $sendingTime = 1565606455;\nmy $sendingDateTime = '2020-05-27 13:02:33';\nmy $sendingTimezone = 'America/Buenos_Aires';\nmy $contacts = '1,2,3,4';\nmy $lists = '1,2,3,4';\nmy $phones = '447860021130,447860021131';\nmy $cutExtra = 0;\nmy $partsCount = 6;\nmy $referenceId = 1;\nmy $from = 'Test Sender ID';\nmy $rule = 'FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1';\nmy $createChat = 0;\nmy $tts = 0;\nmy $local = 0;\nmy $localCountry = 'US';\n\neval {\n    # GetMessagePriceResponse object\n    my $result = $api_instance->get_message_price(includeBlocked => $includeBlocked, text => $text, templateId => $templateId, sendingTime => $sendingTime, sendingDateTime => $sendingDateTime, sendingTimezone => $sendingTimezone, contacts => $contacts, lists => $lists, phones => $phones, cutExtra => $cutExtra, partsCount => $partsCount, referenceId => $referenceId, from => $from, rule => $rule, createChat => $createChat, tts => $tts, local => $local, localCountry => $localCountry);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_message_price: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/messages/preview": {
      "get": {
        "operationId": "getMessagePreview",
        "summary": "Preview message",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/getMessagePreview\" target=\"_blank\">Try in sandbox</a><br>Get a messages preview (with dynamic fields merged) of up to 100 messages per session.\n",
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "type": "string",
            "description": "Message text. Required if **template_id** is not set.",
            "x-example": "Test message test"
          },
          {
            "name": "templateId",
            "in": "query",
            "type": "integer",
            "description": "Template used instead of message text. Required if **text** is not set.",
            "x-example": 1
          },
          {
            "name": "sendingTime",
            "in": "query",
            "type": "integer",
            "description": "DEPRECATED, consider using sendingDateTime and sendingTimezone parameters instead: Optional (required with rrule set). Message sending time is in unix timestamp format. Default is now.",
            "x-example": 1565606455,
            "deprecated": true
          },
          {
            "name": "sendingDateTime",
            "in": "query",
            "type": "string",
            "description": "Sending time is in Y-m-d H:i:s format (e.g. 2016-05-27 13:02:33). This time is relative to the sendingTimezone.",
            "x-example": "2020-05-27 13:02:33"
          },
          {
            "name": "sendingTimezone",
            "in": "query",
            "type": "string",
            "description": "The ID or ISO-name of the timezone used for sending when the sendingDateTime parameter is set, e.g. if you specify sendingDateTime = \\\"2016-05-27 13:02:33\\\" and sendingTimezone = \\\"America/Buenos_Aires\\\", your message will be sent on May 27, 2016 13:02:33 Buenos Aires time, or 16:02:33 UTC. Default is the account timezone.",
            "x-example": "America/Buenos_Aires"
          },
          {
            "name": "contacts",
            "in": "query",
            "type": "string",
            "description": "Comma-separated array of contact resources id message will be sent to.",
            "x-example": "1,2,3,4"
          },
          {
            "name": "lists",
            "in": "query",
            "type": "string",
            "description": "Comma-separated array of list resources id message will be sent to.",
            "x-example": "1,2,3,4"
          },
          {
            "name": "phones",
            "in": "query",
            "type": "string",
            "description": "Comma-separated array of E.164 phone numbers message will be sent to.",
            "x-example": "447860021130,447860021131"
          },
          {
            "name": "cutExtra",
            "in": "query",
            "type": "integer",
            "description": "Should sending method cut extra characters which not fit supplied partsCount or return 400 Bad request response instead.",
            "enum": [
              0,
              1
            ],
            "default": 0
          },
          {
            "name": "partsCount",
            "in": "query",
            "type": "integer",
            "description": "Maximum message parts count (Textmagic allows sending of 1 to 6 message parts).",
            "default": 6
          },
          {
            "name": "referenceId",
            "in": "query",
            "type": "integer",
            "description": "Custom message reference id which can be used in your application infrastructure.",
            "x-example": 1
          },
          {
            "name": "from",
            "in": "query",
            "type": "string",
            "description": "One of the allowed Sender ID (phone number or alphanumeric sender ID). If the specified Sender ID is not allowed for some destinations, a fallback default Sender ID will be used to ensure delivery. See [Get timezones](https://docs.textmagic.com/#tag/Sender-IDs).",
            "x-example": "Test Sender ID"
          },
          {
            "name": "rule",
            "in": "query",
            "type": "string",
            "description": "An iCal RRULE parameter to create recurrent scheduled messages. When used, sendingTime is mandatory as the start point of sending. See https://www.textmagic.com/free-tools/rrule-generator for format details.",
            "x-example": "FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1"
          },
          {
            "name": "createChat",
            "in": "query",
            "type": "integer",
            "description": "Should the sending method try to create new Chat(if not exist) with specified recipients?",
            "enum": [
              0,
              1
            ],
            "default": 0
          },
          {
            "name": "tts",
            "in": "query",
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "Send Text-to-Speech message.",
            "default": 0
          },
          {
            "name": "local",
            "in": "query",
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "Treat phone numbers passed in the \\'phones\\' field as local.",
            "default": 0
          },
          {
            "name": "localCountry",
            "in": "query",
            "type": "string",
            "description": "The 2-letter ISO country code for local phone numbers, used when \\'local\\' is set to true. Default is the account country.",
            "x-example": "US"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetMessagePreviewResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getMessagePreview method below, default values will be used\n$text = \"Test message test\";\n$templateId = 1;\n$sendingTime = 1565606455;\n$sendingDateTime = \"2020-05-27 13:02:33\";\n$sendingTimezone = \"America/Buenos_Aires\";\n$contacts = \"1,2,3,4\";\n$lists = \"1,2,3,4\";\n$phones = \"447860021130,447860021131\";\n$cutExtra = 0;\n$partsCount = 6;\n$referenceId = 1;\n$from = \"Test Sender ID\";\n$rule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\";\n$createChat = 0;\n$tts = 0;\n$local = 0;\n$localCountry = \"US\";\n\ntry {\n    // GetMessagePreviewResponse class object\n    $result = $api->getMessagePreview($text, $templateId, $sendingTime, $sendingDateTime, $sendingTimezone, $contacts, $lists, $phones, $cutExtra, $partsCount, $referenceId, $from, $rule, $createChat, $tts, $local, $localCountry);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getMessagePreview: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getMessagePreview method below, default values will be used\n        String text = \"Test message test\";\n        int templateId = 1;\n        int sendingTime = 1565606455;\n        String sendingDateTime = \"2020-05-27 13:02:33\";\n        String sendingTimezone = \"America/Buenos_Aires\";\n        String contacts = \"1,2,3,4\";\n        String lists = \"1,2,3,4\";\n        String phones = \"447860021130,447860021131\";\n        int cutExtra = 0;\n        int partsCount = 6;\n        int referenceId = 1;\n        String from = \"Test Sender ID\";\n        String rule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\";\n        int createChat = 0;\n        int tts = 0;\n        int local = 0;\n        String localCountry = \"US\";\n\n        try {\n            // GetMessagePreviewResponse class object\n            GetMessagePreviewResponse obj = apiInstance.getMessagePreview(text, templateId, sendingTime, sendingDateTime, sendingTimezone, contacts, lists, phones, cutExtra, partsCount, referenceId, from, rule, createChat, tts, local, localCountry);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getMessagePreview\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    text: \"Test message test\",\n    templateId: 1,\n    sendingTime: 1565606455,\n    sendingDateTime: \"2020-05-27 13:02:33\",\n    sendingTimezone: \"America/Buenos_Aires\",\n    contacts: \"1,2,3,4\",\n    lists: \"1,2,3,4\",\n    phones: \"447860021130,447860021131\",\n    cutExtra: 0,\n    partsCount: 6,\n    referenceId: 1,\n    from: \"Test Sender ID\",\n    rule: \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\",\n    createChat: 0,\n    tts: 0,\n    local: 0,\n    localCountry: \"US\",\n};\n\napi.getMessagePreview(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  text: 'Test message test',\n  template_id: 1,\n  sending_time: 1565606455,\n  sending_date_time: '2020-05-27 13:02:33',\n  sending_timezone: 'America/Buenos_Aires',\n  contacts: '1,2,3,4',\n  lists: '1,2,3,4',\n  phones: '447860021130,447860021131',\n  cut_extra: 0,\n  parts_count: 6,\n  reference_id: 1,\n  from: 'Test Sender ID',\n  rule: 'FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1',\n  create_chat: 0,\n  tts: 0,\n  local: 0,\n  local_country: 'US',\n}\n\nbegin\n    # GetMessagePreviewResponse object\n    result = api.get_message_preview(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_message_preview: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getMessagePreview method below, default values will be used\n            string text = \"Test message test\";\n            int templateId = 1;\n            int sendingTime = 1565606455;\n            string sendingDateTime = \"2020-05-27 13:02:33\";\n            string sendingTimezone = \"America/Buenos_Aires\";\n            string contacts = \"1,2,3,4\";\n            string lists = \"1,2,3,4\";\n            string phones = \"447860021130,447860021131\";\n            int cutExtra = 0;\n            int partsCount = 6;\n            int referenceId = 1;\n            string from = \"Test Sender ID\";\n            string rule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\";\n            int createChat = 0;\n            int tts = 0;\n            int local = 0;\n            string localCountry = \"US\";\n\n            try {\n                // GetMessagePreviewResponse class object\n                var result = apiInstance.GetMessagePreview(text, templateId, sendingTime, sendingDateTime, sendingTimezone, contacts, lists, phones, cutExtra, partsCount, referenceId, from, rule, createChat, tts, local, localCountry);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getMessagePreview: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getMessagePreview method below, default values will be used\n        Dim text As String = \"Test message test\"\n        Dim templateId As Integer = 1\n        Dim sendingTime As Integer = 1565606455\n        Dim sendingDateTime As String = \"2020-05-27 13:02:33\"\n        Dim sendingTimezone As String = \"America/Buenos_Aires\"\n        Dim contacts As String = \"1,2,3,4\"\n        Dim lists As String = \"1,2,3,4\"\n        Dim phones As String = \"447860021130,447860021131\"\n        Dim cutExtra As Integer = 0\n        Dim partsCount As Integer = 6\n        Dim referenceId As Integer = 1\n        Dim from As String = \"Test Sender ID\"\n        Dim rule As String = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\"\n        Dim createChat As Integer = 0\n        Dim tts As Integer = 0\n        Dim local As Integer = 0\n        Dim localCountry As String = \"US\"\n\n        Try\n            ' GetMessagePreviewResponse class object\n            Dim result = apiInstance.GetMessagePreview(text, templateId, sendingTime, sendingDateTime, sendingTimezone, contacts, lists, phones, cutExtra, partsCount, referenceId, from, rule, createChat, tts, local, localCountry)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getMessagePreview: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetMessagePreviewOpts{\n        // Optional parameters\n        Text: optional.NewString(\"Test message test\"),\n        TemplateId: optional.NewInt32(1),\n        SendingTime: optional.NewInt32(1565606455),\n        SendingDateTime: optional.NewString(\"2020-05-27 13:02:33\"),\n        SendingTimezone: optional.NewString(\"America/Buenos_Aires\"),\n        Contacts: optional.NewString(\"1,2,3,4\"),\n        Lists: optional.NewString(\"1,2,3,4\"),\n        Phones: optional.NewString(\"447860021130,447860021131\"),\n        CutExtra: optional.NewInt32(0),\n        PartsCount: optional.NewInt32(6),\n        ReferenceId: optional.NewInt32(1),\n        From: optional.NewString(\"Test Sender ID\"),\n        Rule: optional.NewString(\"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\"),\n        CreateChat: optional.NewInt32(0),\n        Tts: optional.NewInt32(0),\n        Local: optional.NewInt32(0),\n        LocalCountry: optional.NewString(\"US\"),\n    }\n\n    // tm.GetMessagePreviewResponse struct\n    result, _, err := client.TextMagicApi.GetMessagePreview(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    std::string text = \"Test message test\";\n    int templateId = 1;\n    int sendingTime = 1565606455;\n    std::string sendingDateTime = \"2020-05-27 13:02:33\";\n    std::string sendingTimezone = \"America/Buenos_Aires\";\n    std::string contacts = \"1,2,3,4\";\n    std::string lists = \"1,2,3,4\";\n    std::string phones = \"447860021130,447860021131\";\n    int cutExtra = 0;\n    int partsCount = 6;\n    int referenceId = 1;\n    std::string from = \"Test Sender ID\";\n    std::string rule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\";\n    int createChat = 0;\n    int tts = 0;\n    int local = 0;\n    std::string localCountry = \"US\";\n\n    try {\n        pplx::task<std::shared_ptr<GetMessagePreviewResponse>> result = api.getMessagePreview(text, templateId, sendingTime, sendingDateTime, sendingTimezone, contacts, lists, phones, cutExtra, partsCount, referenceId, from, rule, createChat, tts, local, localCountry);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getMessagePreview() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\ntext = \"Test message test\"\ntemplate_id = 1\nsending_time = 1565606455\nsending_date_time = \"2020-05-27 13:02:33\"\nsending_timezone = \"America/Buenos_Aires\"\ncontacts = \"1,2,3,4\"\nlists = \"1,2,3,4\"\nphones = \"447860021130,447860021131\"\ncut_extra = 0\nparts_count = 6\nreference_id = 1\n_from = \"Test Sender ID\"\nrule = \"FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1\"\ncreate_chat = 0\ntts = 0\nlocal = 0\nlocal_country = \"US\"\n\ntry:\n    # GetMessagePreviewResponse object\n    result = api_instance.get_message_preview(text=text, template_id=template_id, sending_time=sending_time, sending_date_time=sending_date_time, sending_timezone=sending_timezone, contacts=contacts, lists=lists, phones=phones, cut_extra=cut_extra, parts_count=parts_count, reference_id=reference_id, _from=_from, rule=rule, create_chat=create_chat, tts=tts, local=local, local_country=local_country)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_message_preview: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $text = 'Test message test';\nmy $templateId = 1;\nmy $sendingTime = 1565606455;\nmy $sendingDateTime = '2020-05-27 13:02:33';\nmy $sendingTimezone = 'America/Buenos_Aires';\nmy $contacts = '1,2,3,4';\nmy $lists = '1,2,3,4';\nmy $phones = '447860021130,447860021131';\nmy $cutExtra = 0;\nmy $partsCount = 6;\nmy $referenceId = 1;\nmy $from = 'Test Sender ID';\nmy $rule = 'FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1';\nmy $createChat = 0;\nmy $tts = 0;\nmy $local = 0;\nmy $localCountry = 'US';\n\neval {\n    # GetMessagePreviewResponse object\n    my $result = $api_instance->get_message_preview(text => $text, templateId => $templateId, sendingTime => $sendingTime, sendingDateTime => $sendingDateTime, sendingTimezone => $sendingTimezone, contacts => $contacts, lists => $lists, phones => $phones, cutExtra => $cutExtra, partsCount => $partsCount, referenceId => $referenceId, from => $from, rule => $rule, createChat => $createChat, tts => $tts, local => $local, localCountry => $localCountry);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_message_preview: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/messages/{id}": {
      "get": {
        "operationId": "getOutboundMessage",
        "summary": "Get a single message",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/getOutboundMessage\" target=\"_blank\">Try in sandbox</a><br>Get a single outgoing message.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/MessageOut"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // MessageOut class object\n    $result = $api->getOutboundMessage($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getOutboundMessage: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // MessageOut class object\n            MessageOut obj = apiInstance.getOutboundMessage(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getOutboundMessage\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getOutboundMessage(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # MessageOut object\n    result = api.get_outbound_message(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_outbound_message: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // MessageOut class object\n                var result = apiInstance.GetOutboundMessage(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getOutboundMessage: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' MessageOut class object\n            Dim result = apiInstance.GetOutboundMessage(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getOutboundMessage: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.MessageOut struct\n    result, _, err := client.TextMagicApi.GetOutboundMessage(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<MessageOut>> result = api.getOutboundMessage(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getOutboundMessage() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # MessageOut object\n    result = api_instance.get_outbound_message(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_outbound_message: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # MessageOut object\n    my $result = $api_instance->get_outbound_message(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_outbound_message: $@\\n\";\n}"
          }
        ]
      },
      "delete": {
        "operationId": "deleteOutboundMessage",
        "produces": [],
        "summary": "Delete message",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/deleteOutboundMessage\" target=\"_blank\">Try in sandbox</a><br>Delete a single message.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteOutboundMessage($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteOutboundMessage: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteOutboundMessage(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteOutboundMessage\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteOutboundMessage(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_outbound_message(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_outbound_message: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteOutboundMessage(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteOutboundMessage: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteOutboundMessage(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteOutboundMessage: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteOutboundMessage(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteOutboundMessage(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteOutboundMessage() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_outbound_message(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_outbound_message: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_outbound_message(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_outbound_message: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/messages/delete": {
      "post": {
        "operationId": "deleteOutboundMessagesBulk",
        "produces": [],
        "summary": "Delete messages (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/deleteOutboundMessagesBulk\" target=\"_blank\">Try in sandbox</a><br>Delete outbound messages by the given ID(s) or delete all outbound messages.",
        "parameters": [
          {
            "name": "DeleteOutboundMessagesBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "integer",
                  "example": 1,
                  "enum": [
                    0,
                    1
                  ],
                  "description": "Default is 0 (false). If set to 1, all the entities will be removed."
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteOutboundMessagesBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(1);\n\ntry {\n    $api->deleteOutboundMessagesBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteOutboundMessagesBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteOutboundMessagesBulkInputObject input = new DeleteOutboundMessagesBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(1);\n\n        try {\n            apiInstance.deleteOutboundMessagesBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteOutboundMessagesBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: 1,\n}\n\n\napi.deleteOutboundMessagesBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteOutboundMessagesBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = 1\n\nbegin\n    api.delete_outbound_messages_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_outbound_messages_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteOutboundMessagesBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = 1;\n\n            try {\n                apiInstance.DeleteOutboundMessagesBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteOutboundMessagesBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteOutboundMessagesBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = 1\n        }\n\n        Try\n            apiInstance.DeleteOutboundMessagesBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteOutboundMessagesBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: 1,\n    }\n\n    client.TextMagicApi.DeleteOutboundMessagesBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteOutboundMessagesBulkInputObject> input(new DeleteOutboundMessagesBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(1);\n\n    try {\n        pplx::task result = api.deleteOutboundMessagesBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteOutboundMessagesBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteOutboundMessagesBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = 1\n\ntry:\n    api_instance.delete_outbound_messages_bulk(delete_outbound_messages_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_outbound_messages_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteOutboundMessagesBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteOutboundMessagesBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => 1,\n);\n\neval {\n    $api_instance->delete_outbound_messages_bulk(delete_outbound_messages_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_outbound_messages_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/message/all": {
      "delete": {
        "operationId": "deleteAllOutboundMessages",
        "produces": [],
        "summary": "Delete all messages",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/deleteAllOutboundMessages\" target=\"_blank\">Try in sandbox</a><br>Delete all messages.",
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    $api->deleteAllOutboundMessages();\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteAllOutboundMessages: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            apiInstance.deleteAllOutboundMessages();\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteAllOutboundMessages\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.deleteAllOutboundMessages().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    api.delete_all_outbound_messages()\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_all_outbound_messages: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                apiInstance.DeleteAllOutboundMessages();\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteAllOutboundMessages: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            apiInstance.DeleteAllOutboundMessages()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteAllOutboundMessages: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    client.TextMagicApi.DeleteAllOutboundMessages(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task result = api.deleteAllOutboundMessages();\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteAllOutboundMessages() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    api_instance.delete_all_outbound_messages()\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_all_outbound_messages: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    $api_instance->delete_all_outbound_messages();\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_all_outbound_messages: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/messages/search": {
      "get": {
        "operationId": "searchOutboundMessages",
        "summary": "Find messages",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/searchOutboundMessages\" target=\"_blank\">Try in sandbox</a><br>Find outbound messages by given parameters.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "lastId",
            "in": "query",
            "description": "Filter results by ID, selecting all values lesser than the specified ID. Note that the \\'page\\' parameter is ignored when \\'lastId\\' is specified.",
            "type": "integer"
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Find message by ID(s).",
            "type": "string",
            "pattern": "^(\\d+)(,\\d+)*$"
          },
          {
            "name": "sessionId",
            "in": "query",
            "description": "Find messages by session ID.",
            "type": "integer"
          },
          {
            "name": "statuses",
            "in": "query",
            "description": "Find messages by status.",
            "type": "string",
            "enum": [
              "q",
              "s",
              "e",
              "r",
              "a",
              "d",
              "b",
              "f",
              "u",
              "j",
              "i",
              "p",
              "h"
            ],
            "x-example": "q"
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "description": "Search also in deleted messages.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "query",
            "in": "query",
            "description": "Find messages by specified search query.",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/SearchOutboundMessagesPaginatedResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to searchOutboundMessages method below, default values will be used\n$page = 1;\n$limit = 10;\n$lastId = 1;\n$ids = \"sampleValue\";\n$sessionId = 1;\n$statuses = \"q\";\n$includeDeleted = 0;\n$query = \"sampleValue\";\n\ntry {\n    // SearchOutboundMessagesPaginatedResponse class object\n    $result = $api->searchOutboundMessages($page, $limit, $lastId, $ids, $sessionId, $statuses, $includeDeleted, $query);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->searchOutboundMessages: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to searchOutboundMessages method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        int lastId = 1;\n        String ids = \"sampleValue\";\n        int sessionId = 1;\n        String statuses = \"q\";\n        int includeDeleted = 0;\n        String query = \"sampleValue\";\n\n        try {\n            // SearchOutboundMessagesPaginatedResponse class object\n            SearchOutboundMessagesPaginatedResponse obj = apiInstance.searchOutboundMessages(page, limit, lastId, ids, sessionId, statuses, includeDeleted, query);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling searchOutboundMessages\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    lastId: 1,\n    ids: \"sampleValue\",\n    sessionId: 1,\n    statuses: \"q\",\n    includeDeleted: 0,\n    query: \"sampleValue\",\n};\n\napi.searchOutboundMessages(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  last_id: 1,\n  ids: 'sampleValue',\n  session_id: 1,\n  statuses: 'q',\n  include_deleted: 0,\n  query: 'sampleValue',\n}\n\nbegin\n    # SearchOutboundMessagesPaginatedResponse object\n    result = api.search_outbound_messages(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->search_outbound_messages: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to searchOutboundMessages method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            int lastId = 1;\n            string ids = \"sampleValue\";\n            int sessionId = 1;\n            string statuses = \"q\";\n            int includeDeleted = 0;\n            string query = \"sampleValue\";\n\n            try {\n                // SearchOutboundMessagesPaginatedResponse class object\n                var result = apiInstance.SearchOutboundMessages(page, limit, lastId, ids, sessionId, statuses, includeDeleted, query);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling searchOutboundMessages: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to searchOutboundMessages method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim lastId As Integer = 1\n        Dim ids As String = \"sampleValue\"\n        Dim sessionId As Integer = 1\n        Dim statuses As String = \"q\"\n        Dim includeDeleted As Integer = 0\n        Dim query As String = \"sampleValue\"\n\n        Try\n            ' SearchOutboundMessagesPaginatedResponse class object\n            Dim result = apiInstance.SearchOutboundMessages(page, limit, lastId, ids, sessionId, statuses, includeDeleted, query)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling searchOutboundMessages: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.SearchOutboundMessagesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        LastId: optional.NewInt32(1),\n        Ids: optional.NewString(\"sampleValue\"),\n        SessionId: optional.NewInt32(1),\n        Statuses: optional.NewString(\"q\"),\n        IncludeDeleted: optional.NewInt32(0),\n        Query: optional.NewString(\"sampleValue\"),\n    }\n\n    // tm.SearchOutboundMessagesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.SearchOutboundMessages(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    int lastId = 1;\n    std::string ids = \"sampleValue\";\n    int sessionId = 1;\n    std::string statuses = \"q\";\n    int includeDeleted = 0;\n    std::string query = \"sampleValue\";\n\n    try {\n        pplx::task<std::shared_ptr<SearchOutboundMessagesPaginatedResponse>> result = api.searchOutboundMessages(page, limit, lastId, ids, sessionId, statuses, includeDeleted, query);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"searchOutboundMessages() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nlast_id = 1\nids = \"sampleValue\"\nsession_id = 1\nstatuses = \"q\"\ninclude_deleted = 0\nquery = \"sampleValue\"\n\ntry:\n    # SearchOutboundMessagesPaginatedResponse object\n    result = api_instance.search_outbound_messages(page=page, limit=limit, last_id=last_id, ids=ids, session_id=session_id, statuses=statuses, include_deleted=include_deleted, query=query)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->search_outbound_messages: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $lastId = 1;\nmy $ids = 'sampleValue';\nmy $sessionId = 1;\nmy $statuses = 'q';\nmy $includeDeleted = 0;\nmy $query = 'sampleValue';\n\neval {\n    # SearchOutboundMessagesPaginatedResponse object\n    my $result = $api_instance->search_outbound_messages(page => $page, limit => $limit, lastId => $lastId, ids => $ids, sessionId => $sessionId, statuses => $statuses, includeDeleted => $includeDeleted, query => $query);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->search_outbound_messages: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/messages/attachment": {
      "post": {
        "operationId": "uploadMessageAttachment",
        "summary": "Upload message attachment",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/uploadMessageAttachment\" target=\"_blank\">Try in sandbox</a><br>Upload a new file to insert it as a link.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "file",
            "in": "formData",
            "required": true,
            "description": "Attachment. Supports .jpg, .gif, .png, .pdf, .txt, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx & .vcf file formats.",
            "type": "file"
          }
        ],
        "responses": {
          "200": {
            "description": "File uploaded with success.",
            "schema": {
              "$ref": "#/definitions/UploadMessageAttachmentResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$file = new \\SplFileObject(\"test.jpg\");\n\ntry {\n    // UploadMessageAttachmentResponse class object\n    $result = $api->uploadMessageAttachment($file);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->uploadMessageAttachment: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\nimport java.io.File;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // change to your file path\n        File file = new File(\"test.jpg\");\n\n        try {\n            // UploadMessageAttachmentResponse class object\n            UploadMessageAttachmentResponse obj = apiInstance.uploadMessageAttachment(file);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling uploadMessageAttachment\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst fs = require('fs');\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n// change to your file path.\nconst file = new fs.ReadStream('filePath');\n\n\napi.uploadMessageAttachment(file).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nfile = File.open('test.png', 'r')\n\nbegin\n    # UploadMessageAttachmentResponse object\n    result = api.upload_message_attachment(file)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->upload_message_attachment: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // change to your file path\n            var file = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open);\n\n            try {\n                // UploadMessageAttachmentResponse class object\n                var result = apiInstance.UploadMessageAttachment(file);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling uploadMessageAttachment: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' change to your file path\n        Dim file = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open)\n\n        Try\n            ' UploadMessageAttachmentResponse class object\n            Dim result = apiInstance.UploadMessageAttachment(file)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling uploadMessageAttachment: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\nSorry, file upload calls for Go SDK do not supported yet.\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::filebuf fb;\n    fb.open (\"test.jpg\", std::ios::in);\n    std::shared_ptr<std::istream> is(new std::istream(&fb));\n\n    std::shared_ptr<HttpContent> file(new HttpContent);\n    file->setName(\"test\");\n    file->setContentDisposition(\"attachment\");\n    file->setFileName(\"test.jpg\");\n\n    file->setContentType(\"image/jpeg\");\n    file->setData(is);\n\n    try {\n        pplx::task<std::shared_ptr<UploadMessageAttachmentResponse>> result = api.uploadMessageAttachment(file);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"uploadMessageAttachment() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# change to your file path\nfile = \"test.jpg\"\n\ntry:\n    # UploadMessageAttachmentResponse object\n    result = api_instance.upload_message_attachment(file=file)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->upload_message_attachment: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# change to your file path\nmy $file = 'test.jpg';\n\neval {\n    # UploadMessageAttachmentResponse object\n    my $result = $api_instance->upload_message_attachment(file => $file);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->upload_message_attachment: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/messages/mms/attachment": {
      "post": {
        "operationId": "uploadMessageMMSAttachment",
        "summary": "Upload message mms attachment",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/uploadMessageMMSAttachment\" target=\"_blank\">Try in sandbox</a><br>Upload a new file to mms.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "file",
            "in": "formData",
            "required": true,
            "description": "Attachment. Supports .jpg, .gif, .png, .pdf, .txt, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx & .vcf file formats.",
            "type": "file"
          }
        ],
        "responses": {
          "200": {
            "description": "File uploaded with success.",
            "schema": {
              "$ref": "#/definitions/UploadMessageAttachmentResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$file = new \\SplFileObject(\"test.jpg\");\n\ntry {\n    // UploadMessageAttachmentResponse class object\n    $result = $api->uploadMessageMMSAttachment($file);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->uploadMessageMMSAttachment: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\nimport java.io.File;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // change to your file path\n        File file = new File(\"test.jpg\");\n\n        try {\n            // UploadMessageAttachmentResponse class object\n            UploadMessageAttachmentResponse obj = apiInstance.uploadMessageMMSAttachment(file);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling uploadMessageMMSAttachment\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst fs = require('fs');\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n// change to your file path.\nconst file = new fs.ReadStream('filePath');\n\n\napi.uploadMessageMMSAttachment(file).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nfile = File.open('test.png', 'r')\n\nbegin\n    # UploadMessageAttachmentResponse object\n    result = api.upload_message_m_m_s_attachment(file)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->upload_message_m_m_s_attachment: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // change to your file path\n            var file = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open);\n\n            try {\n                // UploadMessageAttachmentResponse class object\n                var result = apiInstance.UploadMessageMMSAttachment(file);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling uploadMessageMMSAttachment: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' change to your file path\n        Dim file = File.Open(\"/CustomPath/Images/test.png\", FileMode.Open)\n\n        Try\n            ' UploadMessageAttachmentResponse class object\n            Dim result = apiInstance.UploadMessageMMSAttachment(file)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling uploadMessageMMSAttachment: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\nSorry, file upload calls for Go SDK do not supported yet.\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::filebuf fb;\n    fb.open (\"test.jpg\", std::ios::in);\n    std::shared_ptr<std::istream> is(new std::istream(&fb));\n\n    std::shared_ptr<HttpContent> file(new HttpContent);\n    file->setName(\"test\");\n    file->setContentDisposition(\"attachment\");\n    file->setFileName(\"test.jpg\");\n\n    file->setContentType(\"image/jpeg\");\n    file->setData(is);\n\n    try {\n        pplx::task<std::shared_ptr<UploadMessageAttachmentResponse>> result = api.uploadMessageMMSAttachment(file);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"uploadMessageMMSAttachment() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# change to your file path\nfile = \"test.jpg\"\n\ntry:\n    # UploadMessageAttachmentResponse object\n    result = api_instance.upload_message_m_m_s_attachment(file=file)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->upload_message_m_m_s_attachment: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# change to your file path\nmy $file = 'test.jpg';\n\neval {\n    # UploadMessageAttachmentResponse object\n    my $result = $api_instance->upload_message_m_m_s_attachment(file => $file);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->upload_message_m_m_s_attachment: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/messages/prices/normalized": {},
    "/api/v2/history": {
      "get": {
        "operationId": "getOutboundMessagesHistory",
        "summary": "Get history",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/getOutboundMessagesHistory\" target=\"_blank\">Try in sandbox</a><br>Get the outbound messages history.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "lastId",
            "in": "query",
            "description": "Filter results by ID, selecting all values lesser than the specified ID.",
            "type": "integer"
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Find message by specified search query.",
            "type": "string"
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "phone",
              "sender",
              "firstName",
              "lastName",
              "messageTime"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetOutboundMessagesHistoryPaginatedResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getOutboundMessagesHistory method below, default values will be used\n$limit = 10;\n$lastId = 1;\n$query = \"sampleValue\";\n$orderBy = \"id\";\n$direction = \"desc\";\n\ntry {\n    // GetOutboundMessagesHistoryPaginatedResponse class object\n    $result = $api->getOutboundMessagesHistory($limit, $lastId, $query, $orderBy, $direction);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getOutboundMessagesHistory: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getOutboundMessagesHistory method below, default values will be used\n        int limit = 10;\n        int lastId = 1;\n        String query = \"sampleValue\";\n        String orderBy = \"id\";\n        String direction = \"desc\";\n\n        try {\n            // GetOutboundMessagesHistoryPaginatedResponse class object\n            GetOutboundMessagesHistoryPaginatedResponse obj = apiInstance.getOutboundMessagesHistory(limit, lastId, query, orderBy, direction);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getOutboundMessagesHistory\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    limit: 10,\n    lastId: 1,\n    query: \"sampleValue\",\n    orderBy: \"id\",\n    direction: \"desc\",\n};\n\napi.getOutboundMessagesHistory(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  limit: 10,\n  last_id: 1,\n  query: 'sampleValue',\n  order_by: 'id',\n  direction: 'desc',\n}\n\nbegin\n    # GetOutboundMessagesHistoryPaginatedResponse object\n    result = api.get_outbound_messages_history(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_outbound_messages_history: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getOutboundMessagesHistory method below, default values will be used\n            int limit = 10;\n            int lastId = 1;\n            string query = \"sampleValue\";\n            string orderBy = \"id\";\n            string direction = \"desc\";\n\n            try {\n                // GetOutboundMessagesHistoryPaginatedResponse class object\n                var result = apiInstance.GetOutboundMessagesHistory(limit, lastId, query, orderBy, direction);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getOutboundMessagesHistory: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getOutboundMessagesHistory method below, default values will be used\n        Dim limit As Integer = 10\n        Dim lastId As Integer = 1\n        Dim query As String = \"sampleValue\"\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n\n        Try\n            ' GetOutboundMessagesHistoryPaginatedResponse class object\n            Dim result = apiInstance.GetOutboundMessagesHistory(limit, lastId, query, orderBy, direction)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getOutboundMessagesHistory: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetOutboundMessagesHistoryOpts{\n        // Optional parameters\n        Limit: optional.NewInt32(10),\n        LastId: optional.NewInt32(1),\n        Query: optional.NewString(\"sampleValue\"),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n    }\n\n    // tm.GetOutboundMessagesHistoryPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetOutboundMessagesHistory(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int limit = 10;\n    int lastId = 1;\n    std::string query = \"sampleValue\";\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n\n    try {\n        pplx::task<std::shared_ptr<GetOutboundMessagesHistoryPaginatedResponse>> result = api.getOutboundMessagesHistory(limit, lastId, query, orderBy, direction);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getOutboundMessagesHistory() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\nlimit = 10\nlast_id = 1\nquery = \"sampleValue\"\norder_by = \"id\"\ndirection = \"desc\"\n\ntry:\n    # GetOutboundMessagesHistoryPaginatedResponse object\n    result = api_instance.get_outbound_messages_history(limit=limit, last_id=last_id, query=query, order_by=order_by, direction=direction)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_outbound_messages_history: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $limit = 10;\nmy $lastId = 1;\nmy $query = 'sampleValue';\nmy $orderBy = 'id';\nmy $direction = 'desc';\n\neval {\n    # GetOutboundMessagesHistoryPaginatedResponse object\n    my $result = $api_instance->get_outbound_messages_history(limit => $limit, lastId => $lastId, query => $query, orderBy => $orderBy, direction => $direction);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_outbound_messages_history: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/bulks": {
      "get": {
        "operationId": "getAllBulkSessions",
        "summary": "Get all bulk sessions",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetAllBulkSessionsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getAllBulkSessions method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // GetAllBulkSessionsPaginatedResponse class object\n    $result = $api->getAllBulkSessions($page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getAllBulkSessions: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getAllBulkSessions method below, default values will be used\n        int page = 1;\n        int limit = 10;\n\n        try {\n            // GetAllBulkSessionsPaginatedResponse class object\n            GetAllBulkSessionsPaginatedResponse obj = apiInstance.getAllBulkSessions(page, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getAllBulkSessions\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getAllBulkSessions(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # GetAllBulkSessionsPaginatedResponse object\n    result = api.get_all_bulk_sessions(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_all_bulk_sessions: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getAllBulkSessions method below, default values will be used\n            int page = 1;\n            int limit = 10;\n\n            try {\n                // GetAllBulkSessionsPaginatedResponse class object\n                var result = apiInstance.GetAllBulkSessions(page, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getAllBulkSessions: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getAllBulkSessions method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' GetAllBulkSessionsPaginatedResponse class object\n            Dim result = apiInstance.GetAllBulkSessions(page, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getAllBulkSessions: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetAllBulkSessionsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.GetAllBulkSessionsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetAllBulkSessions(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<GetAllBulkSessionsPaginatedResponse>> result = api.getAllBulkSessions(page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getAllBulkSessions() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # GetAllBulkSessionsPaginatedResponse object\n    result = api_instance.get_all_bulk_sessions(page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_all_bulk_sessions: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # GetAllBulkSessionsPaginatedResponse object\n    my $result = $api_instance->get_all_bulk_sessions(page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_all_bulk_sessions: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/getAllBulkSessions\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/bulks/{id}": {
      "get": {
        "operationId": "getBulkSession",
        "summary": "Get bulk session status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/BulkSession"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Outbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // BulkSession class object\n    $result = $api->getBulkSession($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getBulkSession: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // BulkSession class object\n            BulkSession obj = apiInstance.getBulkSession(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getBulkSession\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getBulkSession(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # BulkSession object\n    result = api.get_bulk_session(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_bulk_session: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // BulkSession class object\n                var result = apiInstance.GetBulkSession(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getBulkSession: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' BulkSession class object\n            Dim result = apiInstance.GetBulkSession(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getBulkSession: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.BulkSession struct\n    result, _, err := client.TextMagicApi.GetBulkSession(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<BulkSession>> result = api.getBulkSession(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getBulkSession() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # BulkSession object\n    result = api_instance.get_bulk_session(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_bulk_session: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # BulkSession object\n    my $result = $api_instance->get_bulk_session(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_bulk_session: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Send%0A/getBulkSession\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/sessions": {
      "get": {
        "operationId": "getAllMessageSessions",
        "summary": "Get all sessions",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sessions/getAllMessageSessions\" target=\"_blank\">Try in sandbox</a><br>Get all message sending sessions.\n> This list contains all of your sessions, including those which were sent but not via API\n",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetAllMessageSessionsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Message Sessions"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getAllMessageSessions method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // GetAllMessageSessionsPaginatedResponse class object\n    $result = $api->getAllMessageSessions($page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getAllMessageSessions: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getAllMessageSessions method below, default values will be used\n        int page = 1;\n        int limit = 10;\n\n        try {\n            // GetAllMessageSessionsPaginatedResponse class object\n            GetAllMessageSessionsPaginatedResponse obj = apiInstance.getAllMessageSessions(page, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getAllMessageSessions\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getAllMessageSessions(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # GetAllMessageSessionsPaginatedResponse object\n    result = api.get_all_message_sessions(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_all_message_sessions: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getAllMessageSessions method below, default values will be used\n            int page = 1;\n            int limit = 10;\n\n            try {\n                // GetAllMessageSessionsPaginatedResponse class object\n                var result = apiInstance.GetAllMessageSessions(page, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getAllMessageSessions: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getAllMessageSessions method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' GetAllMessageSessionsPaginatedResponse class object\n            Dim result = apiInstance.GetAllMessageSessions(page, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getAllMessageSessions: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetAllMessageSessionsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.GetAllMessageSessionsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetAllMessageSessions(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<GetAllMessageSessionsPaginatedResponse>> result = api.getAllMessageSessions(page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getAllMessageSessions() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # GetAllMessageSessionsPaginatedResponse object\n    result = api_instance.get_all_message_sessions(page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_all_message_sessions: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # GetAllMessageSessionsPaginatedResponse object\n    my $result = $api_instance->get_all_message_sessions(page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_all_message_sessions: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/sessions/{id}/messages": {
      "get": {
        "operationId": "getMessagesBySessionId",
        "summary": "Get a session`s messages",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sessions/getMessagesBySessionId\" target=\"_blank\">Try in sandbox</a><br>A useful synonym for the \"messages/search\" command with the provided \"sessionId\" parameter.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "statuses",
            "in": "query",
            "description": "Find messages by status.",
            "type": "string",
            "enum": [
              "q",
              "s",
              "e",
              "r",
              "a",
              "d",
              "b",
              "f",
              "u",
              "j",
              "i",
              "p",
              "h"
            ]
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "description": "Search also in deleted messages.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetMessagesBySessionIdPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Message Sessions"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n// Optional, you can pass them as null values to getMessagesBySessionId method below, default values will be used\n$page = 1;\n$limit = 10;\n$statuses = \"sampleValue\";\n$includeDeleted = 0;\n\ntry {\n    // GetMessagesBySessionIdPaginatedResponse class object\n    $result = $api->getMessagesBySessionId($id, $page, $limit, $statuses, $includeDeleted);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getMessagesBySessionId: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n        // Optional, you can pass them as null values to getMessagesBySessionId method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String statuses = \"sampleValue\";\n        int includeDeleted = 0;\n\n        try {\n            // GetMessagesBySessionIdPaginatedResponse class object\n            GetMessagesBySessionIdPaginatedResponse obj = apiInstance.getMessagesBySessionId(id, page, limit, statuses, includeDeleted);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getMessagesBySessionId\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    statuses: \"sampleValue\",\n    includeDeleted: 0,\n};\n\napi.getMessagesBySessionId(id, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  statuses: 'sampleValue',\n  include_deleted: 0,\n}\n\nbegin\n    # GetMessagesBySessionIdPaginatedResponse object\n    result = api.get_messages_by_session_id(id, params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_messages_by_session_id: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n            // Optional, you can pass them as null values to getMessagesBySessionId method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string statuses = \"sampleValue\";\n            int includeDeleted = 0;\n\n            try {\n                // GetMessagesBySessionIdPaginatedResponse class object\n                var result = apiInstance.GetMessagesBySessionId(id, page, limit, statuses, includeDeleted);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getMessagesBySessionId: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n        ' Optional, you can pass them as null values to getMessagesBySessionId method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim statuses As String = \"sampleValue\"\n        Dim includeDeleted As Integer = 0\n\n        Try\n            ' GetMessagesBySessionIdPaginatedResponse class object\n            Dim result = apiInstance.GetMessagesBySessionId(id, page, limit, statuses, includeDeleted)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getMessagesBySessionId: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    opts := tm.GetMessagesBySessionIdOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Statuses: optional.NewString(\"sampleValue\"),\n        IncludeDeleted: optional.NewInt32(0),\n    }\n\n    // tm.GetMessagesBySessionIdPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetMessagesBySessionId(auth, id, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string statuses = \"sampleValue\";\n    int includeDeleted = 0;\n\n    try {\n        pplx::task<std::shared_ptr<GetMessagesBySessionIdPaginatedResponse>> result = api.getMessagesBySessionId(id, page, limit, statuses, includeDeleted);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getMessagesBySessionId() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n# Optional params, you can skip them\npage = 1\nlimit = 10\nstatuses = \"sampleValue\"\ninclude_deleted = 0\n\ntry:\n    # GetMessagesBySessionIdPaginatedResponse object\n    result = api_instance.get_messages_by_session_id(id=id, page=page, limit=limit, statuses=statuses, include_deleted=include_deleted)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_messages_by_session_id: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $statuses = 'sampleValue';\nmy $includeDeleted = 0;\n\neval {\n    # GetMessagesBySessionIdPaginatedResponse object\n    my $result = $api_instance->get_messages_by_session_id(id => $id, page => $page, limit => $limit, statuses => $statuses, includeDeleted => $includeDeleted);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_messages_by_session_id: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/sessions/{id}/stat": {
      "get": {
        "operationId": "getMessageSessionStat",
        "summary": "Get a session`s statistics",
        "parameters": [
          {
            "name": "includeDeleted",
            "in": "query",
            "description": "Search also in deleted messages.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetMessageSessionStatResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Outbound Message Sessions"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n// Optional, you can pass them as null values to getMessageSessionStat method below, default values will be used\n$includeDeleted = 0;\n\ntry {\n    // GetMessageSessionStatResponse class object\n    $result = $api->getMessageSessionStat($id, $includeDeleted);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getMessageSessionStat: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n        // Optional, you can pass them as null values to getMessageSessionStat method below, default values will be used\n        int includeDeleted = 0;\n\n        try {\n            // GetMessageSessionStatResponse class object\n            GetMessageSessionStatResponse obj = apiInstance.getMessageSessionStat(id, includeDeleted);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getMessageSessionStat\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n// Optional parameters\nconst opts = {\n    includeDeleted: 0,\n};\n\napi.getMessageSessionStat(id, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\nparams = {\n  # Optional parameters\n  include_deleted: 0,\n}\n\nbegin\n    # GetMessageSessionStatResponse object\n    result = api.get_message_session_stat(id, params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_message_session_stat: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n            // Optional, you can pass them as null values to getMessageSessionStat method below, default values will be used\n            int includeDeleted = 0;\n\n            try {\n                // GetMessageSessionStatResponse class object\n                var result = apiInstance.GetMessageSessionStat(id, includeDeleted);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getMessageSessionStat: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n        ' Optional, you can pass them as null values to getMessageSessionStat method below, default values will be used\n        Dim includeDeleted As Integer = 0\n\n        Try\n            ' GetMessageSessionStatResponse class object\n            Dim result = apiInstance.GetMessageSessionStat(id, includeDeleted)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getMessageSessionStat: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    opts := tm.GetMessageSessionStatOpts{\n        // Optional parameters\n        IncludeDeleted: optional.NewInt32(0),\n    }\n\n    // tm.GetMessageSessionStatResponse struct\n    result, _, err := client.TextMagicApi.GetMessageSessionStat(auth, id, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int includeDeleted = 0;\n\n    try {\n        pplx::task<std::shared_ptr<GetMessageSessionStatResponse>> result = api.getMessageSessionStat(id, includeDeleted);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getMessageSessionStat() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n# Optional params, you can skip them\ninclude_deleted = 0\n\ntry:\n    # GetMessageSessionStatResponse object\n    result = api_instance.get_message_session_stat(id=id, include_deleted=include_deleted)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_message_session_stat: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n# Optional params, you can skip them\nmy $includeDeleted = 0;\n\neval {\n    # GetMessageSessionStatResponse object\n    my $result = $api_instance->get_message_session_stat(id => $id, includeDeleted => $includeDeleted);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_message_session_stat: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sessions/getMessageSessionStat\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/sessions/{id}": {
      "get": {
        "operationId": "getMessageSession",
        "summary": "Get a session`s details",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sessions/getMessageSession\" target=\"_blank\">Try in sandbox</a><br>Get a specific session’s details.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "type": "integer",
            "required": true,
            "x-example": 1,
            "description": "Session ID."
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/MessageSession"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Outbound Message Sessions"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // MessageSession class object\n    $result = $api->getMessageSession($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getMessageSession: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // MessageSession class object\n            MessageSession obj = apiInstance.getMessageSession(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getMessageSession\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getMessageSession(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # MessageSession object\n    result = api.get_message_session(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_message_session: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // MessageSession class object\n                var result = apiInstance.GetMessageSession(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getMessageSession: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' MessageSession class object\n            Dim result = apiInstance.GetMessageSession(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getMessageSession: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.MessageSession struct\n    result, _, err := client.TextMagicApi.GetMessageSession(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<MessageSession>> result = api.getMessageSession(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getMessageSession() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # MessageSession object\n    result = api_instance.get_message_session(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_message_session: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # MessageSession object\n    my $result = $api_instance->get_message_session(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_message_session: $@\\n\";\n}"
          }
        ]
      },
      "delete": {
        "operationId": "deleteMessageSession",
        "summary": "Delete a session",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sessions/deleteMessageSession\" target=\"_blank\">Try in sandbox</a><br>Delete a message session, together with all nested messages.\n> You will not be refunded for any deleted sent sessions.\n",
        "produces": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Outbound Message Sessions"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteMessageSession($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteMessageSession: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteMessageSession(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteMessageSession\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteMessageSession(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_message_session(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_message_session: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteMessageSession(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteMessageSession: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteMessageSession(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteMessageSession: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteMessageSession(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteMessageSession(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteMessageSession() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_message_session(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_message_session: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_message_session(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_message_session: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/sessions/delete": {
      "post": {
        "operationId": "deleteMessageSessionsBulk",
        "produces": [],
        "summary": "Delete sessions (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Sessions/deleteMessageSessionsBulk\" target=\"_blank\">Try in sandbox</a><br>Delete message sessions, together with all nested messages, by given ID(s) or delete all message sessions.",
        "parameters": [
          {
            "name": "DeleteMessageSessionsBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "integer",
                  "example": 0,
                  "enum": [
                    0,
                    1
                  ],
                  "description": "Default is 0 (false). If set to 1, all the entities will be removed."
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Outbound Message Sessions"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteMessageSessionsBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n\ntry {\n    $api->deleteMessageSessionsBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteMessageSessionsBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteMessageSessionsBulkInputObject input = new DeleteMessageSessionsBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n\n        try {\n            apiInstance.deleteMessageSessionsBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteMessageSessionsBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\n\n\napi.deleteMessageSessionsBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteMessageSessionsBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\n\nbegin\n    api.delete_message_sessions_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_message_sessions_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteMessageSessionsBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n\n            try {\n                apiInstance.DeleteMessageSessionsBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteMessageSessionsBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteMessageSessionsBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n\n        Try\n            apiInstance.DeleteMessageSessionsBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteMessageSessionsBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n\n    client.TextMagicApi.DeleteMessageSessionsBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteMessageSessionsBulkInputObject> input(new DeleteMessageSessionsBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    try {\n        pplx::task result = api.deleteMessageSessionsBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteMessageSessionsBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteMessageSessionsBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\n\ntry:\n    api_instance.delete_message_sessions_bulk(delete_message_sessions_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_message_sessions_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteMessageSessionsBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteMessageSessionsBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\n\neval {\n    $api_instance->delete_message_sessions_bulk(delete_message_sessions_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_message_sessions_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/schedules": {
      "get": {
        "operationId": "getAllScheduledMessages",
        "summary": "Get all scheduled messages",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Fetch schedules with a specific status: a - actual, c - completed, x - all.",
            "type": "string",
            "enum": [
              "a",
              "c",
              "x"
            ],
            "default": "x"
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "nextSend",
              "lastSend"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetAllScheduledMessagesPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Scheduled Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getAllScheduledMessages method below, default values will be used\n$page = 1;\n$limit = 10;\n$status = \"x\";\n$orderBy = \"id\";\n$direction = \"desc\";\n\ntry {\n    // GetAllScheduledMessagesPaginatedResponse class object\n    $result = $api->getAllScheduledMessages($page, $limit, $status, $orderBy, $direction);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getAllScheduledMessages: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getAllScheduledMessages method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String status = \"x\";\n        String orderBy = \"id\";\n        String direction = \"desc\";\n\n        try {\n            // GetAllScheduledMessagesPaginatedResponse class object\n            GetAllScheduledMessagesPaginatedResponse obj = apiInstance.getAllScheduledMessages(page, limit, status, orderBy, direction);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getAllScheduledMessages\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    status: \"x\",\n    orderBy: \"id\",\n    direction: \"desc\",\n};\n\napi.getAllScheduledMessages(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  status: 'x',\n  order_by: 'id',\n  direction: 'desc',\n}\n\nbegin\n    # GetAllScheduledMessagesPaginatedResponse object\n    result = api.get_all_scheduled_messages(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_all_scheduled_messages: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getAllScheduledMessages method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string status = \"x\";\n            string orderBy = \"id\";\n            string direction = \"desc\";\n\n            try {\n                // GetAllScheduledMessagesPaginatedResponse class object\n                var result = apiInstance.GetAllScheduledMessages(page, limit, status, orderBy, direction);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getAllScheduledMessages: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getAllScheduledMessages method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim status As String = \"x\"\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n\n        Try\n            ' GetAllScheduledMessagesPaginatedResponse class object\n            Dim result = apiInstance.GetAllScheduledMessages(page, limit, status, orderBy, direction)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getAllScheduledMessages: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetAllScheduledMessagesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Status: optional.NewString(\"x\"),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n    }\n\n    // tm.GetAllScheduledMessagesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetAllScheduledMessages(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string status = \"x\";\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n\n    try {\n        pplx::task<std::shared_ptr<GetAllScheduledMessagesPaginatedResponse>> result = api.getAllScheduledMessages(page, limit, status, orderBy, direction);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getAllScheduledMessages() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nstatus = \"x\"\norder_by = \"id\"\ndirection = \"desc\"\n\ntry:\n    # GetAllScheduledMessagesPaginatedResponse object\n    result = api_instance.get_all_scheduled_messages(page=page, limit=limit, status=status, order_by=order_by, direction=direction)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_all_scheduled_messages: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $status = 'x';\nmy $orderBy = 'id';\nmy $direction = 'desc';\n\neval {\n    # GetAllScheduledMessagesPaginatedResponse object\n    my $result = $api_instance->get_all_scheduled_messages(page => $page, limit => $limit, status => $status, orderBy => $orderBy, direction => $direction);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_all_scheduled_messages: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Schedule%0A/getAllScheduledMessages\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/schedules/search": {
      "get": {
        "operationId": "searchScheduledMessages",
        "summary": "Find scheduled messages",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "query",
            "in": "query",
            "description": "Find messages by specified search query.",
            "type": "string"
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Find schedules by ID(s).",
            "type": "string",
            "pattern": "^(\\d+)(,\\d+)*$"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Fetch schedules with a specific status: a - actual, c - completed, x - all.",
            "type": "string",
            "default": "x",
            "enum": [
              "x",
              "a",
              "c"
            ]
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "nextSend",
              "lastSend"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/SearchScheduledMessagesPaginatedResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Scheduled Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to searchScheduledMessages method below, default values will be used\n$page = 1;\n$limit = 10;\n$query = \"sampleValue\";\n$ids = \"sampleValue\";\n$status = \"x\";\n$orderBy = \"id\";\n$direction = \"desc\";\n\ntry {\n    // SearchScheduledMessagesPaginatedResponse class object\n    $result = $api->searchScheduledMessages($page, $limit, $query, $ids, $status, $orderBy, $direction);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->searchScheduledMessages: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to searchScheduledMessages method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String query = \"sampleValue\";\n        String ids = \"sampleValue\";\n        String status = \"x\";\n        String orderBy = \"id\";\n        String direction = \"desc\";\n\n        try {\n            // SearchScheduledMessagesPaginatedResponse class object\n            SearchScheduledMessagesPaginatedResponse obj = apiInstance.searchScheduledMessages(page, limit, query, ids, status, orderBy, direction);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling searchScheduledMessages\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    query: \"sampleValue\",\n    ids: \"sampleValue\",\n    status: \"x\",\n    orderBy: \"id\",\n    direction: \"desc\",\n};\n\napi.searchScheduledMessages(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  query: 'sampleValue',\n  ids: 'sampleValue',\n  status: 'x',\n  order_by: 'id',\n  direction: 'desc',\n}\n\nbegin\n    # SearchScheduledMessagesPaginatedResponse object\n    result = api.search_scheduled_messages(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->search_scheduled_messages: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to searchScheduledMessages method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string query = \"sampleValue\";\n            string ids = \"sampleValue\";\n            string status = \"x\";\n            string orderBy = \"id\";\n            string direction = \"desc\";\n\n            try {\n                // SearchScheduledMessagesPaginatedResponse class object\n                var result = apiInstance.SearchScheduledMessages(page, limit, query, ids, status, orderBy, direction);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling searchScheduledMessages: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to searchScheduledMessages method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim query As String = \"sampleValue\"\n        Dim ids As String = \"sampleValue\"\n        Dim status As String = \"x\"\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n\n        Try\n            ' SearchScheduledMessagesPaginatedResponse class object\n            Dim result = apiInstance.SearchScheduledMessages(page, limit, query, ids, status, orderBy, direction)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling searchScheduledMessages: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.SearchScheduledMessagesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Query: optional.NewString(\"sampleValue\"),\n        Ids: optional.NewString(\"sampleValue\"),\n        Status: optional.NewString(\"x\"),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n    }\n\n    // tm.SearchScheduledMessagesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.SearchScheduledMessages(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string query = \"sampleValue\";\n    std::string ids = \"sampleValue\";\n    std::string status = \"x\";\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n\n    try {\n        pplx::task<std::shared_ptr<SearchScheduledMessagesPaginatedResponse>> result = api.searchScheduledMessages(page, limit, query, ids, status, orderBy, direction);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"searchScheduledMessages() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nquery = \"sampleValue\"\nids = \"sampleValue\"\nstatus = \"x\"\norder_by = \"id\"\ndirection = \"desc\"\n\ntry:\n    # SearchScheduledMessagesPaginatedResponse object\n    result = api_instance.search_scheduled_messages(page=page, limit=limit, query=query, ids=ids, status=status, order_by=order_by, direction=direction)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->search_scheduled_messages: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $query = 'sampleValue';\nmy $ids = 'sampleValue';\nmy $status = 'x';\nmy $orderBy = 'id';\nmy $direction = 'desc';\n\neval {\n    # SearchScheduledMessagesPaginatedResponse object\n    my $result = $api_instance->search_scheduled_messages(page => $page, limit => $limit, query => $query, ids => $ids, status => $status, orderBy => $orderBy, direction => $direction);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->search_scheduled_messages: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Schedule%0A/searchScheduledMessages\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/schedules/{id}": {
      "get": {
        "operationId": "getScheduledMessage",
        "summary": "Get a single scheduled message",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/MessagesIcs"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Scheduled Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // MessagesIcs class object\n    $result = $api->getScheduledMessage($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getScheduledMessage: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // MessagesIcs class object\n            MessagesIcs obj = apiInstance.getScheduledMessage(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getScheduledMessage\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getScheduledMessage(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # MessagesIcs object\n    result = api.get_scheduled_message(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_scheduled_message: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // MessagesIcs class object\n                var result = apiInstance.GetScheduledMessage(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getScheduledMessage: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' MessagesIcs class object\n            Dim result = apiInstance.GetScheduledMessage(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getScheduledMessage: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.MessagesIcs struct\n    result, _, err := client.TextMagicApi.GetScheduledMessage(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<MessagesIcs>> result = api.getScheduledMessage(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getScheduledMessage() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # MessagesIcs object\n    result = api_instance.get_scheduled_message(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_scheduled_message: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # MessagesIcs object\n    my $result = $api_instance->get_scheduled_message(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_scheduled_message: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Schedule%0A/getScheduledMessage\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteScheduledMessage",
        "produces": [],
        "summary": "Delete a single scheduled message",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Scheduled Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteScheduledMessage($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteScheduledMessage: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteScheduledMessage(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteScheduledMessage\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteScheduledMessage(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_scheduled_message(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_scheduled_message: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteScheduledMessage(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteScheduledMessage: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteScheduledMessage(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteScheduledMessage: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteScheduledMessage(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteScheduledMessage(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteScheduledMessage() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_scheduled_message(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_scheduled_message: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_scheduled_message(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_scheduled_message: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Schedule%0A/deleteScheduledMessage\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/schedules/delete": {
      "post": {
        "operationId": "deleteScheduledMessagesBulk",
        "summary": "Delete scheduled messages (bulk)",
        "produces": [],
        "parameters": [
          {
            "name": "DeleteScheduledMessagesBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "integer",
                  "example": 0,
                  "enum": [
                    0,
                    1
                  ],
                  "description": "Default is 0 (false). If set to 1, all the entities will be removed."
                },
                "status": {
                  "type": "string",
                  "description": "Default is an empty string (false). If set, all entities with specified status will be affected.",
                  "default": ""
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Scheduled Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteScheduledMessagesBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n$input->setStatus(\"\");\n\ntry {\n    $api->deleteScheduledMessagesBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteScheduledMessagesBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteScheduledMessagesBulkInputObject input = new DeleteScheduledMessagesBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n        input.setStatus(\"\");\n\n        try {\n            apiInstance.deleteScheduledMessagesBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteScheduledMessagesBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n    status: \"\",\n}\n\n\napi.deleteScheduledMessagesBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteScheduledMessagesBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\nobj.status = \"\"\n\nbegin\n    api.delete_scheduled_messages_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_scheduled_messages_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteScheduledMessagesBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n            obj.Status = \"\";\n\n            try {\n                apiInstance.DeleteScheduledMessagesBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteScheduledMessagesBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteScheduledMessagesBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null,\n            .Status = \"\"\n        }\n\n        Try\n            apiInstance.DeleteScheduledMessagesBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteScheduledMessagesBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n        Status: \"\",\n    }\n\n    client.TextMagicApi.DeleteScheduledMessagesBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteScheduledMessagesBulkInputObject> input(new DeleteScheduledMessagesBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n    input->setStatus(\"\");\n\n    try {\n        pplx::task result = api.deleteScheduledMessagesBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteScheduledMessagesBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteScheduledMessagesBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\ninput.status = \"\"\n\ntry:\n    api_instance.delete_scheduled_messages_bulk(delete_scheduled_messages_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_scheduled_messages_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteScheduledMessagesBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteScheduledMessagesBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n    status => '',\n);\n\neval {\n    $api_instance->delete_scheduled_messages_bulk(delete_scheduled_messages_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_scheduled_messages_bulk: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Schedule%0A/deleteScheduledMessagesBulk\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/replies": {
      "get": {
        "operationId": "getAllInboundMessages",
        "summary": "Get all inbound messages",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "sender",
              "receiver",
              "messageTime",
              "firstName",
              "lastName"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetAllInboundMessagesPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Inbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getAllInboundMessages method below, default values will be used\n$page = 1;\n$limit = 10;\n$orderBy = \"id\";\n$direction = \"desc\";\n\ntry {\n    // GetAllInboundMessagesPaginatedResponse class object\n    $result = $api->getAllInboundMessages($page, $limit, $orderBy, $direction);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getAllInboundMessages: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getAllInboundMessages method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String orderBy = \"id\";\n        String direction = \"desc\";\n\n        try {\n            // GetAllInboundMessagesPaginatedResponse class object\n            GetAllInboundMessagesPaginatedResponse obj = apiInstance.getAllInboundMessages(page, limit, orderBy, direction);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getAllInboundMessages\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    orderBy: \"id\",\n    direction: \"desc\",\n};\n\napi.getAllInboundMessages(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  order_by: 'id',\n  direction: 'desc',\n}\n\nbegin\n    # GetAllInboundMessagesPaginatedResponse object\n    result = api.get_all_inbound_messages(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_all_inbound_messages: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getAllInboundMessages method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string orderBy = \"id\";\n            string direction = \"desc\";\n\n            try {\n                // GetAllInboundMessagesPaginatedResponse class object\n                var result = apiInstance.GetAllInboundMessages(page, limit, orderBy, direction);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getAllInboundMessages: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getAllInboundMessages method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n\n        Try\n            ' GetAllInboundMessagesPaginatedResponse class object\n            Dim result = apiInstance.GetAllInboundMessages(page, limit, orderBy, direction)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getAllInboundMessages: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetAllInboundMessagesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n    }\n\n    // tm.GetAllInboundMessagesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetAllInboundMessages(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n\n    try {\n        pplx::task<std::shared_ptr<GetAllInboundMessagesPaginatedResponse>> result = api.getAllInboundMessages(page, limit, orderBy, direction);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getAllInboundMessages() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\norder_by = \"id\"\ndirection = \"desc\"\n\ntry:\n    # GetAllInboundMessagesPaginatedResponse object\n    result = api_instance.get_all_inbound_messages(page=page, limit=limit, order_by=order_by, direction=direction)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_all_inbound_messages: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $orderBy = 'id';\nmy $direction = 'desc';\n\neval {\n    # GetAllInboundMessagesPaginatedResponse object\n    my $result = $api_instance->get_all_inbound_messages(page => $page, limit => $limit, orderBy => $orderBy, direction => $direction);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_all_inbound_messages: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Receive%0A/getAllInboundMessages\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/replies/search": {
      "get": {
        "operationId": "searchInboundMessages",
        "summary": "Find inbound messages",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Receive%0A/searchInboundMessages\" target=\"_blank\">Try in sandbox</a><br>Find inbound messages by given parameters.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Find message by ID(s).",
            "type": "string",
            "pattern": "^(\\d+)(,\\d+)*$"
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Find recipients by specified search query.",
            "type": "string"
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "sender",
              "receiver",
              "messageTime",
              "firstName",
              "lastName"
            ]
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          },
          {
            "name": "expand",
            "in": "query",
            "description": "Expand by adding firstName, lastName and contactId.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/SearchInboundMessagesPaginatedResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Inbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to searchInboundMessages method below, default values will be used\n$page = 1;\n$limit = 10;\n$ids = \"sampleValue\";\n$query = \"sampleValue\";\n$orderBy = \"id\";\n$direction = \"desc\";\n$expand = 0;\n\ntry {\n    // SearchInboundMessagesPaginatedResponse class object\n    $result = $api->searchInboundMessages($page, $limit, $ids, $query, $orderBy, $direction, $expand);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->searchInboundMessages: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to searchInboundMessages method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String ids = \"sampleValue\";\n        String query = \"sampleValue\";\n        String orderBy = \"id\";\n        String direction = \"desc\";\n        int expand = 0;\n\n        try {\n            // SearchInboundMessagesPaginatedResponse class object\n            SearchInboundMessagesPaginatedResponse obj = apiInstance.searchInboundMessages(page, limit, ids, query, orderBy, direction, expand);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling searchInboundMessages\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    ids: \"sampleValue\",\n    query: \"sampleValue\",\n    orderBy: \"id\",\n    direction: \"desc\",\n    expand: 0,\n};\n\napi.searchInboundMessages(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  ids: 'sampleValue',\n  query: 'sampleValue',\n  order_by: 'id',\n  direction: 'desc',\n  expand: 0,\n}\n\nbegin\n    # SearchInboundMessagesPaginatedResponse object\n    result = api.search_inbound_messages(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->search_inbound_messages: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to searchInboundMessages method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string ids = \"sampleValue\";\n            string query = \"sampleValue\";\n            string orderBy = \"id\";\n            string direction = \"desc\";\n            int expand = 0;\n\n            try {\n                // SearchInboundMessagesPaginatedResponse class object\n                var result = apiInstance.SearchInboundMessages(page, limit, ids, query, orderBy, direction, expand);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling searchInboundMessages: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to searchInboundMessages method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim ids As String = \"sampleValue\"\n        Dim query As String = \"sampleValue\"\n        Dim orderBy As String = \"id\"\n        Dim direction As String = \"desc\"\n        Dim expand As Integer = 0\n\n        Try\n            ' SearchInboundMessagesPaginatedResponse class object\n            Dim result = apiInstance.SearchInboundMessages(page, limit, ids, query, orderBy, direction, expand)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling searchInboundMessages: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.SearchInboundMessagesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Ids: optional.NewString(\"sampleValue\"),\n        Query: optional.NewString(\"sampleValue\"),\n        OrderBy: optional.NewString(\"id\"),\n        Direction: optional.NewString(\"desc\"),\n        Expand: optional.NewInt32(0),\n    }\n\n    // tm.SearchInboundMessagesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.SearchInboundMessages(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string ids = \"sampleValue\";\n    std::string query = \"sampleValue\";\n    std::string orderBy = \"id\";\n    std::string direction = \"desc\";\n    int expand = 0;\n\n    try {\n        pplx::task<std::shared_ptr<SearchInboundMessagesPaginatedResponse>> result = api.searchInboundMessages(page, limit, ids, query, orderBy, direction, expand);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"searchInboundMessages() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nids = \"sampleValue\"\nquery = \"sampleValue\"\norder_by = \"id\"\ndirection = \"desc\"\nexpand = 0\n\ntry:\n    # SearchInboundMessagesPaginatedResponse object\n    result = api_instance.search_inbound_messages(page=page, limit=limit, ids=ids, query=query, order_by=order_by, direction=direction, expand=expand)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->search_inbound_messages: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $ids = 'sampleValue';\nmy $query = 'sampleValue';\nmy $orderBy = 'id';\nmy $direction = 'desc';\nmy $expand = 0;\n\neval {\n    # SearchInboundMessagesPaginatedResponse object\n    my $result = $api_instance->search_inbound_messages(page => $page, limit => $limit, ids => $ids, query => $query, orderBy => $orderBy, direction => $direction, expand => $expand);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->search_inbound_messages: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/replies/{id}": {
      "get": {
        "operationId": "getInboundMessage",
        "summary": "Get a single inbound message",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1782832,
            "description": "The unique numeric ID for the inbound message."
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/MessageIn"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Inbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1782832;\n\ntry {\n    // MessageIn class object\n    $result = $api->getInboundMessage($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getInboundMessage: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1782832;\n\n        try {\n            // MessageIn class object\n            MessageIn obj = apiInstance.getInboundMessage(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getInboundMessage\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1782832;\n\n\napi.getInboundMessage(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1782832\n\nbegin\n    # MessageIn object\n    result = api.get_inbound_message(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_inbound_message: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1782832;\n\n            try {\n                // MessageIn class object\n                var result = apiInstance.GetInboundMessage(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getInboundMessage: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1782832\n\n        Try\n            ' MessageIn class object\n            Dim result = apiInstance.GetInboundMessage(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getInboundMessage: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1782832\n\n    // tm.MessageIn struct\n    result, _, err := client.TextMagicApi.GetInboundMessage(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1782832;\n\n    try {\n        pplx::task<std::shared_ptr<MessageIn>> result = api.getInboundMessage(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getInboundMessage() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1782832\n\ntry:\n    # MessageIn object\n    result = api_instance.get_inbound_message(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_inbound_message: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1782832;\n\neval {\n    # MessageIn object\n    my $result = $api_instance->get_inbound_message(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_inbound_message: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Receive%0A/getInboundMessage\" target=\"_blank\">Try in sandbox</a><br>"
      },
      "delete": {
        "operationId": "deleteInboundMessage",
        "produces": [],
        "summary": "Delete a single inbound message",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Receive%0A/deleteInboundMessage\" target=\"_blank\">Try in sandbox</a><br>> Note: deleted inbound messages will disappear from TextMagic Online, chats, and any other place they are referenced.  So, be careful!\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1,
            "description": "The unique numeric ID for the inbound message."
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Inbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    $api->deleteInboundMessage($id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteInboundMessage: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            apiInstance.deleteInboundMessage(id);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteInboundMessage\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.deleteInboundMessage(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    api.delete_inbound_message(id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_inbound_message: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                apiInstance.DeleteInboundMessage(id);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteInboundMessage: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteInboundMessage(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteInboundMessage: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteInboundMessage(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteInboundMessage(id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteInboundMessage() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    api_instance.delete_inbound_message(id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_inbound_message: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    $api_instance->delete_inbound_message(id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_inbound_message: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/replies/delete": {
      "post": {
        "operationId": "deleteInboundMessagesBulk",
        "summary": "Delete inbound messages (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Messages%3A%20Receive%0A/deleteInboundMessagesBulk\" target=\"_blank\">Try in sandbox</a><br>> Note: deleted inbound messages will disappear from TextMagic Online, chats, and any other place they are referenced.  So, be careful!\n",
        "produces": [],
        "parameters": [
          {
            "name": "DeleteInboundMessagesBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "integer",
                  "example": 0,
                  "enum": [
                    0,
                    1
                  ],
                  "description": "Default is 0 (false). If set to 1, all the entities will be removed."
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Inbound Messages"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteInboundMessagesBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n\ntry {\n    $api->deleteInboundMessagesBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteInboundMessagesBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteInboundMessagesBulkInputObject input = new DeleteInboundMessagesBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n\n        try {\n            apiInstance.deleteInboundMessagesBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteInboundMessagesBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\n\n\napi.deleteInboundMessagesBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteInboundMessagesBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\n\nbegin\n    api.delete_inbound_messages_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_inbound_messages_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteInboundMessagesBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n\n            try {\n                apiInstance.DeleteInboundMessagesBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteInboundMessagesBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteInboundMessagesBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n\n        Try\n            apiInstance.DeleteInboundMessagesBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteInboundMessagesBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n\n    client.TextMagicApi.DeleteInboundMessagesBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteInboundMessagesBulkInputObject> input(new DeleteInboundMessagesBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    try {\n        pplx::task result = api.deleteInboundMessagesBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteInboundMessagesBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteInboundMessagesBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\n\ntry:\n    api_instance.delete_inbound_messages_bulk(delete_inbound_messages_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_inbound_messages_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteInboundMessagesBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteInboundMessagesBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\n\neval {\n    $api_instance->delete_inbound_messages_bulk(delete_inbound_messages_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_inbound_messages_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/stats/messaging": {
      "get": {
        "operationId": "getMessagingStat",
        "summary": "Get messaging statistics",
        "parameters": [
          {
            "name": "by",
            "in": "query",
            "description": "*   **off** - to get total values per specified time interval;\n*   **day** - to show values grouped by day;\n*   **month** - to show values grouped by month;\n*   **year** - to show values grouped by year.\n",
            "type": "string",
            "default": "off",
            "x-example": "off",
            "enum": [
              "off",
              "day",
              "month",
              "year"
            ]
          },
          {
            "name": "start",
            "in": "query",
            "description": "Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is 7 days prior.\n",
            "type": "integer",
            "x-example": 1430438400
          },
          {
            "name": "end",
            "in": "query",
            "description": "Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is today.\n",
            "type": "integer",
            "x-example": 1431648000
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetMessagingStatResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Statistic"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "Not supported yet."
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getMessagingStat method below, default values will be used\n        String by = \"off\";\n        int start = 1430438400;\n        int end = 1431648000;\n\n        try {\n            // GetMessagingStatResponse class object\n            GetMessagingStatResponse obj = apiInstance.getMessagingStat(by, start, end);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getMessagingStat\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    by: \"off\",\n    start: 1430438400,\n    end: 1431648000,\n};\n\napi.getMessagingStat(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  by: 'off',\n  start: 1430438400,\n  end: 1431648000,\n}\n\nbegin\n    # GetMessagingStatResponse object\n    result = api.get_messaging_stat(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_messaging_stat: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getMessagingStat method below, default values will be used\n            string by = \"off\";\n            int start = 1430438400;\n            int end = 1431648000;\n\n            try {\n                // GetMessagingStatResponse class object\n                var result = apiInstance.GetMessagingStat(by, start, end);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getMessagingStat: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getMessagingStat method below, default values will be used\n        Dim by As String = \"off\"\n        Dim start As Integer = 1430438400\n        Dim end As Integer = 1431648000\n\n        Try\n            ' GetMessagingStatResponse class object\n            Dim result = apiInstance.GetMessagingStat(by, start, end)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getMessagingStat: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetMessagingStatOpts{\n        // Optional parameters\n        By: optional.NewString(\"off\"),\n        Start: optional.NewInt32(1430438400),\n        End: optional.NewInt32(1431648000),\n    }\n\n    // tm.GetMessagingStatResponse struct\n    result, _, err := client.TextMagicApi.GetMessagingStat(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    std::string by = \"off\";\n    int start = 1430438400;\n    int end = 1431648000;\n\n    try {\n        pplx::task<std::shared_ptr<GetMessagingStatResponse>> result = api.getMessagingStat(by, start, end);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getMessagingStat() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\nby = \"off\"\nstart = 1430438400\nend = 1431648000\n\ntry:\n    # GetMessagingStatResponse object\n    result = api_instance.get_messaging_stat(by=by, start=start, end=end)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_messaging_stat: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $by = 'off';\nmy $start = 1430438400;\nmy $end = 1431648000;\n\neval {\n    # GetMessagingStatResponse object\n    my $result = $api_instance->get_messaging_stat(by => $by, start => $start, end => $end);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_messaging_stat: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Statistics/getMessagingStat\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/stats/spending": {
      "get": {
        "operationId": "getSpendingStat",
        "summary": "Get spending statistics",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "start",
            "in": "query",
            "description": "Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is 7 days prior.\n",
            "type": "string",
            "x-example": "2018-11-11 11:11"
          },
          {
            "name": "end",
            "in": "query",
            "description": "Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is today.\n",
            "type": "string",
            "x-example": "2019-11-11 11:11"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetSpendingStatPaginatedResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Statistic"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getSpendingStat method below, default values will be used\n$page = 1;\n$limit = 10;\n$start = \"2018-11-11 11:11\";\n$end = \"2019-11-11 11:11\";\n\ntry {\n    // GetSpendingStatPaginatedResponse class object\n    $result = $api->getSpendingStat($page, $limit, $start, $end);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getSpendingStat: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getSpendingStat method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String start = \"2018-11-11 11:11\";\n        String end = \"2019-11-11 11:11\";\n\n        try {\n            // GetSpendingStatPaginatedResponse class object\n            GetSpendingStatPaginatedResponse obj = apiInstance.getSpendingStat(page, limit, start, end);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getSpendingStat\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    start: \"2018-11-11 11:11\",\n    end: \"2019-11-11 11:11\",\n};\n\napi.getSpendingStat(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  start: '2018-11-11 11:11',\n  end: '2019-11-11 11:11',\n}\n\nbegin\n    # GetSpendingStatPaginatedResponse object\n    result = api.get_spending_stat(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_spending_stat: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getSpendingStat method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string start = \"2018-11-11 11:11\";\n            string end = \"2019-11-11 11:11\";\n\n            try {\n                // GetSpendingStatPaginatedResponse class object\n                var result = apiInstance.GetSpendingStat(page, limit, start, end);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getSpendingStat: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getSpendingStat method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim start As String = \"2018-11-11 11:11\"\n        Dim end As String = \"2019-11-11 11:11\"\n\n        Try\n            ' GetSpendingStatPaginatedResponse class object\n            Dim result = apiInstance.GetSpendingStat(page, limit, start, end)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getSpendingStat: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetSpendingStatOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Start: optional.NewString(\"2018-11-11 11:11\"),\n        End: optional.NewString(\"2019-11-11 11:11\"),\n    }\n\n    // tm.GetSpendingStatPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetSpendingStat(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string start = \"2018-11-11 11:11\";\n    std::string end = \"2019-11-11 11:11\";\n\n    try {\n        pplx::task<std::shared_ptr<GetSpendingStatPaginatedResponse>> result = api.getSpendingStat(page, limit, start, end);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getSpendingStat() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nstart = \"2018-11-11 11:11\"\nend = \"2019-11-11 11:11\"\n\ntry:\n    # GetSpendingStatPaginatedResponse object\n    result = api_instance.get_spending_stat(page=page, limit=limit, start=start, end=end)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_spending_stat: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $start = '2018-11-11 11:11';\nmy $end = '2019-11-11 11:11';\n\neval {\n    # GetSpendingStatPaginatedResponse object\n    my $result = $api_instance->get_spending_stat(page => $page, limit => $limit, start => $start, end => $end);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_spending_stat: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Statistics/getSpendingStat\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/invoices": {
      "get": {
        "operationId": "getInvoices",
        "summary": "Get all invoices",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetInvoicesPaginatedResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Returned when the current user is not allowed to manage invoices."
          }
        },
        "tags": [
          "Billing"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getInvoices method below, default values will be used\n$page = 1;\n$limit = 10;\n\ntry {\n    // GetInvoicesPaginatedResponse class object\n    $result = $api->getInvoices($page, $limit);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getInvoices: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getInvoices method below, default values will be used\n        int page = 1;\n        int limit = 10;\n\n        try {\n            // GetInvoicesPaginatedResponse class object\n            GetInvoicesPaginatedResponse obj = apiInstance.getInvoices(page, limit);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getInvoices\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n};\n\napi.getInvoices(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n}\n\nbegin\n    # GetInvoicesPaginatedResponse object\n    result = api.get_invoices(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_invoices: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getInvoices method below, default values will be used\n            int page = 1;\n            int limit = 10;\n\n            try {\n                // GetInvoicesPaginatedResponse class object\n                var result = apiInstance.GetInvoices(page, limit);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getInvoices: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getInvoices method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n\n        Try\n            ' GetInvoicesPaginatedResponse class object\n            Dim result = apiInstance.GetInvoices(page, limit)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getInvoices: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetInvoicesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n    }\n\n    // tm.GetInvoicesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetInvoices(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n\n    try {\n        pplx::task<std::shared_ptr<GetInvoicesPaginatedResponse>> result = api.getInvoices(page, limit);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getInvoices() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\n\ntry:\n    # GetInvoicesPaginatedResponse object\n    result = api_instance.get_invoices(page=page, limit=limit)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_invoices: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\n\neval {\n    # GetInvoicesPaginatedResponse object\n    my $result = $api_instance->get_invoices(page => $page, limit => $limit);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_invoices: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Invoices/getInvoices\" target=\"_blank\">Try in sandbox</a><br>With the TextMagic API, you can check the invoices and transactions for your account."
      }
    },
    "/api/v2/stats/messaging/data": {
      "get": {
        "operationId": "getMessagingCounters",
        "summary": "Get sent/received messages counters values",
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetMessagingCountersResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Statistic"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    // GetMessagingCountersResponse class object\n    $result = $api->getMessagingCounters();\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getMessagingCounters: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            // GetMessagingCountersResponse class object\n            GetMessagingCountersResponse obj = apiInstance.getMessagingCounters();\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getMessagingCounters\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.getMessagingCounters().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    # GetMessagingCountersResponse object\n    result = api.get_messaging_counters()\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_messaging_counters: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                // GetMessagingCountersResponse class object\n                var result = apiInstance.GetMessagingCounters();\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getMessagingCounters: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            ' GetMessagingCountersResponse class object\n            Dim result = apiInstance.GetMessagingCounters()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getMessagingCounters: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    // tm.GetMessagingCountersResponse struct\n    result, _, err := client.TextMagicApi.GetMessagingCounters(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task<std::shared_ptr<GetMessagingCountersResponse>> result = api.getMessagingCounters();\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getMessagingCounters() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    # GetMessagingCountersResponse object\n    result = api_instance.get_messaging_counters()\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_messaging_counters: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    # GetMessagingCountersResponse object\n    my $result = $api_instance->get_messaging_counters();\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_messaging_counters: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Statistics/getMessagingCounters\" target=\"_blank\">Try in sandbox</a><br>Get total contacts, sent messages and received messages counters values."
      }
    },
    "/api/v2/chats": {
      "get": {
        "operationId": "getAllChats",
        "summary": "Get all chats",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Fetch only (a)ctive, (c)losed or (d)eleted chats.",
            "type": "string",
            "enum": [
              "a",
              "c",
              "d"
            ],
            "x-example": "a"
          },
          {
            "name": "page",
            "in": "query",
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "unread",
              "messageTime"
            ]
          },
          {
            "name": "voice",
            "in": "query",
            "description": "Fetch results with voice calls.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "flat",
            "in": "query",
            "description": "Should additional contact info be included?",
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "default": 0,
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetAllChatsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getAllChats method below, default values will be used\n$status = \"a\";\n$page = 1;\n$limit = 10;\n$orderBy = \"id\";\n$voice = 0;\n$flat = 1;\n\ntry {\n    // GetAllChatsPaginatedResponse class object\n    $result = $api->getAllChats($status, $page, $limit, $orderBy, $voice, $flat);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getAllChats: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getAllChats method below, default values will be used\n        String status = \"a\";\n        int page = 1;\n        int limit = 10;\n        String orderBy = \"id\";\n        int voice = 0;\n        int flat = 1;\n\n        try {\n            // GetAllChatsPaginatedResponse class object\n            GetAllChatsPaginatedResponse obj = apiInstance.getAllChats(status, page, limit, orderBy, voice, flat);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getAllChats\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    status: \"a\",\n    page: 1,\n    limit: 10,\n    orderBy: \"id\",\n    voice: 0,\n    flat: 1,\n};\n\napi.getAllChats(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  status: 'a',\n  page: 1,\n  limit: 10,\n  order_by: 'id',\n  voice: 0,\n  flat: 1,\n}\n\nbegin\n    # GetAllChatsPaginatedResponse object\n    result = api.get_all_chats(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_all_chats: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getAllChats method below, default values will be used\n            string status = \"a\";\n            int page = 1;\n            int limit = 10;\n            string orderBy = \"id\";\n            int voice = 0;\n            int flat = 1;\n\n            try {\n                // GetAllChatsPaginatedResponse class object\n                var result = apiInstance.GetAllChats(status, page, limit, orderBy, voice, flat);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getAllChats: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getAllChats method below, default values will be used\n        Dim status As String = \"a\"\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim orderBy As String = \"id\"\n        Dim voice As Integer = 0\n        Dim flat As Integer = 1\n\n        Try\n            ' GetAllChatsPaginatedResponse class object\n            Dim result = apiInstance.GetAllChats(status, page, limit, orderBy, voice, flat)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getAllChats: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetAllChatsOpts{\n        // Optional parameters\n        Status: optional.NewString(\"a\"),\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        OrderBy: optional.NewString(\"id\"),\n        Voice: optional.NewInt32(0),\n        Flat: optional.NewInt32(1),\n    }\n\n    // tm.GetAllChatsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetAllChats(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    std::string status = \"a\";\n    int page = 1;\n    int limit = 10;\n    std::string orderBy = \"id\";\n    int voice = 0;\n    int flat = 1;\n\n    try {\n        pplx::task<std::shared_ptr<GetAllChatsPaginatedResponse>> result = api.getAllChats(status, page, limit, orderBy, voice, flat);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getAllChats() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\nstatus = \"a\"\npage = 1\nlimit = 10\norder_by = \"id\"\nvoice = 0\nflat = 1\n\ntry:\n    # GetAllChatsPaginatedResponse object\n    result = api_instance.get_all_chats(status=status, page=page, limit=limit, order_by=order_by, voice=voice, flat=flat)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_all_chats: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $status = 'a';\nmy $page = 1;\nmy $limit = 10;\nmy $orderBy = 'id';\nmy $voice = 0;\nmy $flat = 1;\n\neval {\n    # GetAllChatsPaginatedResponse object\n    my $result = $api_instance->get_all_chats(status => $status, page => $page, limit => $limit, orderBy => $orderBy, voice => $voice, flat => $flat);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_all_chats: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/getAllChats\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/chats/{id}": {
      "get": {
        "operationId": "getChat",
        "summary": "Get a single chat",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/Chat"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n\ntry {\n    // Chat class object\n    $result = $api->getChat($id);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getChat: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n\n        try {\n            // Chat class object\n            Chat obj = apiInstance.getChat(id);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getChat\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n\napi.getChat(id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\n\nbegin\n    # Chat object\n    result = api.get_chat(id)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_chat: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n\n            try {\n                // Chat class object\n                var result = apiInstance.GetChat(id);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getChat: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n\n        Try\n            ' Chat class object\n            Dim result = apiInstance.GetChat(id)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getChat: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    // tm.Chat struct\n    result, _, err := client.TextMagicApi.GetChat(auth, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n\n    try {\n        pplx::task<std::shared_ptr<Chat>> result = api.getChat(id);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getChat() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n\ntry:\n    # Chat object\n    result = api_instance.get_chat(id=id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_chat: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n\neval {\n    # Chat object\n    my $result = $api_instance->get_chat(id => $id);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_chat: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/getChat\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/chats/{id}/message": {
      "get": {
        "operationId": "getChatMessages",
        "summary": "Get chat messages",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Find messages by specified search query.",
            "type": "string"
          },
          {
            "name": "start",
            "in": "query",
            "description": "Return messages since specified timestamp only. Required when `end` parameter specified.",
            "type": "string"
          },
          {
            "name": "end",
            "in": "query",
            "description": "Return messages up to specified timestamp only. Required when `start` parameter specified.",
            "type": "string"
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Order direction. Default is desc.",
            "type": "string",
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ]
          },
          {
            "name": "voice",
            "in": "query",
            "description": "Fetch results with voice calls.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          },
          {
            "name": "includeNotes",
            "in": "query",
            "description": "Fetch results with messenger notes.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetChatMessagesPaginatedResponse"
            }
          },
          "400": {
            "description": "Returned when invalid phone number specified."
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$id = 1;\n// Optional, you can pass them as null values to getChatMessages method below, default values will be used\n$page = 1;\n$limit = 10;\n$query = \"sampleValue\";\n$start = \"sampleValue\";\n$end = \"sampleValue\";\n$direction = \"desc\";\n$voice = 0;\n$includeNotes = 0;\n\ntry {\n    // GetChatMessagesPaginatedResponse class object\n    $result = $api->getChatMessages($id, $page, $limit, $query, $start, $end, $direction, $voice, $includeNotes);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getChatMessages: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        int id = 1;\n        // Optional, you can pass them as null values to getChatMessages method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String query = \"sampleValue\";\n        String start = \"sampleValue\";\n        String end = \"sampleValue\";\n        String direction = \"desc\";\n        int voice = 0;\n        int includeNotes = 0;\n\n        try {\n            // GetChatMessagesPaginatedResponse class object\n            GetChatMessagesPaginatedResponse obj = apiInstance.getChatMessages(id, page, limit, query, start, end, direction, voice, includeNotes);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getChatMessages\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst id = 1;\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    query: \"sampleValue\",\n    start: \"sampleValue\",\n    end: \"sampleValue\",\n    direction: \"desc\",\n    voice: 0,\n    includeNotes: 0,\n};\n\napi.getChatMessages(id, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nid = 1\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  query: 'sampleValue',\n  start: 'sampleValue',\n  end: 'sampleValue',\n  direction: 'desc',\n  voice: 0,\n  include_notes: 0,\n}\n\nbegin\n    # GetChatMessagesPaginatedResponse object\n    result = api.get_chat_messages(id, params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_chat_messages: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            int id = 1;\n            // Optional, you can pass them as null values to getChatMessages method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string query = \"sampleValue\";\n            string start = \"sampleValue\";\n            string end = \"sampleValue\";\n            string direction = \"desc\";\n            int voice = 0;\n            int includeNotes = 0;\n\n            try {\n                // GetChatMessagesPaginatedResponse class object\n                var result = apiInstance.GetChatMessages(id, page, limit, query, start, end, direction, voice, includeNotes);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getChatMessages: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim id As Integer = 1\n        ' Optional, you can pass them as null values to getChatMessages method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim query As String = \"sampleValue\"\n        Dim start As String = \"sampleValue\"\n        Dim end As String = \"sampleValue\"\n        Dim direction As String = \"desc\"\n        Dim voice As Integer = 0\n        Dim includeNotes As Integer = 0\n\n        Try\n            ' GetChatMessagesPaginatedResponse class object\n            Dim result = apiInstance.GetChatMessages(id, page, limit, query, start, end, direction, voice, includeNotes)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getChatMessages: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var id int32 = 1\n\n    opts := tm.GetChatMessagesOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Query: optional.NewString(\"sampleValue\"),\n        Start: optional.NewString(\"sampleValue\"),\n        End: optional.NewString(\"sampleValue\"),\n        Direction: optional.NewString(\"desc\"),\n        Voice: optional.NewInt32(0),\n        IncludeNotes: optional.NewInt32(0),\n    }\n\n    // tm.GetChatMessagesPaginatedResponse struct\n    result, _, err := client.TextMagicApi.GetChatMessages(auth, id, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    int id = 1;\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string query = \"sampleValue\";\n    std::string start = \"sampleValue\";\n    std::string end = \"sampleValue\";\n    std::string direction = \"desc\";\n    int voice = 0;\n    int includeNotes = 0;\n\n    try {\n        pplx::task<std::shared_ptr<GetChatMessagesPaginatedResponse>> result = api.getChatMessages(id, page, limit, query, start, end, direction, voice, includeNotes);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getChatMessages() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nid = 1\n# Optional params, you can skip them\npage = 1\nlimit = 10\nquery = \"sampleValue\"\nstart = \"sampleValue\"\nend = \"sampleValue\"\ndirection = \"desc\"\nvoice = 0\ninclude_notes = 0\n\ntry:\n    # GetChatMessagesPaginatedResponse object\n    result = api_instance.get_chat_messages(id=id, page=page, limit=limit, query=query, start=start, end=end, direction=direction, voice=voice, include_notes=include_notes)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_chat_messages: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $id = 1;\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $query = 'sampleValue';\nmy $start = 'sampleValue';\nmy $end = 'sampleValue';\nmy $direction = 'desc';\nmy $voice = 0;\nmy $includeNotes = 0;\n\neval {\n    # GetChatMessagesPaginatedResponse object\n    my $result = $api_instance->get_chat_messages(id => $id, page => $page, limit => $limit, query => $query, start => $start, end => $end, direction => $direction, voice => $voice, includeNotes => $includeNotes);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_chat_messages: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/getChatMessages\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/chats/search": {
      "get": {
        "operationId": "searchChats",
        "summary": "Find chats by message text",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Find chats by specified search query.",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/SearchChatsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to searchChats method below, default values will be used\n$page = 1;\n$limit = 10;\n$query = \"sampleValue\";\n\ntry {\n    // SearchChatsPaginatedResponse class object\n    $result = $api->searchChats($page, $limit, $query);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->searchChats: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to searchChats method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String query = \"sampleValue\";\n\n        try {\n            // SearchChatsPaginatedResponse class object\n            SearchChatsPaginatedResponse obj = apiInstance.searchChats(page, limit, query);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling searchChats\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    query: \"sampleValue\",\n};\n\napi.searchChats(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  query: 'sampleValue',\n}\n\nbegin\n    # SearchChatsPaginatedResponse object\n    result = api.search_chats(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->search_chats: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to searchChats method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string query = \"sampleValue\";\n\n            try {\n                // SearchChatsPaginatedResponse class object\n                var result = apiInstance.SearchChats(page, limit, query);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling searchChats: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to searchChats method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim query As String = \"sampleValue\"\n\n        Try\n            ' SearchChatsPaginatedResponse class object\n            Dim result = apiInstance.SearchChats(page, limit, query)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling searchChats: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.SearchChatsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Query: optional.NewString(\"sampleValue\"),\n    }\n\n    // tm.SearchChatsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.SearchChats(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string query = \"sampleValue\";\n\n    try {\n        pplx::task<std::shared_ptr<SearchChatsPaginatedResponse>> result = api.searchChats(page, limit, query);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"searchChats() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nquery = \"sampleValue\"\n\ntry:\n    # SearchChatsPaginatedResponse object\n    result = api_instance.search_chats(page=page, limit=limit, query=query)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->search_chats: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $query = 'sampleValue';\n\neval {\n    # SearchChatsPaginatedResponse object\n    my $result = $api_instance->search_chats(page => $page, limit => $limit, query => $query);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->search_chats: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/searchChats\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/chats/search/ids": {
      "get": {
        "operationId": "searchChatsByIds",
        "summary": "Find chats (bulk)",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Find chats by ID(s).",
            "type": "string",
            "pattern": "^(\\d+)(,\\d+)*$"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/SearchChatsByIdsPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to searchChatsByIds method below, default values will be used\n$page = 1;\n$limit = 10;\n$ids = \"sampleValue\";\n\ntry {\n    // SearchChatsByIdsPaginatedResponse class object\n    $result = $api->searchChatsByIds($page, $limit, $ids);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->searchChatsByIds: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to searchChatsByIds method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String ids = \"sampleValue\";\n\n        try {\n            // SearchChatsByIdsPaginatedResponse class object\n            SearchChatsByIdsPaginatedResponse obj = apiInstance.searchChatsByIds(page, limit, ids);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling searchChatsByIds\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    ids: \"sampleValue\",\n};\n\napi.searchChatsByIds(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  ids: 'sampleValue',\n}\n\nbegin\n    # SearchChatsByIdsPaginatedResponse object\n    result = api.search_chats_by_ids(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->search_chats_by_ids: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to searchChatsByIds method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string ids = \"sampleValue\";\n\n            try {\n                // SearchChatsByIdsPaginatedResponse class object\n                var result = apiInstance.SearchChatsByIds(page, limit, ids);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling searchChatsByIds: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to searchChatsByIds method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim ids As String = \"sampleValue\"\n\n        Try\n            ' SearchChatsByIdsPaginatedResponse class object\n            Dim result = apiInstance.SearchChatsByIds(page, limit, ids)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling searchChatsByIds: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.SearchChatsByIdsOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Ids: optional.NewString(\"sampleValue\"),\n    }\n\n    // tm.SearchChatsByIdsPaginatedResponse struct\n    result, _, err := client.TextMagicApi.SearchChatsByIds(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string ids = \"sampleValue\";\n\n    try {\n        pplx::task<std::shared_ptr<SearchChatsByIdsPaginatedResponse>> result = api.searchChatsByIds(page, limit, ids);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"searchChatsByIds() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nids = \"sampleValue\"\n\ntry:\n    # SearchChatsByIdsPaginatedResponse object\n    result = api_instance.search_chats_by_ids(page=page, limit=limit, ids=ids)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->search_chats_by_ids: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $ids = 'sampleValue';\n\neval {\n    # SearchChatsByIdsPaginatedResponse object\n    my $result = $api_instance->search_chats_by_ids(page => $page, limit => $limit, ids => $ids);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->search_chats_by_ids: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/searchChatsByIds\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/chats/search/recipients": {
      "get": {
        "operationId": "searchChatsByReceipent",
        "summary": "Find chats by recipient",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/searchChatsByReceipent\" target=\"_blank\">Try in sandbox</a><br>Find chats by recipient (contact, list name or phone number).",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Fetch specified results page.",
            "type": "integer",
            "default": 1
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The number of results per page.",
            "type": "integer",
            "default": 10
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Find chats by specified search query.",
            "type": "string"
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Order results by some field. Default is id.",
            "type": "string",
            "default": "id",
            "enum": [
              "id",
              "unread",
              "messageTime"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/SearchChatsByReceipentPaginatedResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to searchChatsByReceipent method below, default values will be used\n$page = 1;\n$limit = 10;\n$query = \"sampleValue\";\n$orderBy = \"id\";\n\ntry {\n    // SearchChatsByReceipentPaginatedResponse class object\n    $result = $api->searchChatsByReceipent($page, $limit, $query, $orderBy);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->searchChatsByReceipent: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to searchChatsByReceipent method below, default values will be used\n        int page = 1;\n        int limit = 10;\n        String query = \"sampleValue\";\n        String orderBy = \"id\";\n\n        try {\n            // SearchChatsByReceipentPaginatedResponse class object\n            SearchChatsByReceipentPaginatedResponse obj = apiInstance.searchChatsByReceipent(page, limit, query, orderBy);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling searchChatsByReceipent\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    page: 1,\n    limit: 10,\n    query: \"sampleValue\",\n    orderBy: \"id\",\n};\n\napi.searchChatsByReceipent(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  page: 1,\n  limit: 10,\n  query: 'sampleValue',\n  order_by: 'id',\n}\n\nbegin\n    # SearchChatsByReceipentPaginatedResponse object\n    result = api.search_chats_by_receipent(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->search_chats_by_receipent: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to searchChatsByReceipent method below, default values will be used\n            int page = 1;\n            int limit = 10;\n            string query = \"sampleValue\";\n            string orderBy = \"id\";\n\n            try {\n                // SearchChatsByReceipentPaginatedResponse class object\n                var result = apiInstance.SearchChatsByReceipent(page, limit, query, orderBy);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling searchChatsByReceipent: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to searchChatsByReceipent method below, default values will be used\n        Dim page As Integer = 1\n        Dim limit As Integer = 10\n        Dim query As String = \"sampleValue\"\n        Dim orderBy As String = \"id\"\n\n        Try\n            ' SearchChatsByReceipentPaginatedResponse class object\n            Dim result = apiInstance.SearchChatsByReceipent(page, limit, query, orderBy)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling searchChatsByReceipent: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.SearchChatsByReceipentOpts{\n        // Optional parameters\n        Page: optional.NewInt32(1),\n        Limit: optional.NewInt32(10),\n        Query: optional.NewString(\"sampleValue\"),\n        OrderBy: optional.NewString(\"id\"),\n    }\n\n    // tm.SearchChatsByReceipentPaginatedResponse struct\n    result, _, err := client.TextMagicApi.SearchChatsByReceipent(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int page = 1;\n    int limit = 10;\n    std::string query = \"sampleValue\";\n    std::string orderBy = \"id\";\n\n    try {\n        pplx::task<std::shared_ptr<SearchChatsByReceipentPaginatedResponse>> result = api.searchChatsByReceipent(page, limit, query, orderBy);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"searchChatsByReceipent() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\npage = 1\nlimit = 10\nquery = \"sampleValue\"\norder_by = \"id\"\n\ntry:\n    # SearchChatsByReceipentPaginatedResponse object\n    result = api_instance.search_chats_by_receipent(page=page, limit=limit, query=query, order_by=order_by)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->search_chats_by_receipent: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $page = 1;\nmy $limit = 10;\nmy $query = 'sampleValue';\nmy $orderBy = 'id';\n\neval {\n    # SearchChatsByReceipentPaginatedResponse object\n    my $result = $api_instance->search_chats_by_receipent(page => $page, limit => $limit, query => $query, orderBy => $orderBy);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->search_chats_by_receipent: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/{phone}/by/phone": {
      "get": {
        "operationId": "getChatByPhone",
        "summary": "Find chats by phone",
        "parameters": [
          {
            "name": "upsert",
            "in": "query",
            "description": "Create a new chat if not found.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "reopen",
            "in": "query",
            "description": "Reopen chat if found or do not change status.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "type": "string",
            "x-example": "447860021130"
          }
        ],
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/Chat"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$phone = \"447860021130\";\n// Optional, you can pass them as null values to getChatByPhone method below, default values will be used\n$upsert = 0;\n$reopen = 0;\n\ntry {\n    // Chat class object\n    $result = $api->getChatByPhone($phone, $upsert, $reopen);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getChatByPhone: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        String phone = \"447860021130\";\n        // Optional, you can pass them as null values to getChatByPhone method below, default values will be used\n        int upsert = 0;\n        int reopen = 0;\n\n        try {\n            // Chat class object\n            Chat obj = apiInstance.getChatByPhone(phone, upsert, reopen);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getChatByPhone\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst phone = \"447860021130\";\n\n// Optional parameters\nconst opts = {\n    upsert: 0,\n    reopen: 0,\n};\n\napi.getChatByPhone(phone, opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nphone = '447860021130'\nparams = {\n  # Optional parameters\n  upsert: 0,\n  reopen: 0,\n}\n\nbegin\n    # Chat object\n    result = api.get_chat_by_phone(phone, params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_chat_by_phone: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            string phone = \"447860021130\";\n            // Optional, you can pass them as null values to getChatByPhone method below, default values will be used\n            int upsert = 0;\n            int reopen = 0;\n\n            try {\n                // Chat class object\n                var result = apiInstance.GetChatByPhone(phone, upsert, reopen);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getChatByPhone: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim phone As String = \"447860021130\"\n        ' Optional, you can pass them as null values to getChatByPhone method below, default values will be used\n        Dim upsert As Integer = 0\n        Dim reopen As Integer = 0\n\n        Try\n            ' Chat class object\n            Dim result = apiInstance.GetChatByPhone(phone, upsert, reopen)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getChatByPhone: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n    // Required\n    var phone string = \"447860021130\"\n\n    opts := tm.GetChatByPhoneOpts{\n        // Optional parameters\n        Upsert: optional.NewInt32(0),\n        Reopen: optional.NewInt32(0),\n    }\n\n    // tm.Chat struct\n    result, _, err := client.TextMagicApi.GetChatByPhone(auth, phone, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::string phone = \"447860021130\";\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int upsert = 0;\n    int reopen = 0;\n\n    try {\n        pplx::task<std::shared_ptr<Chat>> result = api.getChatByPhone(phone, upsert, reopen);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getChatByPhone() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\nphone = \"447860021130\"\n# Optional params, you can skip them\nupsert = 0\nreopen = 0\n\ntry:\n    # Chat object\n    result = api_instance.get_chat_by_phone(phone=phone, upsert=upsert, reopen=reopen)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_chat_by_phone: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $phone = '447860021130';\n# Optional params, you can skip them\nmy $upsert = 0;\nmy $reopen = 0;\n\neval {\n    # Chat object\n    my $result = $api_instance->get_chat_by_phone(phone => $phone, upsert => $upsert, reopen => $reopen);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_chat_by_phone: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/getChatByPhone\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/chats/unread/count": {
      "get": {
        "operationId": "getUnreadMessagesTotal",
        "summary": "Get unread messages number",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/getUnreadMessagesTotal\" target=\"_blank\">Try in sandbox</a><br>Get the total amount of unread messages in the current user chats.",
        "responses": {
          "200": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/GetUnreadMessagesTotalResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n\ntry {\n    // GetUnreadMessagesTotalResponse class object\n    $result = $api->getUnreadMessagesTotal();\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getUnreadMessagesTotal: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n\n        try {\n            // GetUnreadMessagesTotalResponse class object\n            GetUnreadMessagesTotalResponse obj = apiInstance.getUnreadMessagesTotal();\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getUnreadMessagesTotal\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n\napi.getUnreadMessagesTotal().then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\n\nbegin\n    # GetUnreadMessagesTotalResponse object\n    result = api.get_unread_messages_total()\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_unread_messages_total: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n\n            try {\n                // GetUnreadMessagesTotalResponse class object\n                var result = apiInstance.GetUnreadMessagesTotal();\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getUnreadMessagesTotal: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n\n        Try\n            ' GetUnreadMessagesTotalResponse class object\n            Dim result = apiInstance.GetUnreadMessagesTotal()\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getUnreadMessagesTotal: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    // tm.GetUnreadMessagesTotalResponse struct\n    result, _, err := client.TextMagicApi.GetUnreadMessagesTotal(auth, )\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    try {\n        pplx::task<std::shared_ptr<GetUnreadMessagesTotalResponse>> result = api.getUnreadMessagesTotal();\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getUnreadMessagesTotal() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n\ntry:\n    # GetUnreadMessagesTotalResponse object\n    result = api_instance.get_unread_messages_total()\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_unread_messages_total: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n\neval {\n    # GetUnreadMessagesTotalResponse object\n    my $result = $api_instance->get_unread_messages_total();\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_unread_messages_total: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/status": {
      "post": {
        "operationId": "setChatStatus",
        "summary": "Change chat status",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/setChatStatus\" target=\"_blank\">Try in sandbox</a><br>Set the status of the chat given by ID.",
        "parameters": [
          {
            "name": "SetChatStatusInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "id",
                "status"
              ],
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "Chat ID.",
                  "example": 543
                },
                "status": {
                  "description": "Chat status:\n  * **a** - Active;\n  * **c** - Closed;\n  * **d** - Deleted.\n",
                  "type": "string",
                  "enum": [
                    "a",
                    "c",
                    "d"
                  ]
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new SetChatStatusInputObject();\n\n// Required parameters\n$input->setId(543);\n$input->setStatus(\"\");\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->setChatStatus($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->setChatStatus: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        SetChatStatusInputObject input = new SetChatStatusInputObject();\n\n        // Required parameters\n        input.setId(543);\n        input.setStatus(\"\");\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.setChatStatus(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling setChatStatus\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    id: 543,\n    status: \"\",\n}\n\n\napi.setChatStatus(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::SetChatStatusInputObject.new\n\n# Required parameters\nobj.id = 543\nobj.status = \"\"\n\nbegin\n    # ResourceLinkResponse object\n    result = api.set_chat_status(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->set_chat_status: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new SetChatStatusInputObject();\n\n            // Required parameters\n            obj.Id = 543;\n            obj.Status = \"\";\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.SetChatStatus(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling setChatStatus: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New SetChatStatusInputObject With {\n            .Id = 543,\n            .Status = \"\"\n        }\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.SetChatStatus(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling setChatStatus: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Id: 543,\n        Status: \"\",\n    }\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.SetChatStatus(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<SetChatStatusInputObject> input(new SetChatStatusInputObject);\n    // Required parameters\n    input->setId(543);\n    input->setStatus(\"\");\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.setChatStatus(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"setChatStatus() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.SetChatStatusInputObject()\n\n# Required parameters\ninput.id = 543\ninput.status = \"\"\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.set_chat_status(set_chat_status_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->set_chat_status: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::SetChatStatusInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::SetChatStatusInputObject->new(\n    # Required parameters\n    id => 543,\n    status => '',\n);\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->set_chat_status(set_chat_status_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->set_chat_status: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/pin": {
      "post": {
        "operationId": "pinChat",
        "summary": "Pin or unpin a chat",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/pinChat\" target=\"_blank\">Try in sandbox</a><br>Pin or unpin a single chat.",
        "parameters": [
          {
            "name": "PinChatInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "id",
                "pinned"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "Chat ID.",
                  "example": 542
                },
                "pinned": {
                  "type": "integer",
                  "description": "Pinned value: 0 = unpin, 1 = pin.",
                  "example": 1
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new PinChatInputObject();\n\n// Required parameters\n$input->setId(542);\n$input->setPinned(1);\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->pinChat($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->pinChat: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        PinChatInputObject input = new PinChatInputObject();\n\n        // Required parameters\n        input.setId(542);\n        input.setPinned(1);\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.pinChat(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling pinChat\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    id: 542,\n    pinned: 1,\n}\n\n\napi.pinChat(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::PinChatInputObject.new\n\n# Required parameters\nobj.id = 542\nobj.pinned = 1\n\nbegin\n    # ResourceLinkResponse object\n    result = api.pin_chat(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->pin_chat: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new PinChatInputObject();\n\n            // Required parameters\n            obj.Id = 542;\n            obj.Pinned = 1;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.PinChat(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling pinChat: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New PinChatInputObject With {\n            .Id = 542,\n            .Pinned = 1\n        }\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.PinChat(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling pinChat: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Id: 542,\n        Pinned: 1,\n    }\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.PinChat(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<PinChatInputObject> input(new PinChatInputObject);\n    // Required parameters\n    input->setId(542);\n    input->setPinned(1);\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.pinChat(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"pinChat() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.PinChatInputObject()\n\n# Required parameters\ninput.id = 542\ninput.pinned = 1\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.pin_chat(pin_chat_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->pin_chat: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::PinChatInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::PinChatInputObject->new(\n    # Required parameters\n    id => 542,\n    pinned => 1,\n);\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->pin_chat(pin_chat_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->pin_chat: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/mute": {
      "post": {
        "operationId": "muteChat",
        "summary": "Mute chat sounds",
        "parameters": [
          {
            "name": "MuteChatInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "required": [
                "id",
                "mute"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "Chat ID.",
                  "example": 542
                },
                "mute": {
                  "type": "boolean",
                  "description": "Mute notifications sound.",
                  "example": true
                },
                "for": {
                  "type": "integer",
                  "description": "Mute for N hours.",
                  "example": 5
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Returned when successful.",
            "schema": {
              "$ref": "#/definitions/ResourceLinkResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "404": {
            "description": "Request data not found.",
            "schema": {
              "$ref": "#/definitions/NotFoundResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new MuteChatInputObject();\n\n// Required parameters\n$input->setId(542);\n$input->setMute(true);\n\n// Optional parameters, you can skip these setters calls\n$input->setFor(5);\n\ntry {\n    // ResourceLinkResponse class object\n    $result = $api->muteChat($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->muteChat: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        MuteChatInputObject input = new MuteChatInputObject();\n\n        // Required parameters\n        input.setId(542);\n        input.setMute(true);\n\n        // Optional parameters, you can skip these setters calls\n        input.setFor(5);\n\n        try {\n            // ResourceLinkResponse class object\n            ResourceLinkResponse obj = apiInstance.muteChat(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling muteChat\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    id: 542,\n    mute: true,\n    // Optional parameters\n    for: 5,\n}\n\n\napi.muteChat(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::MuteChatInputObject.new\n\n# Required parameters\nobj.id = 542\nobj.mute = true\n# Optional parameters, you can skip them\nobj.for = 5\n\nbegin\n    # ResourceLinkResponse object\n    result = api.mute_chat(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->mute_chat: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new MuteChatInputObject();\n\n            // Required parameters\n            obj.Id = 542;\n            obj.Mute = true;\n\n            // Optional parameters, you can skip these setters calls\n            obj.For = 5;\n\n            try {\n                // ResourceLinkResponse class object\n                var result = apiInstance.MuteChat(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling muteChat: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New MuteChatInputObject With {\n            .Id = 542,\n            .Mute = true,\n            .For = 5\n        }\n\n        Try\n            ' ResourceLinkResponse class object\n            Dim result = apiInstance.MuteChat(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling muteChat: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Id: 542,\n        Mute: true,\n        // Optional parameters, you can skip them\n        For: 5,\n    }\n\n    // tm.ResourceLinkResponse struct\n    result, _, err := client.TextMagicApi.MuteChat(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<MuteChatInputObject> input(new MuteChatInputObject);\n    // Required parameters\n    input->setId(542);\n    input->setMute(true);\n    // Optional parameters, you can skip them\n    input->setFor(5);\n\n    try {\n        pplx::task<std::shared_ptr<ResourceLinkResponse>> result = api.muteChat(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"muteChat() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.MuteChatInputObject()\n\n# Required parameters\ninput.id = 542\ninput.mute = true\n# Optional parameters, you can skip them\ninput.for = 5\n\ntry:\n    # ResourceLinkResponse object\n    result = api_instance.mute_chat(mute_chat_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->mute_chat: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::MuteChatInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::MuteChatInputObject->new(\n    # Required parameters\n    id => 542,\n    mute => 1,\n    # Optional parameters, you can skip them\n    for => 5,\n);\n\neval {\n    # ResourceLinkResponse object\n    my $result = $api_instance->mute_chat(mute_chat_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->mute_chat: $@\\n\";\n}"
          }
        ],
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/muteChat\" target=\"_blank\">Try in sandbox</a><br>"
      }
    },
    "/api/v2/chats/mute/bulk": {
      "post": {
        "operationId": "muteChatsBulk",
        "summary": "Mute chats (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/muteChatsBulk\" target=\"_blank\">Try in sandbox</a><br>Mute several chats by chat ids or mute all chats.",
        "produces": [],
        "parameters": [
          {
            "name": "MuteChatsBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "boolean",
                  "description": "Entity ID(s), separated by comma",
                  "example": false
                },
                "for": {
                  "type": "integer",
                  "description": "Mute for N hours.",
                  "example": 1
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new MuteChatsBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n$input->setFor(1);\n\ntry {\n    $api->muteChatsBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->muteChatsBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        MuteChatsBulkInputObject input = new MuteChatsBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n        input.setFor(1);\n\n        try {\n            apiInstance.muteChatsBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling muteChatsBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n    for: 1,\n}\n\n\napi.muteChatsBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::MuteChatsBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\nobj.for = 1\n\nbegin\n    api.mute_chats_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->mute_chats_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new MuteChatsBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n            obj.For = 1;\n\n            try {\n                apiInstance.MuteChatsBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling muteChatsBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New MuteChatsBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null,\n            .For = 1\n        }\n\n        Try\n            apiInstance.MuteChatsBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling muteChatsBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n        For: 1,\n    }\n\n    client.TextMagicApi.MuteChatsBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<MuteChatsBulkInputObject> input(new MuteChatsBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n    input->setFor(1);\n\n    try {\n        pplx::task result = api.muteChatsBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"muteChatsBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.MuteChatsBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\ninput.for = 1\n\ntry:\n    api_instance.mute_chats_bulk(mute_chats_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->mute_chats_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::MuteChatsBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::MuteChatsBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n    for => 1,\n);\n\neval {\n    $api_instance->mute_chats_bulk(mute_chats_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->mute_chats_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/unmute/bulk": {
      "post": {
        "operationId": "unmuteChatsBulk",
        "summary": "Unmute chats (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/unmuteChatsBulk\" target=\"_blank\">Try in sandbox</a><br>Unmute several chats by chat ids or unmute all chats.",
        "produces": [],
        "parameters": [
          {
            "name": "UnmuteChatsBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "boolean",
                  "description": "Entity ID(s), separated by comma",
                  "example": false
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new UnmuteChatsBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n\ntry {\n    $api->unmuteChatsBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->unmuteChatsBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        UnmuteChatsBulkInputObject input = new UnmuteChatsBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n\n        try {\n            apiInstance.unmuteChatsBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling unmuteChatsBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\n\n\napi.unmuteChatsBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::UnmuteChatsBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\n\nbegin\n    api.unmute_chats_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->unmute_chats_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new UnmuteChatsBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n\n            try {\n                apiInstance.UnmuteChatsBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling unmuteChatsBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New UnmuteChatsBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n\n        Try\n            apiInstance.UnmuteChatsBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling unmuteChatsBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n\n    client.TextMagicApi.UnmuteChatsBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<UnmuteChatsBulkInputObject> input(new UnmuteChatsBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    try {\n        pplx::task result = api.unmuteChatsBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"unmuteChatsBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.UnmuteChatsBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\n\ntry:\n    api_instance.unmute_chats_bulk(unmute_chats_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->unmute_chats_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::UnmuteChatsBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::UnmuteChatsBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\n\neval {\n    $api_instance->unmute_chats_bulk(unmute_chats_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->unmute_chats_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/unread/bulk": {
      "post": {
        "operationId": "markChatsUnreadBulk",
        "summary": "Mark chats as unread (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/markChatsUnreadBulk\" target=\"_blank\">Try in sandbox</a><br>Mark several chats as UNread by chat IDs or mark all chats as UNread",
        "produces": [],
        "parameters": [
          {
            "name": "MarkChatsUnreadBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "boolean",
                  "description": "Entity ID(s), separated by comma.",
                  "example": false
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new MarkChatsUnreadBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n\ntry {\n    $api->markChatsUnreadBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->markChatsUnreadBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        MarkChatsUnreadBulkInputObject input = new MarkChatsUnreadBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n\n        try {\n            apiInstance.markChatsUnreadBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling markChatsUnreadBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\n\n\napi.markChatsUnreadBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::MarkChatsUnreadBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\n\nbegin\n    api.mark_chats_unread_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->mark_chats_unread_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new MarkChatsUnreadBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n\n            try {\n                apiInstance.MarkChatsUnreadBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling markChatsUnreadBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New MarkChatsUnreadBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n\n        Try\n            apiInstance.MarkChatsUnreadBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling markChatsUnreadBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n\n    client.TextMagicApi.MarkChatsUnreadBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<MarkChatsUnreadBulkInputObject> input(new MarkChatsUnreadBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    try {\n        pplx::task result = api.markChatsUnreadBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"markChatsUnreadBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.MarkChatsUnreadBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\n\ntry:\n    api_instance.mark_chats_unread_bulk(mark_chats_unread_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->mark_chats_unread_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::MarkChatsUnreadBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::MarkChatsUnreadBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\n\neval {\n    $api_instance->mark_chats_unread_bulk(mark_chats_unread_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->mark_chats_unread_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/read/bulk": {
      "post": {
        "operationId": "markChatsReadBulk",
        "produces": [],
        "summary": "Mark chats as read (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/markChatsReadBulk\" target=\"_blank\">Try in sandbox</a><br>Mark several chats as read by chat IDs or mark all chats as read",
        "parameters": [
          {
            "name": "MarkChatsReadBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "boolean",
                  "description": "Entity ID(s), separated by comma.",
                  "example": false
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new MarkChatsReadBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n\ntry {\n    $api->markChatsReadBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->markChatsReadBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        MarkChatsReadBulkInputObject input = new MarkChatsReadBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n\n        try {\n            apiInstance.markChatsReadBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling markChatsReadBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\n\n\napi.markChatsReadBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::MarkChatsReadBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\n\nbegin\n    api.mark_chats_read_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->mark_chats_read_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new MarkChatsReadBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n\n            try {\n                apiInstance.MarkChatsReadBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling markChatsReadBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New MarkChatsReadBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n\n        Try\n            apiInstance.MarkChatsReadBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling markChatsReadBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n\n    client.TextMagicApi.MarkChatsReadBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<MarkChatsReadBulkInputObject> input(new MarkChatsReadBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    try {\n        pplx::task result = api.markChatsReadBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"markChatsReadBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.MarkChatsReadBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\n\ntry:\n    api_instance.mark_chats_read_bulk(mark_chats_read_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->mark_chats_read_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::MarkChatsReadBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::MarkChatsReadBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\n\neval {\n    $api_instance->mark_chats_read_bulk(mark_chats_read_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->mark_chats_read_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/close/bulk": {
      "post": {
        "operationId": "closeChatsBulk",
        "produces": [],
        "summary": "Close chats (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/closeChatsBulk\" target=\"_blank\">Try in sandbox</a><br>Close chats by chat IDs or close all chats",
        "parameters": [
          {
            "name": "CloseChatsBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "boolean",
                  "description": "Entity ID(s), separated by comma.",
                  "example": false
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new CloseChatsBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n\ntry {\n    $api->closeChatsBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->closeChatsBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        CloseChatsBulkInputObject input = new CloseChatsBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n\n        try {\n            apiInstance.closeChatsBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling closeChatsBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\n\n\napi.closeChatsBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::CloseChatsBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\n\nbegin\n    api.close_chats_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->close_chats_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new CloseChatsBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n\n            try {\n                apiInstance.CloseChatsBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling closeChatsBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New CloseChatsBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n\n        Try\n            apiInstance.CloseChatsBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling closeChatsBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n\n    client.TextMagicApi.CloseChatsBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<CloseChatsBulkInputObject> input(new CloseChatsBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    try {\n        pplx::task result = api.closeChatsBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"closeChatsBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.CloseChatsBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\n\ntry:\n    api_instance.close_chats_bulk(close_chats_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->close_chats_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::CloseChatsBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::CloseChatsBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\n\neval {\n    $api_instance->close_chats_bulk(close_chats_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->close_chats_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/close/read": {
      "post": {
        "operationId": "closeReadChats",
        "produces": [],
        "summary": "Close read chats",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/closeReadChats\" target=\"_blank\">Try in sandbox</a><br>Close all chats that have no unread messages.",
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new CloseReadChatsInputObject();\n\ntry {\n    $api->closeReadChats($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->closeReadChats: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        CloseReadChatsInputObject input = new CloseReadChatsInputObject();\n\n        try {\n            apiInstance.closeReadChats(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling closeReadChats\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n}\n\n\napi.closeReadChats(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::CloseReadChatsInputObject.new\n\nbegin\n    api.close_read_chats(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->close_read_chats: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new CloseReadChatsInputObject();\n\n            try {\n                apiInstance.CloseReadChats(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling closeReadChats: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New CloseReadChatsInputObject With {\n        }\n\n        Try\n            apiInstance.CloseReadChats(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling closeReadChats: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n    }\n\n    client.TextMagicApi.CloseReadChats(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<CloseReadChatsInputObject> input(new CloseReadChatsInputObject);\n\n    try {\n        pplx::task result = api.closeReadChats(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"closeReadChats() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.CloseReadChatsInputObject()\n\ntry:\n    api_instance.close_read_chats(close_read_chats_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->close_read_chats: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::CloseReadChatsInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::CloseReadChatsInputObject->new(\n);\n\neval {\n    $api_instance->close_read_chats(close_read_chats_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->close_read_chats: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/reopen/bulk": {
      "post": {
        "operationId": "reopenChatsBulk",
        "summary": "Reopen chats (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/reopenChatsBulk\" target=\"_blank\">Try in sandbox</a><br>Reopen chats by chat IDs or reopen all chats",
        "produces": [],
        "parameters": [
          {
            "name": "ReopenChatsBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "boolean",
                  "description": "Entity ID(s), separated by comma.",
                  "example": false
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new ReopenChatsBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n\ntry {\n    $api->reopenChatsBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->reopenChatsBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        ReopenChatsBulkInputObject input = new ReopenChatsBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n\n        try {\n            apiInstance.reopenChatsBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling reopenChatsBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n}\n\n\napi.reopenChatsBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::ReopenChatsBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\n\nbegin\n    api.reopen_chats_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->reopen_chats_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new ReopenChatsBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n\n            try {\n                apiInstance.ReopenChatsBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling reopenChatsBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New ReopenChatsBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null\n        }\n\n        Try\n            apiInstance.ReopenChatsBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling reopenChatsBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n    }\n\n    client.TextMagicApi.ReopenChatsBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<ReopenChatsBulkInputObject> input(new ReopenChatsBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n\n    try {\n        pplx::task result = api.reopenChatsBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"reopenChatsBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.ReopenChatsBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\n\ntry:\n    api_instance.reopen_chats_bulk(reopen_chats_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->reopen_chats_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::ReopenChatsBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::ReopenChatsBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n);\n\neval {\n    $api_instance->reopen_chats_bulk(reopen_chats_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->reopen_chats_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/delete": {
      "post": {
        "operationId": "deleteChatsBulk",
        "summary": "Delete chats (bulk)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/deleteChatsBulk\" target=\"_blank\">Try in sandbox</a><br>Delete chats by given IDs or delete all chats.",
        "produces": [],
        "parameters": [
          {
            "name": "DeleteChatsBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "ids": {
                  "type": "string",
                  "description": "Entity ID(s), separated by comma.",
                  "example": "1,2,3"
                },
                "all": {
                  "type": "boolean",
                  "description": "Entity ID(s), separated by comma.",
                  "example": false
                },
                "status": {
                  "type": "string",
                  "description": "Default is an empty string. If set, all entities with specified status will be affected.",
                  "enum": [
                    "a",
                    "c",
                    "d"
                  ],
                  "example": "a"
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteChatsBulkInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setIds(\"1,2,3\");\n$input->setAll(null);\n$input->setStatus(\"a\");\n\ntry {\n    $api->deleteChatsBulk($input);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteChatsBulk: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteChatsBulkInputObject input = new DeleteChatsBulkInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setIds(\"1,2,3\");\n        input.setAll(null);\n        input.setStatus(\"a\");\n\n        try {\n            apiInstance.deleteChatsBulk(input);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteChatsBulk\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    ids: \"1,2,3\",\n    all: null,\n    status: \"a\",\n}\n\n\napi.deleteChatsBulk(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteChatsBulkInputObject.new\n# Optional parameters, you can skip them\nobj.ids = \"1,2,3\"\nobj.all = null\nobj.status = \"a\"\n\nbegin\n    api.delete_chats_bulk(input)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_chats_bulk: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteChatsBulkInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Ids = \"1,2,3\";\n            obj.All = null;\n            obj.Status = \"a\";\n\n            try {\n                apiInstance.DeleteChatsBulk(obj);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteChatsBulk: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteChatsBulkInputObject With {\n            .Ids = \"1,2,3\",\n            .All = null,\n            .Status = \"a\"\n        }\n\n        Try\n            apiInstance.DeleteChatsBulk(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteChatsBulk: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Ids: \"1,2,3\",\n        All: null,\n        Status: \"a\",\n    }\n\n    client.TextMagicApi.DeleteChatsBulk(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteChatsBulkInputObject> input(new DeleteChatsBulkInputObject);\n    // Optional parameters, you can skip them\n    input->setIds(\"1,2,3\");\n    input->setAll(null);\n    input->setStatus(\"a\");\n\n    try {\n        pplx::task result = api.deleteChatsBulk(input);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteChatsBulk() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteChatsBulkInputObject()\n# Optional parameters, you can skip them\ninput.ids = \"1,2,3\"\ninput.all = null\ninput.status = \"a\"\n\ntry:\n    api_instance.delete_chats_bulk(delete_chats_bulk_input_object=input)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_chats_bulk: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteChatsBulkInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteChatsBulkInputObject->new(\n    # Optional parameters, you can skip them\n    ids => '1,2,3',\n    all => null,\n    status => 'a',\n);\n\neval {\n    $api_instance->delete_chats_bulk(delete_chats_bulk_input_object => $input);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_chats_bulk: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/chats/{id}/messages/delete": {
      "post": {
        "operationId": "deleteChatMessages",
        "summary": "Delete chat messages by ID(s)",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Chats/deleteChatMessages\" target=\"_blank\">Try in sandbox</a><br>Delete messages from chat by given message IDs.",
        "produces": [],
        "parameters": [
          {
            "name": "DeleteChatMessagesBulkInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "properties": {
                "inbound_ids": {
                  "type": "string",
                  "description": "Inbound message IDs to delete. Require when \"all\" is equal to 0 (false).",
                  "example": "1,2,3,4"
                },
                "sent_ids": {
                  "type": "string",
                  "description": "Sent message IDs to delete. Require when \"all\" is equal to 0 (false).",
                  "example": "1,2,3,4"
                },
                "calls_ids": {
                  "type": "string",
                  "description": "Calls IDs to delete. Require when \"all\" is equal to 0 (false).",
                  "example": "1,2,3,4"
                },
                "all": {
                  "type": "boolean",
                  "description": "Default is 0 (false). If set to 1, all the entities will be removed.",
                  "example": false
                }
              }
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "integer",
            "x-example": 1
          }
        ],
        "responses": {
          "204": {
            "description": "Request executed with success."
          },
          "400": {
            "description": "Bad request.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Chats"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new DeleteChatMessagesInputObject();\n\n// Optional parameters, you can skip these setters calls\n$input->setInbound_ids(\"1,2,3,4\");\n$input->setSent_ids(\"1,2,3,4\");\n$input->setCalls_ids(\"1,2,3,4\");\n$input->setAll(null);\n$id = 1;\n\ntry {\n    $api->deleteChatMessages($input$id);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->deleteChatMessages: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        DeleteChatMessagesInputObject input = new DeleteChatMessagesInputObject();\n\n        // Optional parameters, you can skip these setters calls\n        input.setInbound_ids(\"1,2,3,4\");\n        input.setSent_ids(\"1,2,3,4\");\n        input.setCalls_ids(\"1,2,3,4\");\n        input.setAll(null);\n        int id = 1;\n\n        try {\n            apiInstance.deleteChatMessages(inputid);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling deleteChatMessages\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    // Optional parameters\n    inbound_ids: \"1,2,3,4\",\n    sent_ids: \"1,2,3,4\",\n    calls_ids: \"1,2,3,4\",\n    all: null,\n}\nconst id = 1;\n\n\napi.deleteChatMessages(input, id).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::DeleteChatMessagesInputObject.new\n# Optional parameters, you can skip them\nobj.inbound_ids = \"1,2,3,4\"\nobj.sent_ids = \"1,2,3,4\"\nobj.calls_ids = \"1,2,3,4\"\nobj.all = null\nid = 1\n\nbegin\n    api.delete_chat_messages(input, id)\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->delete_chat_messages: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new DeleteChatMessagesInputObject();\n\n            // Optional parameters, you can skip these setters calls\n            obj.Inbound_ids = \"1,2,3,4\";\n            obj.Sent_ids = \"1,2,3,4\";\n            obj.Calls_ids = \"1,2,3,4\";\n            obj.All = null;\n            int id = 1;\n\n            try {\n                apiInstance.DeleteChatMessages(objid);\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling deleteChatMessages: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New DeleteChatMessagesInputObject With {\n            .Inbound_ids = \"1,2,3,4\",\n            .Sent_ids = \"1,2,3,4\",\n            .Calls_ids = \"1,2,3,4\",\n            .All = null\n        }\n        Dim id As Integer = 1\n\n        Try\n            apiInstance.DeleteChatMessages(objid)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling deleteChatMessages: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Optional parameters, you can skip them\n        Inbound_ids: \"1,2,3,4\",\n        Sent_ids: \"1,2,3,4\",\n        Calls_ids: \"1,2,3,4\",\n        All: null,\n    }\n    // Required\n    var id int32 = 1\n\n    client.TextMagicApi.DeleteChatMessages(auth, input, id)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<DeleteChatMessagesInputObject> input(new DeleteChatMessagesInputObject);\n    // Optional parameters, you can skip them\n    input->setInbound_ids(\"1,2,3,4\");\n    input->setSent_ids(\"1,2,3,4\");\n    input->setCalls_ids(\"1,2,3,4\");\n    input->setAll(null);\n\n    int id = 1;\n\n    try {\n        pplx::task result = api.deleteChatMessages(input, id);\n        result.wait();\n    } catch(const std::exception& e) {\n        std::cout << \"deleteChatMessages() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.DeleteChatMessagesInputObject()\n# Optional parameters, you can skip them\ninput.inbound_ids = \"1,2,3,4\"\ninput.sent_ids = \"1,2,3,4\"\ninput.calls_ids = \"1,2,3,4\"\ninput.all = null\nid = 1\n\ntry:\n    api_instance.delete_chat_messages(delete_chat_messages_input_object=input, id=id)\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->delete_chat_messages: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::DeleteChatMessagesInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::DeleteChatMessagesInputObject->new(\n    # Optional parameters, you can skip them\n    inbound_ids => '1,2,3,4',\n    sent_ids => '1,2,3,4',\n    calls_ids => '1,2,3,4',\n    all => null,\n);\nmy $id = 1;\n\neval {\n    $api_instance->delete_chat_messages(delete_chat_messages_input_object => $input, id => $id);\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->delete_chat_messages: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/surveys/{id}/start": {},
    "/api/v2/surveys/{id}/duplicate": {},
    "/api/v2/surveys/{id}/cancel": {},
    "/api/v2/surveys/{id}/reset": {},
    "/api/v2/surveys": {},
    "/api/v2/surveys/{id}/normalized": {},
    "/api/v2/surveys/{id}": {},
    "/api/v2/surveys/{id}/nodes": {},
    "/api/v2/surveys/nodes/{id}": {},
    "/api/v2/surveys/nodes/merge": {},
    "/api/v2/email-campaigns": {
      "post": {
        "operationId": "createEmailCampaign",
        "summary": "Send email campaign",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Email%20Campaigns/createEmailCampaign\" target=\"_blank\">Try in sandbox</a><br>Creates a new email campaign and sends it to the specified recipients.\n\nThis endpoint allows you to create and immediately send an email marketing campaign to your contacts, groups, or direct email addresses. The campaign will be processed asynchronously, and you'll receive a campaign object with tracking information.\n\n## Request Requirements\n\n- **Email Sender ID**: Must be a valid, configured email sender from your account\n- **Recipients**: At least one recipient type must be specified (contacts, groups, or emails)\n- **Content**: Subject and HTML message content are required\n- **Balance**: Sufficient account balance for the estimated campaign cost\n\n## Recipient Types\n\nYou can target multiple recipient types in a single campaign:\n\n- **Contact IDs**: Send to specific contacts from your contact list\n- **Group IDs**: Send to all contacts within specified groups  \n- **Direct Emails**: Send to email addresses not in your contact list\n\n## Content Guidelines\n\n- **Subject**: Maximum 998 characters, should be engaging and relevant\n- **Message**: HTML content supported, including images, links, and formatting\n- **From Name**: Optional custom sender name (max 500 characters)\n- **Reply-To**: Optional custom reply-to email address\n\n## Cost and Balance\n\nThe API automatically calculates campaign costs based on:\n- Total number of unique recipients across all specified groups, contacts, and emails\n- Your account's email pricing tier\n- Any additional features or premium content\n\nIf your account balance is insufficient, the request will be rejected with a low balance error.\n\n## Response Information\n\nSuccessful campaigns return:\n- Campaign ID for tracking and analytics\n- Current campaign status and progress\n- Cost breakdown and recipient counts\n- Sender information and content preview\n- Statistical totals and engagement metrics\n\n## Error Scenarios\n\nCommon error conditions include:\n- **Validation Errors**: Invalid email addresses, missing required fields, or content that exceeds limits\n- **Insufficient Balance**: Account balance too low for campaign cost\n- **Invalid Recipients**: Non-existent contact/group IDs or invalid email formats\n- **Sender Configuration**: Invalid or unconfigured email sender ID\n- **No Recipients**: All recipient arrays are empty or invalid\n",
        "parameters": [
          {
            "name": "CreateEmailCampaignInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "emailSenderId",
                "subject",
                "message",
                "recipients"
              ],
              "additionalProperties": false,
              "properties": {
                "emailSenderId": {
                  "type": "integer",
                  "description": "Email sender ID from your configured senders.",
                  "example": 123
                },
                "subject": {
                  "type": "string",
                  "maxLength": 998,
                  "description": "Email subject line.",
                  "example": "Special Offer - 50% Off Today Only!"
                },
                "message": {
                  "type": "string",
                  "description": "HTML email content.",
                  "example": "<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>"
                },
                "fromName": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "Optional custom sender name.",
                  "example": "John Smith",
                  "x-nullable": true
                },
                "replyToEmail": {
                  "type": "string",
                  "format": "email",
                  "description": "Optional custom reply-to email address.",
                  "example": "support@example.com",
                  "x-nullable": true
                },
                "recipients": {
                  "type": "object",
                  "description": "Campaign recipients configuration.",
                  "required": [
                    "contactIds",
                    "emails",
                    "groupIds"
                  ],
                  "properties": {
                    "contactIds": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      },
                      "description": "Array of contact IDs to send to.",
                      "example": [
                        1,
                        2,
                        3
                      ]
                    },
                    "emails": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "email"
                      },
                      "description": "Array of email addresses to send to.",
                      "example": [
                        "user1@example.com",
                        "user2@example.com"
                      ]
                    },
                    "groupIds": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      },
                      "description": "Array of group IDs to send to.",
                      "example": [
                        10,
                        20
                      ]
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Email campaign created successfully.",
            "schema": {
              "$ref": "#/definitions/CreateEmailCampaignResponse"
            }
          },
          "400": {
            "description": "Bad request - validation errors or insufficient balance.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Forbidden - insufficient permissions (requires ComposeEmail access)."
          }
        },
        "tags": [
          "Email Campaigns"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new CreateEmailCampaignInputObject();\n\n// Required parameters\n$input->setEmailSenderId(123);\n$input->setSubject(\"Special Offer - 50% Off Today Only!\");\n$input->setMessage(\"<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>\");\n$input->setRecipients({});\n\n// Optional parameters, you can skip these setters calls\n$input->setFromName(\"John Smith\");\n$input->setReplyToEmail(\"support@example.com\");\n\ntry {\n    // CreateEmailCampaignResponse class object\n    $result = $api->createEmailCampaign($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->createEmailCampaign: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        CreateEmailCampaignInputObject input = new CreateEmailCampaignInputObject();\n\n        // Required parameters\n        input.setEmailSenderId(123);\n        input.setSubject(\"Special Offer - 50% Off Today Only!\");\n        input.setMessage(\"<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>\");\n        input.setRecipients({});\n\n        // Optional parameters, you can skip these setters calls\n        input.setFromName(\"John Smith\");\n        input.setReplyToEmail(\"support@example.com\");\n\n        try {\n            // CreateEmailCampaignResponse class object\n            CreateEmailCampaignResponse obj = apiInstance.createEmailCampaign(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling createEmailCampaign\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    emailSenderId: 123,\n    subject: \"Special Offer - 50% Off Today Only!\",\n    message: \"<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>\",\n    recipients: {},\n    // Optional parameters\n    fromName: \"John Smith\",\n    replyToEmail: \"support@example.com\",\n}\n\n\napi.createEmailCampaign(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::CreateEmailCampaignInputObject.new\n\n# Required parameters\nobj.email_sender_id = 123\nobj.subject = \"Special Offer - 50% Off Today Only!\"\nobj.message = \"<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>\"\nobj.recipients = {}\n# Optional parameters, you can skip them\nobj.from_name = \"John Smith\"\nobj.reply_to_email = \"support@example.com\"\n\nbegin\n    # CreateEmailCampaignResponse object\n    result = api.create_email_campaign(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->create_email_campaign: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new CreateEmailCampaignInputObject();\n\n            // Required parameters\n            obj.EmailSenderId = 123;\n            obj.Subject = \"Special Offer - 50% Off Today Only!\";\n            obj.Message = \"<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>\";\n            obj.Recipients = {};\n\n            // Optional parameters, you can skip these setters calls\n            obj.FromName = \"John Smith\";\n            obj.ReplyToEmail = \"support@example.com\";\n\n            try {\n                // CreateEmailCampaignResponse class object\n                var result = apiInstance.CreateEmailCampaign(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling createEmailCampaign: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New CreateEmailCampaignInputObject With {\n            .EmailSenderId = 123,\n            .Subject = \"Special Offer - 50% Off Today Only!\",\n            .Message = \"<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>\",\n            .FromName = \"John Smith\",\n            .ReplyToEmail = \"support@example.com\",\n            .Recipients = {}\n        }\n\n        Try\n            ' CreateEmailCampaignResponse class object\n            Dim result = apiInstance.CreateEmailCampaign(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling createEmailCampaign: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        EmailSenderId: 123,\n        Subject: \"Special Offer - 50% Off Today Only!\",\n        Message: \"<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>\",\n        Recipients: {},\n        // Optional parameters, you can skip them\n        FromName: \"John Smith\",\n        ReplyToEmail: \"support@example.com\",\n    }\n\n    // tm.CreateEmailCampaignResponse struct\n    result, _, err := client.TextMagicApi.CreateEmailCampaign(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<CreateEmailCampaignInputObject> input(new CreateEmailCampaignInputObject);\n    // Required parameters\n    input->setEmailSenderId(123);\n    input->setSubject(\"Special Offer - 50% Off Today Only!\");\n    input->setMessage(\"<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>\");\n    input->setRecipients({});\n    // Optional parameters, you can skip them\n    input->setFromName(\"John Smith\");\n    input->setReplyToEmail(\"support@example.com\");\n\n    try {\n        pplx::task<std::shared_ptr<CreateEmailCampaignResponse>> result = api.createEmailCampaign(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"createEmailCampaign() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.CreateEmailCampaignInputObject()\n\n# Required parameters\ninput.email_sender_id = 123\ninput.subject = \"Special Offer - 50% Off Today Only!\"\ninput.message = \"<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>\"\ninput.recipients = {}\n# Optional parameters, you can skip them\ninput.from_name = \"John Smith\"\ninput.reply_to_email = \"support@example.com\"\n\ntry:\n    # CreateEmailCampaignResponse object\n    result = api_instance.create_email_campaign(create_email_campaign_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->create_email_campaign: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::CreateEmailCampaignInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::CreateEmailCampaignInputObject->new(\n    # Required parameters\n    emailSenderId => 123,\n    subject => 'Special Offer - 50% Off Today Only!',\n    message => '<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>',\n    recipients => {},\n    # Optional parameters, you can skip them\n    fromName => 'John Smith',\n    replyToEmail => 'support@example.com',\n);\n\neval {\n    # CreateEmailCampaignResponse object\n    my $result = $api_instance->create_email_campaign(create_email_campaign_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->create_email_campaign: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/email-campaigns/schedule": {
      "post": {
        "operationId": "scheduleEmailCampaign",
        "summary": "Schedule new email campaign",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/scheduleEmailCampaign\" target=\"_blank\">Try in sandbox</a><br>Creates a new scheduled email campaign that will be sent at a specified time or according to a recurring schedule.",
        "parameters": [
          {
            "name": "ScheduleEmailCampaignInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "emailSenderId",
                "subject",
                "message",
                "recipients",
                "scheduleParams"
              ],
              "additionalProperties": false,
              "properties": {
                "emailSenderId": {
                  "type": "integer",
                  "description": "Email sender ID from your configured senders.",
                  "example": 123
                },
                "subject": {
                  "type": "string",
                  "maxLength": 998,
                  "description": "Email subject line.",
                  "example": "Weekly Newsletter - Week of December 4th"
                },
                "message": {
                  "type": "string",
                  "description": "HTML email content.",
                  "example": "<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>"
                },
                "fromName": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "Optional custom sender name.",
                  "example": "Newsletter Team",
                  "x-nullable": true
                },
                "replyToEmail": {
                  "type": "string",
                  "format": "email",
                  "description": "Optional custom reply-to email address.",
                  "example": "newsletter@company.com",
                  "x-nullable": true
                },
                "recipients": {
                  "type": "object",
                  "description": "Campaign recipients configuration.",
                  "required": [
                    "contactIds",
                    "emails",
                    "groupIds"
                  ],
                  "properties": {
                    "contactIds": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      },
                      "description": "Array of contact IDs to send to.",
                      "example": [
                        101,
                        102,
                        103
                      ]
                    },
                    "emails": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "email"
                      },
                      "description": "Array of email addresses to send to.",
                      "example": [
                        "user1@example.com",
                        "user2@example.com"
                      ]
                    },
                    "groupIds": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      },
                      "description": "Array of group IDs to send to.",
                      "example": [
                        456,
                        789
                      ]
                    }
                  }
                },
                "scheduleParams": {
                  "type": "object",
                  "description": "Scheduling configuration for the campaign.",
                  "required": [
                    "startDateTime",
                    "timezone"
                  ],
                  "properties": {
                    "startDateTime": {
                      "type": "string",
                      "format": "date-time",
                      "description": "When to start sending the campaign (ISO 8601 format).",
                      "example": "2023-12-04T09:00:00Z"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Timezone for the schedule (e.g., \"America/New_York\").",
                      "example": "America/New_York"
                    },
                    "rrule": {
                      "type": "string",
                      "description": "RFC 5545 recurrence rule for recurring campaigns.",
                      "example": "FREQ=WEEKLY;BYDAY=MO",
                      "x-nullable": true
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Email campaign scheduled successfully.",
            "schema": {
              "$ref": "#/definitions/ScheduleEmailCampaignResponse"
            }
          },
          "400": {
            "description": "Bad request - validation errors, invalid schedule, or insufficient balance.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          },
          "403": {
            "description": "Forbidden - insufficient permissions (requires ComposeEmail access)."
          }
        },
        "tags": [
          "Scheduled Email Campaigns"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new ScheduleEmailCampaignInputObject();\n\n// Required parameters\n$input->setEmailSenderId(123);\n$input->setSubject(\"Weekly Newsletter - Week of December 4th\");\n$input->setMessage(\"<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>\");\n$input->setRecipients({});\n$input->setScheduleParams({});\n\n// Optional parameters, you can skip these setters calls\n$input->setFromName(\"Newsletter Team\");\n$input->setReplyToEmail(\"newsletter@company.com\");\n\ntry {\n    // ScheduleEmailCampaignResponse class object\n    $result = $api->scheduleEmailCampaign($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->scheduleEmailCampaign: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        ScheduleEmailCampaignInputObject input = new ScheduleEmailCampaignInputObject();\n\n        // Required parameters\n        input.setEmailSenderId(123);\n        input.setSubject(\"Weekly Newsletter - Week of December 4th\");\n        input.setMessage(\"<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>\");\n        input.setRecipients({});\n        input.setScheduleParams({});\n\n        // Optional parameters, you can skip these setters calls\n        input.setFromName(\"Newsletter Team\");\n        input.setReplyToEmail(\"newsletter@company.com\");\n\n        try {\n            // ScheduleEmailCampaignResponse class object\n            ScheduleEmailCampaignResponse obj = apiInstance.scheduleEmailCampaign(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling scheduleEmailCampaign\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    emailSenderId: 123,\n    subject: \"Weekly Newsletter - Week of December 4th\",\n    message: \"<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>\",\n    recipients: {},\n    scheduleParams: {},\n    // Optional parameters\n    fromName: \"Newsletter Team\",\n    replyToEmail: \"newsletter@company.com\",\n}\n\n\napi.scheduleEmailCampaign(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::ScheduleEmailCampaignInputObject.new\n\n# Required parameters\nobj.email_sender_id = 123\nobj.subject = \"Weekly Newsletter - Week of December 4th\"\nobj.message = \"<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>\"\nobj.recipients = {}\nobj.schedule_params = {}\n# Optional parameters, you can skip them\nobj.from_name = \"Newsletter Team\"\nobj.reply_to_email = \"newsletter@company.com\"\n\nbegin\n    # ScheduleEmailCampaignResponse object\n    result = api.schedule_email_campaign(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->schedule_email_campaign: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new ScheduleEmailCampaignInputObject();\n\n            // Required parameters\n            obj.EmailSenderId = 123;\n            obj.Subject = \"Weekly Newsletter - Week of December 4th\";\n            obj.Message = \"<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>\";\n            obj.Recipients = {};\n            obj.ScheduleParams = {};\n\n            // Optional parameters, you can skip these setters calls\n            obj.FromName = \"Newsletter Team\";\n            obj.ReplyToEmail = \"newsletter@company.com\";\n\n            try {\n                // ScheduleEmailCampaignResponse class object\n                var result = apiInstance.ScheduleEmailCampaign(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling scheduleEmailCampaign: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New ScheduleEmailCampaignInputObject With {\n            .EmailSenderId = 123,\n            .Subject = \"Weekly Newsletter - Week of December 4th\",\n            .Message = \"<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>\",\n            .FromName = \"Newsletter Team\",\n            .ReplyToEmail = \"newsletter@company.com\",\n            .Recipients = {},\n            .ScheduleParams = {}\n        }\n\n        Try\n            ' ScheduleEmailCampaignResponse class object\n            Dim result = apiInstance.ScheduleEmailCampaign(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling scheduleEmailCampaign: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        EmailSenderId: 123,\n        Subject: \"Weekly Newsletter - Week of December 4th\",\n        Message: \"<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>\",\n        Recipients: {},\n        ScheduleParams: {},\n        // Optional parameters, you can skip them\n        FromName: \"Newsletter Team\",\n        ReplyToEmail: \"newsletter@company.com\",\n    }\n\n    // tm.ScheduleEmailCampaignResponse struct\n    result, _, err := client.TextMagicApi.ScheduleEmailCampaign(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<ScheduleEmailCampaignInputObject> input(new ScheduleEmailCampaignInputObject);\n    // Required parameters\n    input->setEmailSenderId(123);\n    input->setSubject(\"Weekly Newsletter - Week of December 4th\");\n    input->setMessage(\"<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>\");\n    input->setRecipients({});\n    input->setScheduleParams({});\n    // Optional parameters, you can skip them\n    input->setFromName(\"Newsletter Team\");\n    input->setReplyToEmail(\"newsletter@company.com\");\n\n    try {\n        pplx::task<std::shared_ptr<ScheduleEmailCampaignResponse>> result = api.scheduleEmailCampaign(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"scheduleEmailCampaign() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.ScheduleEmailCampaignInputObject()\n\n# Required parameters\ninput.email_sender_id = 123\ninput.subject = \"Weekly Newsletter - Week of December 4th\"\ninput.message = \"<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>\"\ninput.recipients = {}\ninput.schedule_params = {}\n# Optional parameters, you can skip them\ninput.from_name = \"Newsletter Team\"\ninput.reply_to_email = \"newsletter@company.com\"\n\ntry:\n    # ScheduleEmailCampaignResponse object\n    result = api_instance.schedule_email_campaign(schedule_email_campaign_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->schedule_email_campaign: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::ScheduleEmailCampaignInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::ScheduleEmailCampaignInputObject->new(\n    # Required parameters\n    emailSenderId => 123,\n    subject => 'Weekly Newsletter - Week of December 4th',\n    message => '<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>',\n    recipients => {},\n    scheduleParams => {},\n    # Optional parameters, you can skip them\n    fromName => 'Newsletter Team',\n    replyToEmail => 'newsletter@company.com',\n);\n\neval {\n    # ScheduleEmailCampaignResponse object\n    my $result = $api_instance->schedule_email_campaign(schedule_email_campaign_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->schedule_email_campaign: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/email-campaigns/email-senders": {
      "get": {
        "operationId": "getEmailSenders",
        "summary": "Get list of email senders",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/undefined/getEmailSenders\" target=\"_blank\">Try in sandbox</a><br>Retrieves a list of configured email senders available for creating email campaigns.",
        "parameters": [
          {
            "name": "domainId",
            "in": "query",
            "required": false,
            "type": "integer",
            "description": "Filter email senders by specific domain ID."
          }
        ],
        "responses": {
          "200": {
            "description": "Email senders retrieved successfully.",
            "schema": {
              "$ref": "#/definitions/GetEmailSendersResponse"
            }
          },
          "400": {
            "description": "Bad request - invalid query parameters.",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Email campaign senders"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n// Optional, you can pass them as null values to getEmailSenders method below, default values will be used\n$domainId = 1;\n\ntry {\n    // GetEmailSendersResponse class object\n    $result = $api->getEmailSenders($domainId);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->getEmailSenders: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        // Optional, you can pass them as null values to getEmailSenders method below, default values will be used\n        int domainId = 1;\n\n        try {\n            // GetEmailSendersResponse class object\n            GetEmailSendersResponse obj = apiInstance.getEmailSenders(domainId);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling getEmailSenders\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\n\n// Optional parameters\nconst opts = {\n    domainId: 1,\n};\n\napi.getEmailSenders(opts).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nparams = {\n  # Optional parameters\n  domain_id: 1,\n}\n\nbegin\n    # GetEmailSendersResponse object\n    result = api.get_email_senders(params)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->get_email_senders: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            // Optional, you can pass them as null values to getEmailSenders method below, default values will be used\n            int domainId = 1;\n\n            try {\n                // GetEmailSendersResponse class object\n                var result = apiInstance.GetEmailSenders(domainId);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling getEmailSenders: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        ' Optional, you can pass them as null values to getEmailSenders method below, default values will be used\n        Dim domainId As Integer = 1\n\n        Try\n            ' GetEmailSendersResponse class object\n            Dim result = apiInstance.GetEmailSenders(domainId)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling getEmailSenders: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    opts := tm.GetEmailSendersOpts{\n        // Optional parameters\n        DomainId: optional.NewInt32(1),\n    }\n\n    // tm.GetEmailSendersResponse struct\n    result, _, err := client.TextMagicApi.GetEmailSenders(auth, &opts)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    // Optional parameters. Important: if you want to use default value then pass boost::none value\n    int domainId = 1;\n\n    try {\n        pplx::task<std::shared_ptr<GetEmailSendersResponse>> result = api.getEmailSenders(domainId);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"getEmailSenders() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\n# Optional params, you can skip them\ndomain_id = 1\n\ntry:\n    # GetEmailSendersResponse object\n    result = api_instance.get_email_senders(domain_id=domain_id)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->get_email_senders: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\n# Optional params, you can skip them\nmy $domainId = 1;\n\neval {\n    # GetEmailSendersResponse object\n    my $result = $api_instance->get_email_senders(domainId => $domainId);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->get_email_senders: $@\\n\";\n}"
          }
        ]
      }
    },
    "/api/v2/tags": {
      "post": {
        "operationId": "createTag",
        "summary": "Create tag",
        "description": "<a class=\"try-sandbox-link\" href=\"https://sandbox.textmagic.com/#/Tags/createTag\" target=\"_blank\">Try in sandbox</a><br>Creates a new tag for organizing and categorizing contacts.\n\nThis endpoint allows you to create a custom tag that can be used to segment and organize your contact database. Tags provide a flexible way to categorize contacts for better contact management.\n\n## Request Requirements\n\n- **Title**: Required field, must be between 1 and 50 characters\n- **Uniqueness**: Tag titles must be unique within your account\n- **Authentication**: Valid API credentials required\n\n## Common Use Cases\n\nCreate tags for various organizational purposes:\n\n- **Customer Types**: \"VIP Customer\", \"New Lead\", \"Active Subscriber\"\n- **Geographic Segments**: \"North Region\", \"Europe\", \"Local Customers\"\n- **Engagement Levels**: \"Highly Engaged\", \"Inactive\", \"Recent Purchase\"\n- **Campaign Categories**: \"Summer Promotion\", \"Newsletter Subscriber\", \"Event Attendee\"\n- **Custom Segments**: Any custom categorization that fits your business needs\n\n## Response Information\n\nSuccessful tag creation returns:\n- **Tag ID**: Unique identifier for the newly created tag\n- **Title**: The tag name as provided in the request\n\nUse the returned tag ID to assign this tag to contacts or reference it in other API operations.\n\n## Error Scenarios\n\nCommon error conditions include:\n- **Validation Errors**: Title exceeds 50 characters or is empty\n- **Duplicate Tag**: A tag with the same title already exists in your account\n- **Authentication Errors**: Invalid or missing API credentials\n\n## Next Steps\n\nAfter creating a tag:\n1. Use the tag ID to assign it to contacts via contact management endpoints\n2. Reference the tag when filtering contacts\n3. Manage and update tags through other Tags API endpoints\n",
        "parameters": [
          {
            "name": "CreateTagInputObject",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "title"
              ],
              "additionalProperties": false,
              "properties": {
                "title": {
                  "type": "string",
                  "maxLength": 50,
                  "description": "Tag title.",
                  "example": "Favorites"
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Tag created successfully.",
            "schema": {
              "$ref": "#/definitions/CreateTagResponse"
            }
          },
          "400": {
            "description": "Bad request - validation errors (e.g. invalid title format or tag already exists).",
            "schema": {
              "$ref": "#/definitions/BadRequestResponse"
            }
          },
          "401": {
            "description": "Unauthorized request.",
            "schema": {
              "$ref": "#/definitions/UnauthorizedResponse"
            }
          }
        },
        "tags": [
          "Tags"
        ],
        "x-code-samples": [
          {
            "lang": "PHP",
            "source": "<?php\n// How to install SDK: https://docs.textmagic.com/#section/PHP\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\nuse TextMagic\\Models{{inputObjectName}};\nuse TextMagic\\Api\\TextMagicApi;\nuse TextMagic\\Configuration;\nuse GuzzleHttp\\Client;\n\n// Get your Username and API Key from: https://app.textmagic.com/settings/api\n$config = Configuration::getDefaultConfiguration()\n    ->setUsername('YOUR_USERNAME')\n    ->setPassword('YOUR_API_KEY');\n\n$api = new TextMagicApi(new Client(), $config);\n\n$input = new CreateTagInputObject();\n\n// Required parameters\n$input->setTitle(\"Favorites\");\n\ntry {\n    // CreateTagResponse class object\n    $result = $api->createTag($input);\n\n    // Process the result\n    print_r($result);\n} catch (\\TextMagic\\ApiException $e) {\n    echo 'API Exception: ' . $e->getMessage() . PHP_EOL;\n    echo 'HTTP Code: ' . $e->getCode() . PHP_EOL;\n} catch (\\Exception $e) {\n    echo 'Exception when calling TextMagicApi->createTag: ', $e->getMessage(), PHP_EOL;\n}\n"
          },
          {
            "lang": "Java",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Java\nimport com.textmagic.sdk.*;\nimport com.textmagic.sdk.api.TextMagicApi;\nimport com.textmagic.sdk.auth.*;\nimport com.textmagic.sdk.model.*;\n\npublic class App {\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n\n        // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication(\"BasicAuth\");\n        BasicAuth.setUsername(\"YOUR_USERNAME\");\n        BasicAuth.setPassword(\"YOUR_API_KEY\");\n\n        TextMagicApi apiInstance = new TextMagicApi();\n\n        CreateTagInputObject input = new CreateTagInputObject();\n\n        // Required parameters\n        input.setTitle(\"Favorites\");\n\n        try {\n            // CreateTagResponse class object\n            CreateTagResponse obj = apiInstance.createTag(input);\n            // ...\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling createTag\");\n            e.printStackTrace();\n        }\n    }\n}"
          },
          {
            "lang": "JavaScript",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Node.js\nconst textmagicClient = require('textmagic-client');\n\nconst client = textmagicClient.ApiClient.instance;\nconst auth = client.authentications['BasicAuth'];\nconst api = new textmagicClient.TextMagicApi();\n\n// put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nauth.username = 'YOUR_USERNAME';\nauth.password = 'YOUR_API_KEY';\n\nconst input = {\n    title: \"Favorites\",\n}\n\n\napi.createTag(input).then(function (data) {\n    console.log(data);\n}).catch(function(err){\n    console.error(err);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Ruby\nrequire 'textmagic_rest_client'\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nTextMagic.configure do |config|\n    config.username = 'YOUR_USERNAME'\n    config.password = 'YOUR_API_KEY'\nend\n\napi = TextMagic::TextMagicApi.new\n\nobj = new TextMagic::CreateTagInputObject.new\n\n# Required parameters\nobj.title = \"Favorites\"\n\nbegin\n    # CreateTagResponse object\n    result = api.create_tag(input)\n    # ...\nrescue TextMagic::ApiError => e\n    puts \"Exception when calling TextMagicApi->create_tag: #{e}\"\nend"
          },
          {
            "lang": "C#",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nusing System;\nusing System.IO;\nusing TextMagicClient.Api;\nusing TextMagicClient.Client;\nusing TextMagicClient.Model;\n\nnamespace ExampleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n            Configuration.Default.Username = \"YOUR_USERNAME\";\n            Configuration.Default.Password = \"YOUR_API_KEY\";\n\n            var apiInstance = new TextMagicApi();\n\n            var obj = new CreateTagInputObject();\n\n            // Required parameters\n            obj.Title = \"Favorites\";\n\n            try {\n                // CreateTagResponse class object\n                var result = apiInstance.CreateTag(obj);\n                // ...\n            } catch (Exception e) {\n                Console.WriteLine(\"Exception when calling createTag: \"+e.Message);\n            }\n        }\n    }\n}"
          },
          {
            "lang": "VB.Net",
            "source": "' How to install SDK see here https://docs.textmagic.com/#section/C-VB.NET\nImports System\nImports System.IO\nImports TextMagicClient.Api\nImports TextMagicClient.Client\nImports TextMagicClient.Model\n\nModule Program\n    Sub Main(args As String())\n        ' put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n        Configuration.Default.Username = \"YOUR_USERNAME\"\n        Configuration.Default.Password = \"YOUR_API_KEY\"\n\n        Dim apiInstance = New TextMagicApi()\n\n        Dim obj = New CreateTagInputObject With {\n            .Title = \"Favorites\"\n        }\n\n        Try\n            ' CreateTagResponse class object\n            Dim result = apiInstance.CreateTag(obj)\n            ' ...\n        Catch e As Exception\n            Console.WriteLine(\"Exception when calling createTag: \" + e.Message)\n        End Try\n    End Sub\nEnd Module"
          },
          {
            "lang": "Go",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/antihax/optional\"\n    // If you're using go.mod use line below to import our module\n    // \ttm \"github.com/imissyouso/textmagic-rest-go/v2\"\n    tm \"github.com/imissyouso/textmagic-rest-go\"\n    \"log\"\n)\n\nfunc main() {\n    cfg := tm.NewConfiguration()\n    client := tm.NewAPIClient(cfg)\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    auth := context.WithValue(context.Background(), tm.ContextBasicAuth, tm.BasicAuth{\n        UserName: \"YOUR_USERNAME\",\n        Password: \"YOUR_API_KEY\",\n    })\n\n    input := tm.SendMessageInputObject{\n        // Required parameters\n        Title: \"Favorites\",\n    }\n\n    // tm.CreateTagResponse struct\n    result, _, err := client.TextMagicApi.CreateTag(auth, input)\n\n    if err != nil {\n        log.Fatal(err)\n    } else {\n        fmt.Printf(\"%+v\\n\", result)\n        // ...\n    }\n}\n"
          },
          {
            "lang": "Cpp",
            "source": "// How to install SDK see here https://docs.textmagic.com/#section/C++\n#include <iostream>\n#include <fstream>\n// Change paths to directory where SDK lib is installed. See C++ SDK installation instructions for more details\n#include \"textmagic-rest-cpp/ApiClient.h\"\n#include \"textmagic-rest-cpp/ApiConfiguration.h\"\n#include \"textmagic-rest-cpp/api/TextMagicApi.h\"\n\nusing namespace com::textmagic::client::api;\n\nint main() {\n    std::shared_ptr<ApiClient> apiClient(new ApiClient);\n    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration);\n\n    // put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\n    apiConfig->getHttpConfig().set_credentials(web::credentials(\"YOUR_NAME\", \"YOUR_API_KEY\"));\n    apiClient->setConfiguration(apiConfig);\n\n    TextMagicApi api(apiClient);\n\n    std::shared_ptr<CreateTagInputObject> input(new CreateTagInputObject);\n    // Required parameters\n    input->setTitle(\"Favorites\");\n\n    try {\n        pplx::task<std::shared_ptr<CreateTagResponse>> result = api.createTag(input);\n        result.wait();\n        // put operations with result here...\n    } catch(const std::exception& e) {\n        std::cout << \"createTag() exception: \" << e.what() << '\\n';\n    }\n\n    return 0;\n}"
          },
          {
            "lang": "Python",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Python\nimport TextMagic\nfrom TextMagic.rest import ApiException\n\nconfiguration = TextMagic.Configuration()\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nconfiguration.username = \"YOUR_USERNAME\"\nconfiguration.password = \"YOUR_API_KEY\"\n\n# create an instance of the API class\napi_instance = TextMagic.TextMagicApi(TextMagic.ApiClient(configuration))\n\ninput = TextMagic.CreateTagInputObject()\n\n# Required parameters\ninput.title = \"Favorites\"\n\ntry:\n    # CreateTagResponse object\n    result = api_instance.create_tag(create_tag_input_object=input)\n    # ...\nexcept ApiException as e:\n    print(\"Exception when calling TextMagicApi->create_tag: %s\\n\" % e)\n"
          },
          {
            "lang": "Perl",
            "source": "# How to install SDK see here https://docs.textmagic.com/#section/Perl\nuse 5.010;\nuse strict;\nuse warnings;\nuse Net::Sms::TextMagicClient::ApiClient;\nuse Net::Sms::TextMagicClient::TextMagicApi;\nuse Net::Sms::TextMagicClient::Object::CreateTagInputObject;\n\n# put your Username and API Key from https://my.textmagic.com/online/api/rest-api/keys page.\nmy $client = Net::Sms::TextMagicClient::ApiClient::->new(\n    username   => 'YOUR_USERNAME',\n    password   => 'YOUR_API_KEY'\n);\n\nmy $api_instance = Net::Sms::TextMagicClient::TextMagicApi::->new($client);\n\nmy $input = Net::Sms::TextMagicClient::Object::CreateTagInputObject->new(\n    # Required parameters\n    title => 'Favorites',\n);\n\neval {\n    # CreateTagResponse object\n    my $result = $api_instance->create_tag(create_tag_input_object => $input);\n    # ...\n};\n\nif ($@) {\n    warn \"Exception when calling TextMagicApi->create_tag: $@\\n\";\n}"
          }
        ]
      }
    }
  },
  "definitions": {
    "ResourceLinkResponse": {
      "description": "Response contains paginated list of data items.",
      "required": [
        "id",
        "href"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 515,
          "description": "Resource ID."
        },
        "href": {
          "type": "string",
          "example": "/api/v2/entity_name/1",
          "description": "A link to this resource. If you want to fetch it, just **GET** this address."
        }
      }
    },
    "NotFoundResponse": {
      "description": "Returned when requested entity was not found.",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32",
          "example": 404,
          "description": "Error code. Meanings of error codes are similar to [HTTP response codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)."
        },
        "message": {
          "type": "string",
          "example": "Resource does not exist.",
          "description": "A Brief error message. You could display this message to your user or save it in a log."
        }
      }
    },
    "UnauthorizedResponse": {
      "description": "Returned when request has been denied in reason of access problems.",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32",
          "example": 401,
          "description": "Error code. Meanings of error codes are similar to [HTTP response codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)."
        },
        "message": {
          "type": "string",
          "example": "Wrong username and token combination.",
          "description": "Brief error message. You could display this message to your user or save it in a log."
        }
      }
    },
    "BadRequestResponse": {
      "description": "Returned when input data validation process has been failed.",
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32",
          "example": 400,
          "description": "Error code. Meanings of error codes are similar to [HTTP response codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)."
        },
        "message": {
          "type": "string",
          "example": "Resource does not exist",
          "description": "Brief error message. You could display this message to your user or save it in a log."
        },
        "errors": {
          "x-nullable": true,
          "type": "object",
          "description": "If it was a **POST** or **PUT** request (and the **message** returned is `Validation Failed`), this field may contain **errors** that describe the errors grouped by the input parameter name.\n",
          "properties": {
            "common": {
              "type": "array",
              "description": "Array of messages with errors related to the entire request. For example, you did not specify either the **text** or the **templateId** when [sending the message](https://docs.textmagic.com/#tag/Outbound-Messages).\n",
              "items": {
                "type": "string"
              },
              "example": [
                "Common error message 1",
                "Common error message 2"
              ]
            },
            "fields": {
              "type": "object",
              "description": "Associative array. The keys are the POST/PUT parameter names and the values are arrays with error messages for these parameters.\n",
              "example": {
                "fieldName1": [
                  "Error message 1",
                  "Error message 2"
                ],
                "fieldName2": [
                  "Error message 3",
                  "Error message 4"
                ]
              }
            }
          }
        }
      }
    },
    "SendPhoneVerificationCodeResponse": {
      "type": "object",
      "required": [
        "verifyId",
        "price"
      ],
      "properties": {
        "verifyId": {
          "example": "123e4567-e89b-12d3-a456-426655440000",
          "type": "string",
          "description": "The ID of a verification request. This is required to finish the verification request in the next step."
        },
        "price": {
          "example": 0.05,
          "type": "number",
          "description": "An amount of credit which will be deducted from your account balance when this verification is successfully completed."
        }
      }
    },
    "CreateEmailCampaignResponse": {
      "type": "object",
      "required": [
        "id",
        "status",
        "startAt",
        "createdBy",
        "fromEmail",
        "replyToEmail",
        "subject",
        "html",
        "cost",
        "totals"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "example": 12345,
          "description": "Unique campaign ID."
        },
        "status": {
          "type": "string",
          "enum": [
            "idle",
            "sent",
            "in_progress",
            "failed",
            "delivered",
            "rejected",
            "error",
            "scheduledError"
          ],
          "example": "in_progress",
          "description": "Current campaign status."
        },
        "emailSenderId": {
          "type": "integer",
          "example": 123,
          "description": "Email sender ID used for this campaign.",
          "x-nullable": true
        },
        "startAt": {
          "type": "string",
          "format": "date-time",
          "example": "2023-12-01T10:00:00Z",
          "description": "Campaign start timestamp."
        },
        "createdBy": {
          "$ref": "#/definitions/UserPersonalInfo"
        },
        "fromName": {
          "type": "string",
          "example": "John Smith",
          "description": "Sender name displayed in recipient's inbox.",
          "x-nullable": true
        },
        "fromEmail": {
          "type": "string",
          "format": "email",
          "example": "noreply@example.com",
          "description": "Sender email address."
        },
        "replyToEmail": {
          "type": "string",
          "format": "email",
          "example": "support@example.com",
          "description": "Reply-to email address."
        },
        "subject": {
          "type": "string",
          "example": "Special Offer - 50% Off Today Only!",
          "description": "Email subject line."
        },
        "html": {
          "type": "string",
          "example": "<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>",
          "description": "HTML email content."
        },
        "cost": {
          "type": "number",
          "format": "float",
          "example": 15.75,
          "description": "Total campaign cost."
        },
        "totals": {
          "$ref": "#/definitions/EmailCampaignStatisticTotals"
        },
        "outboundEmail": {
          "$ref": "#/definitions/OutboundEmailResponse",
          "x-nullable": true
        },
        "failedReason": {
          "type": "string",
          "enum": [
            "lowBalance",
            "noRecipients",
            "noEmailSender",
            "unhandled"
          ],
          "example": "lowBalance",
          "description": "Reason for campaign failure if applicable.",
          "x-nullable": true
        }
      }
    },
    "ScheduleEmailCampaignResponse": {
      "type": "object",
      "required": [
        "campaign",
        "cost"
      ],
      "properties": {
        "campaign": {
          "$ref": "#/definitions/ScheduledEmailCampaignDetails"
        },
        "cost": {
          "type": "number",
          "format": "float",
          "example": 12.5,
          "description": "Estimated cost for sending this campaign."
        }
      }
    },
    "ScheduledEmailCampaignDetails": {
      "type": "object",
      "required": [
        "id",
        "status",
        "startAt",
        "createdBy",
        "createdAt",
        "updatedAt",
        "type",
        "fromEmail",
        "replyToEmail",
        "subject",
        "html",
        "recipientsCount",
        "sendingTimezone"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "example": 12345,
          "description": "Unique scheduled campaign ID."
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "active",
            "paused",
            "completed",
            "cancelled",
            "failed"
          ],
          "example": "scheduled",
          "description": "Current scheduled campaign status."
        },
        "emailSenderId": {
          "type": "integer",
          "example": 123,
          "description": "Email sender ID used for this campaign.",
          "x-nullable": true
        },
        "startAt": {
          "type": "string",
          "format": "date-time",
          "example": "2023-12-04T14:00:00Z",
          "description": "Scheduled start timestamp (UTC)."
        },
        "endAt": {
          "type": "string",
          "format": "date-time",
          "example": "2024-12-04T14:00:00Z",
          "description": "End timestamp for recurring campaigns (UTC).",
          "x-nullable": true
        },
        "nextSendAt": {
          "type": "string",
          "format": "date-time",
          "example": "2023-12-04T14:00:00Z",
          "description": "Next scheduled send timestamp (UTC).",
          "x-nullable": true
        },
        "createdBy": {
          "$ref": "#/definitions/UserPersonalInfo"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "example": "2023-12-01T10:30:00Z",
          "description": "Campaign creation timestamp."
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "example": "2023-12-01T10:30:00Z",
          "description": "Last update timestamp."
        },
        "type": {
          "type": "string",
          "enum": [
            "once",
            "hourly",
            "daily",
            "weekly",
            "monthly",
            "yearly",
            "follow-up"
          ],
          "example": "weekly",
          "description": "Campaign recurrence type."
        },
        "fromName": {
          "type": "string",
          "example": "Newsletter Team",
          "description": "Sender name displayed in recipient's inbox.",
          "x-nullable": true
        },
        "fromEmail": {
          "type": "string",
          "format": "email",
          "example": "noreply@company.com",
          "description": "Sender email address."
        },
        "replyToEmail": {
          "type": "string",
          "format": "email",
          "example": "newsletter@company.com",
          "description": "Reply-to email address."
        },
        "subject": {
          "type": "string",
          "example": "Weekly Newsletter - Week of December 4th",
          "description": "Email subject line."
        },
        "html": {
          "type": "string",
          "example": "<html><body><h1>This Week's Updates</h1><p>Here are the latest news and updates...</p></body></html>",
          "description": "HTML email content."
        },
        "recipientsCount": {
          "type": "integer",
          "example": 1250,
          "description": "Number of recipients for this campaign."
        },
        "sendingTimezone": {
          "type": "string",
          "example": "America/New_York",
          "description": "Timezone for sending the campaign."
        },
        "rrule": {
          "type": "string",
          "example": "FREQ=WEEKLY;BYDAY=MO",
          "description": "RFC 5545 recurrence rule for recurring campaigns.",
          "x-nullable": true
        },
        "occurrenceSummary": {
          "type": "string",
          "example": "Weekly on Monday",
          "description": "Human-readable schedule description.",
          "x-nullable": true
        }
      }
    },
    "GetEmailSendersResponse": {
      "type": "object",
      "required": [
        "items"
      ],
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EmailSenderItem"
          },
          "description": "Array of email sender objects."
        }
      }
    },
    "EmailSenderItem": {
      "type": "object",
      "required": [
        "id",
        "domainId",
        "email",
        "createdAt",
        "domainStatus"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "example": 456,
          "description": "Unique email sender identifier."
        },
        "domainId": {
          "type": "integer",
          "example": 123,
          "description": "ID of the associated domain."
        },
        "email": {
          "type": "string",
          "format": "email",
          "example": "noreply@company.com",
          "description": "Email address of the sender."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "example": "2023-12-01T10:00:00Z",
          "description": "When the email sender was created."
        },
        "domainStatus": {
          "type": "string",
          "enum": [
            "not_verified",
            "pending",
            "manual_review",
            "rejected",
            "verified"
          ],
          "example": "verified",
          "description": "Current verification status of the associated domain."
        },
        "fromName": {
          "type": "string",
          "example": "Company Newsletter",
          "description": "Display name for the sender.",
          "x-nullable": true
        },
        "replyTo": {
          "type": "string",
          "format": "email",
          "example": "support@company.com",
          "description": "Reply-to email address.",
          "x-nullable": true
        }
      }
    },
    "UserPersonalInfo": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "example": 456,
          "description": "User ID."
        },
        "firstName": {
          "type": "string",
          "example": "John",
          "description": "User's first name.",
          "x-nullable": true
        },
        "lastName": {
          "type": "string",
          "example": "Smith",
          "description": "User's last name.",
          "x-nullable": true
        },
        "avatarUrl": {
          "type": "string",
          "example": "https://example.com/avatar.jpg",
          "description": "URL to user's avatar image.",
          "x-nullable": true
        },
        "email": {
          "type": "string",
          "format": "email",
          "example": "john.smith@example.com",
          "description": "User's email address.",
          "x-nullable": true
        }
      }
    },
    "NullableUserPersonalInfo": {
      "type": "object",
      "x-nullable": true,
      "properties": {
        "id": {
          "type": "integer",
          "example": 456,
          "description": "User ID."
        },
        "firstName": {
          "type": "string",
          "example": "John",
          "description": "User's first name.",
          "x-nullable": true
        },
        "lastName": {
          "type": "string",
          "example": "Smith",
          "description": "User's last name.",
          "x-nullable": true
        },
        "avatarUrl": {
          "type": "string",
          "example": "https://example.com/avatar.jpg",
          "description": "URL to user's avatar image.",
          "x-nullable": true
        },
        "email": {
          "type": "string",
          "format": "email",
          "example": "john.smith@example.com",
          "description": "User's email address.",
          "x-nullable": true
        }
      }
    },
    "EmailCampaignStatisticTotals": {
      "type": "object",
      "required": [
        "recipients",
        "delivered",
        "rejected",
        "failed",
        "opened",
        "clicked",
        "spamReports",
        "unsubscribed"
      ],
      "properties": {
        "recipients": {
          "type": "integer",
          "example": 1250,
          "description": "Total number of recipients."
        },
        "delivered": {
          "type": "integer",
          "example": 1180,
          "description": "Number of emails delivered."
        },
        "rejected": {
          "type": "integer",
          "example": 20,
          "description": "Number of emails rejected."
        },
        "failed": {
          "type": "integer",
          "example": 50,
          "description": "Number of emails failed to send."
        },
        "opened": {
          "type": "integer",
          "example": 590,
          "description": "Number of emails opened."
        },
        "clicked": {
          "type": "integer",
          "example": 118,
          "description": "Number of emails with clicks."
        },
        "spamReports": {
          "type": "integer",
          "example": 2,
          "description": "Number of spam reports."
        },
        "unsubscribed": {
          "type": "integer",
          "example": 5,
          "description": "Number of unsubscribes."
        }
      }
    },
    "OutboundEmailResponse": {
      "type": "object",
      "required": [
        "id",
        "sendTime",
        "fromEmail",
        "replyToEmail",
        "emailSubject",
        "emailContent",
        "source",
        "status",
        "cost",
        "initiatorId"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "example": 78901,
          "description": "Outbound email ID."
        },
        "sendTime": {
          "type": "string",
          "format": "date-time",
          "example": "2023-12-01T10:05:00Z",
          "description": "Email send timestamp."
        },
        "fromName": {
          "type": "string",
          "example": "John Smith",
          "description": "Sender name.",
          "x-nullable": true
        },
        "fromEmail": {
          "type": "string",
          "format": "email",
          "example": "noreply@example.com",
          "description": "Sender email address."
        },
        "replyToEmail": {
          "type": "string",
          "format": "email",
          "example": "support@example.com",
          "description": "Reply-to email address."
        },
        "recipientFullName": {
          "type": "string",
          "example": "Jane Doe",
          "description": "Recipient's full name.",
          "x-nullable": true
        },
        "recipientEmail": {
          "type": "string",
          "format": "email",
          "example": "jane.doe@example.com",
          "description": "Recipient's email address.",
          "x-nullable": true
        },
        "emailSubject": {
          "type": "string",
          "example": "Special Offer - 50% Off Today Only!",
          "description": "Email subject line."
        },
        "emailContent": {
          "type": "string",
          "example": "<html><body><h1>Special Offer!</h1><p>Get 50% off all products today only!</p></body></html>",
          "description": "HTML email content."
        },
        "source": {
          "type": "string",
          "enum": [
            "emailCampaign",
            "ticket"
          ],
          "example": "emailCampaign",
          "description": "Source of the outbound email."
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "sent",
            "delivered",
            "rejected",
            "failed",
            "opened",
            "clicked",
            "unsubscribed",
            "spam"
          ],
          "example": "delivered",
          "description": "Current email status."
        },
        "cost": {
          "type": "number",
          "format": "float",
          "example": 0.012,
          "description": "Cost of sending this email."
        },
        "statusReason": {
          "type": "string",
          "example": "Successfully delivered",
          "description": "Detailed status reason.",
          "x-nullable": true
        },
        "contactId": {
          "type": "integer",
          "example": 123,
          "description": "Associated contact ID.",
          "x-nullable": true
        },
        "initiatorId": {
          "type": "integer",
          "example": 456,
          "description": "ID of user who initiated the email."
        }
      }
    },
    "PingResponse": {
      "type": "object",
      "required": [
        "userId",
        "ping",
        "utcDateTime"
      ],
      "additionalProperties": false,
      "properties": {
        "userId": {
          "type": "integer",
          "example": 123,
          "description": "Current user Id."
        },
        "ping": {
          "type": "string",
          "example": "pong",
          "description": "Pong."
        },
        "utcDateTime": {
          "type": "string",
          "example": "2019-01-01T00:00:00.000Z",
          "description": "Current date and time."
        }
      }
    },
    "GetContactImportSessionProgressResponse": {
      "required": [
        "status",
        "processed"
      ],
      "additionalProperties": false,
      "properties": {
        "status": {
          "type": "integer",
          "enum": [
            1,
            3,
            4,
            5
          ],
          "description": "Session status:\n* **1** - if session has been initialized but not yet started;\n* **3** - if session is being processed;\n* **4** - if session has errors;\n* **5** - if session completed successfully.\n"
        },
        "processed": {
          "type": "integer",
          "example": 67,
          "description": "How many contacts have been imported?"
        }
      }
    },
    "GetAvailableSenderSettingOptionsResponse": {
      "type": "object",
      "required": [
        "dedicated",
        "user",
        "shared",
        "senderIds",
        "userCarrierTwilio",
        "userCarrierVonage",
        "userCarrierSinch"
      ],
      "additionalProperties": false,
      "properties": {
        "dedicated": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            447860021136,
            447860021137
          ],
          "description": "Array of dedicated number strings."
        },
        "user": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            447860021134,
            447860021135
          ],
          "description": "Array of verified account phone numbers (currently only one)."
        },
        "shared": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            447860021130,
            447860021131
          ],
          "description": "Array of shared number strings."
        },
        "senderIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            447860021132,
            447860021133
          ],
          "description": "Array of alphanumeric sender IDs."
        },
        "userCarrierTwilio": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            447860021136,
            447860021137
          ],
          "description": "Array of alphanumeric sender IDs."
        },
        "userCarrierVonage": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            447860021138,
            447860021139
          ],
          "description": "Array of alphanumeric sender IDs."
        },
        "userCarrierSinch": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            447860021140,
            447860021141
          ],
          "description": "Array of alphanumeric sender IDs."
        },
        "uCarrierBandwidth": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            447860021142,
            447860021143
          ],
          "description": "Array of alphanumeric sender IDs."
        },
        "ucTwilioSenderId": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            "TestSender1",
            "TestSender2"
          ],
          "description": "Array of alphanumeric sender IDs."
        }
      }
    },
    "GetVersionsResponse": {
      "type": "object",
      "required": [
        "ios",
        "android",
        "desktop"
      ],
      "additionalProperties": false,
      "properties": {
        "ios": {
          "type": "string",
          "example": 1
        },
        "android": {
          "type": "string",
          "example": 2
        },
        "desktop": {
          "type": "string",
          "example": 3
        }
      }
    },
    "DoAuthResponse": {
      "additionalProperties": false,
      "required": [
        "username",
        "token",
        "expires",
        "minVersions",
        "disallowedRules"
      ],
      "properties": {
        "username": {
          "type": "string",
          "example": "test"
        },
        "token": {
          "type": "string",
          "example": "fPTUUKQ4Dvaq9l9ZQQgsLO1HfSR0K4"
        },
        "expires": {
          "type": "string",
          "x-nullable": true,
          "format": "date-time"
        },
        "minVersions": {
          "type": "object",
          "required": [
            "ios",
            "android",
            "desktop"
          ],
          "properties": {
            "ios": {
              "type": "string",
              "example": 0
            },
            "android": {
              "type": "string",
              "example": 0
            },
            "desktop": {
              "type": "string",
              "example": 0
            }
          }
        },
        "disallowedRules": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            "SEND_MESSAGES",
            "MAKE_CALLS",
            "EMAIL_LOOKUP"
          ]
        }
      }
    },
    "GetCallbackSettingsResponse": {
      "required": [
        "outUrl",
        "inUrl",
        "format"
      ],
      "properties": {
        "outUrl": {
          "type": "string",
          "description": "This URL is used to push message delivery status updates to your application.",
          "example": "http://www.mysite.com/delivery-callback.php",
          "x-nullable": true
        },
        "inUrl": {
          "type": "string",
          "description": "This URL is used to push incoming SMS to your application.",
          "example": "http://www.mysite.com/incoming-sms-callback.php",
          "x-nullable": true
        },
        "format": {
          "type": "string",
          "enum": [
            "m",
            "u",
            "j"
          ],
          "description": "Desired callback data format. m - multipart/form-data, u - application/x-www-form-urlencoded, j - application/json."
        }
      }
    },
    "GetInboundMessagesNotificationSettingsResponse": {
      "required": [
        "inboundMessageNotification",
        "forwardedCallNotification",
        "includeSmsHistory",
        "sendInHtmlFormat",
        "alertEmail1",
        "alertEmail2",
        "alertEmail3"
      ],
      "additionalProperties": false,
      "properties": {
        "inboundMessageNotification": {
          "description": "Should user receive notification about new incoming messages.",
          "type": "boolean",
          "example": true
        },
        "forwardedCallNotification": {
          "description": "Should user receive notification about new forwarded calls.",
          "type": "boolean",
          "example": true
        },
        "includeSmsHistory": {
          "description": "Include SMS history into notification Email.",
          "type": "boolean",
          "example": true
        },
        "sendInHtmlFormat": {
          "description": "Send Email notification in HTML format.",
          "type": "boolean",
          "example": true
        },
        "alertEmail1": {
          "description": "New message notification email 1.",
          "type": "string",
          "example": "test@test.com"
        },
        "alertEmail2": {
          "description": "New message notification email 2.",
          "type": "string",
          "example": "test@test.com"
        },
        "alertEmail3": {
          "description": "New message notification email 3.",
          "type": "string",
          "example": "test@test.com"
        }
      }
    },
    "DoCarrierLookupResponse": {
      "additionalProperties": false,
      "required": [
        "cost",
        "local",
        "type",
        "carrier",
        "number164",
        "valid"
      ],
      "properties": {
        "cost": {
          "type": "number",
          "example": 0.04,
          "description": "The cost to check that one number is constant – 0.04 in your account currency."
        },
        "country": {
          "$ref": "#/definitions/Country",
          "description": "Phone number country."
        },
        "local": {
          "type": "string",
          "example": "07860",
          "description": "Phone number in [National format](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers)."
        },
        "type": {
          "type": "string",
          "example": "mobile",
          "description": "Phone number type.",
          "enum": [
            "mobile",
            "landline",
            "voip"
          ]
        },
        "carrier": {
          "type": "string",
          "example": "Telefonica UK",
          "description": "Carrier name."
        },
        "number164": {
          "type": "string",
          "example": "447860021130",
          "description": "Phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164)."
        },
        "valid": {
          "type": "boolean",
          "description": "This field shows whether the entered phone number is valid or not.",
          "example": true
        }
      },
      "type": "object"
    },
    "UpdateCurrentUserResponse": {
      "properties": {
        "username": {
          "type": "string",
          "example": "charles.conway",
          "description": "Username."
        },
        "firstName": {
          "type": "string",
          "example": "Charles",
          "description": "Account first name."
        },
        "lastName": {
          "type": "string",
          "example": "Conway",
          "description": "Account last name."
        },
        "email": {
          "type": "string",
          "example": "charles@example.com",
          "description": "User email address."
        },
        "phone": {
          "type": "string",
          "example": "447860021130",
          "x-nullable": true
        },
        "company": {
          "type": "string",
          "example": "Example Ltd.",
          "x-nullable": true,
          "description": "Account company name."
        },
        "timezone": {
          "type": "integer",
          "description": "Internal timezone ID. See [Get timezones](https://docs.textmagic.com/#operation/getTimezones).",
          "example": 13
        }
      }
    },
    "GetContactsAutocompleteResponseItem": {
      "required": [
        "entityId",
        "entityType",
        "value",
        "label",
        "sharedBy",
        "isShared",
        "avatar",
        "favorited",
        "userId",
        "countryName",
        "qposition",
        "rposition"
      ],
      "additionalProperties": false,
      "properties": {
        "entityId": {
          "type": "integer",
          "example": 362,
          "description": "Id of entity. 0 if object is a reply."
        },
        "entityType": {
          "type": "string",
          "example": "contact",
          "description": "Entry type:\n* **contact** if it is related to a contact;\n* **list** if it is related to a contact list;\n* **reply** if it is related to an incoming message.\n",
          "enum": [
            "reply",
            "contact",
            "list"
          ]
        },
        "value": {
          "type": "string",
          "example": 22,
          "description": "ID of the contact/list if entityType is contact/list OR phone number if entityType is reply."
        },
        "label": {
          "type": "string",
          "example": "Homer Simpson",
          "description": "Name of the contact/list if entityType is contact/list OR phone number if entityType is reply."
        },
        "sharedBy": {
          "type": "string",
          "example": "John Doe",
          "description": "If contact or list was shared by another sub-account, the name of this user will be shown."
        },
        "isShared": {
          "type": "boolean",
          "example": true,
          "description": "If contact or list was shared by another sub-account then `true` will be set."
        },
        "avatar": {
          "type": "string",
          "example": "avatars/dummy_avatar.png",
          "x-nullable": true,
          "description": "Contact avatar URI."
        },
        "favorited": {
          "type": "boolean",
          "description": "If contact has been marked as favorite.",
          "example": true
        },
        "userId": {
          "type": "integer",
          "example": 33,
          "description": "Owner ID of the contact/list (if it was shared)."
        },
        "countryName": {
          "type": "string",
          "example": "Australia"
        },
        "qposition": {
          "type": "integer",
          "example": "Internal field, used for sorting purposes."
        },
        "rposition": {
          "type": "integer",
          "example": "Internal field, used for sorting purposes."
        }
      }
    },
    "DoEmailLookupResponse": {
      "required": [
        "address",
        "addressType",
        "emailRole",
        "reason",
        "status",
        "deliverability",
        "isDisposableAddress",
        "localPart",
        "domainPart",
        "exchange",
        "isInWhiteList",
        "isInBlackList",
        "hasMx",
        "hasAa",
        "hasAaaa",
        "risk",
        "preference",
        "suggestion"
      ],
      "additionalProperties": false,
      "properties": {
        "address": {
          "type": "string",
          "format": "email",
          "example": "john@sample.com",
          "description": "The email address passed to the call."
        },
        "status": {
          "type": "string",
          "enum": [
            "valid",
            "invalid"
          ],
          "description": "The email is `valid` or `invalid`."
        },
        "deliverability": {
          "type": "string",
          "example": "undeliverable",
          "description": "The delivery status of the email address is`deliverable`, `undeliverable`. or `unknown`."
        },
        "reason": {
          "type": "string",
          "example": "No MX host found",
          "description": "The reason why the checked email is invalid/undeliverable.",
          "x-nullable": true
        },
        "risk": {
          "type": "string",
          "example": "high",
          "description": "The risk score of the email is`high`, `medium`, `low` or `null`.",
          "enum": [
            "high",
            "medium",
            "low",
            null,
            "unknown"
          ]
        },
        "addressType": {
          "type": "string",
          "example": "corporate",
          "description": "The email address type (domain) is `free` or `corporate`.",
          "enum": [
            "corporate",
            "free"
          ]
        },
        "isDisposableAddress": {
          "type": "boolean",
          "example": false,
          "description": "This is `true` if the domain is in the list of disposable email addresses; otherwise, it returns as `false`."
        },
        "suggestion": {
          "type": "string",
          "example": "john@sample.com",
          "x-nullable": true,
          "description": "Null if nothing is suggested; however, if there is a potential typo in the email address, the closest suggestion is provided."
        },
        "emailRole": {
          "type": "string",
          "example": "admin",
          "x-nullable": true,
          "description": "Checks the mailbox part of the email to see whether it matches a specific role type (‘admin’, ‘sales’, ‘webmaster’)."
        },
        "localPart": {
          "type": "string",
          "example": "john",
          "description": "The local part of the email address."
        },
        "domainPart": {
          "type": "string",
          "example": "sample.com",
          "description": "The domain part of the email address."
        },
        "exchange": {
          "type": "string",
          "example": "mx1.textmagic.com",
          "description": "Email exchange server domain name (MX record value).",
          "x-nullable": true
        },
        "preference": {
          "type": "integer",
          "example": 10,
          "description": "MX record preference.",
          "x-nullable": true
        },
        "isInWhiteList": {
          "type": "boolean",
          "example": false,
          "description": "`true` if the email address exists in the Textmagic whitelist.\n"
        },
        "isInBlackList": {
          "type": "boolean",
          "example": false,
          "description": "`true` if the email address exists in the Textmagic blacklist.\n"
        },
        "hasMx": {
          "type": "boolean",
          "example": true,
          "description": "`true` if the email address domain has an MX record.\n"
        },
        "hasAa": {
          "type": "boolean",
          "example": true,
          "description": "`true` if the email address domain has an A record (IPv4).\n"
        },
        "hasAaaa": {
          "type": "boolean",
          "example": true,
          "description": "`true` if the email address domain has an AAAA record (IPv6).\n"
        }
      },
      "type": "object"
    },
    "GetMessagingStatResponse": {
      "items": {
        "$ref": "#/definitions/MessagingStatItem"
      }
    },
    "GetSenderSettingsResponse": {
      "type": "object",
      "required": [
        "user",
        "special",
        "other"
      ],
      "additionalProperties": false,
      "properties": {
        "user": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SenderSettingsItem"
          }
        },
        "special": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SenderSettingsItem"
          }
        },
        "other": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SenderSettingsItem"
          }
        }
      }
    },
    "GetAvailableDedicatedNumbersResponse": {
      "type": "object",
      "required": [
        "numbers",
        "price",
        "giftType"
      ],
      "additionalProperties": false,
      "properties": {
        "numbers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "example": [
            447860021130,
            447860021131
          ],
          "description": "Array of phone numbers."
        },
        "price": {
          "type": "number",
          "format": "float",
          "example": 2.4,
          "description": "Dedicated number monthly fee for this country. Returned in the current [account](https://docs.textmagic.com/#tag/User) currency."
        },
        "giftType": {
          "type": "string",
          "example": "none",
          "enum": [
            "none",
            "registration",
            "first_month",
            "include_in_plan"
          ]
        }
      }
    },
    "GetSubaccountsWithTokensResponse": {
      "x-internal": true,
      "items": {
        "$ref": "#/definitions/SubaccountWithToken"
      }
    },
    "GetPushTokensResponse": {
      "items": {
        "$ref": "#/definitions/PushToken"
      }
    },
    "GetSurveyNodesResponse": {
      "required": [
        "nodes",
        "rows"
      ],
      "additionalProperties": false,
      "properties": {
        "nodes": {
          "items": {
            "$ref": "#/definitions/SurveyNode"
          }
        },
        "rows": {
          "items": {
            "items": {
              "type": "integer",
              "example": 1
            }
          }
        }
      }
    },
    "GetBalanceNotificationOptionsResponse": {
      "required": [
        "1",
        "2",
        "3",
        "5",
        "10",
        "20",
        "30",
        "50",
        "100",
        "500",
        "1000"
      ],
      "additionalProperties": false,
      "properties": {
        "1": {
          "type": "string",
          "example": "£1.00",
          "description": "Contains sign of currency in Unicode hex code."
        },
        "2": {
          "type": "string",
          "example": "£2.00",
          "description": "Contains sign of currency in Unicode hex code."
        },
        "3": {
          "type": "string",
          "example": "£3.00",
          "description": "Contains sign of currency in Unicode hex code."
        },
        "5": {
          "type": "string",
          "example": "£5.00",
          "description": "Contains sign of currency in Unicode hex code."
        },
        "10": {
          "type": "string",
          "example": "£10.00",
          "description": "Contains sign of currency in Unicode hex code."
        },
        "20": {
          "type": "string",
          "example": "£20.00",
          "description": "Contains sign of currency in Unicode hex code."
        },
        "30": {
          "type": "string",
          "example": "£30.00",
          "description": "Contains sign of currency in Unicode hex code."
        },
        "50": {
          "type": "string",
          "example": "£50.00",
          "description": "Contains sign of currency in Unicode hex code."
        },
        "100": {
          "type": "string",
          "example": "£100.00",
          "description": "Contains sign of currency in Unicode hex code."
        },
        "500": {
          "type": "string",
          "example": "£500.00",
          "description": "Contains sign of currency in Unicode hex code."
        },
        "1000": {
          "type": "string",
          "example": "£1,000.00",
          "description": "Contains sign of currency in Unicode hex code."
        }
      }
    },
    "GetBalanceNotificationSettingsResponse": {
      "required": [
        "lowBalanceNotification",
        "alertBalance",
        "alertPhone",
        "alertEmail1",
        "alertEmail2",
        "alertEmail3"
      ],
      "additionalProperties": false,
      "properties": {
        "lowBalanceNotification": {
          "description": "Should user receive low balance notification.",
          "type": "boolean",
          "example": true
        },
        "alertBalance": {
          "description": "If balance is below this value, user receive low balance notification.",
          "type": "number",
          "example": 50
        },
        "alertPhone": {
          "description": "Low balance notification phone number.",
          "type": "string",
          "example": "447860021130"
        },
        "alertEmail1": {
          "description": "Low balance notification email 1.",
          "type": "string",
          "example": "test@test.com"
        },
        "alertEmail2": {
          "description": "Low balance notification email 2.",
          "type": "string",
          "example": "test@test.com"
        },
        "alertEmail3": {
          "description": "Low balance notification email 3.",
          "type": "string",
          "example": "test@test.com"
        }
      }
    },
    "GetListContactsIdsResponse": {
      "items": {
        "type": "integer",
        "description": "Contact ID.",
        "example": 534
      }
    },
    "GetMessagePriceResponse": {
      "required": [
        "total",
        "parts",
        "countries"
      ],
      "additionalProperties": false,
      "properties": {
        "total": {
          "type": "number",
          "example": 0.08,
          "description": "Total price of the message."
        },
        "parts": {
          "type": "integer",
          "example": 6,
          "x-nullable": true,
          "description": "Message parts (multiples of 160 characters) count."
        },
        "countries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/GetMessagePriceResponseCountriesItem"
          }
        }
      }
    },
    "GetMessagePreviewResponse": {
      "properties": {
        "messages": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessageOut"
          }
        }
      }
    },
    "SendMessageResponse": {
      "required": [
        "id",
        "href",
        "type",
        "sessionId",
        "bulkId",
        "messageId",
        "scheduleId",
        "chatId"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 10489,
          "description": "Message ID."
        },
        "href": {
          "type": "string",
          "example": "/api/v2/sessions/10489",
          "description": "URI of the message session."
        },
        "type": {
          "type": "string",
          "example": "session",
          "enum": [
            "message",
            "session",
            "schedule",
            "bulk"
          ],
          "description": "Message response type:\n* **message** – when the message is sent to a single recipient.\n* **session** – when the message is sent is to multiple recipients.\n* **schedule** - when the message is scheduled for sending.\n* **bulk** - when the message is sent to multiple recipients and the number of recipients requires asynchronous processing See [Sending more than 1,000 messages in one session](https://docs.textmagic.com/#section/Tutorials/Sending-more-than-1000-messages-in-one-session).\n"
        },
        "sessionId": {
          "type": "integer",
          "example": 10489,
          "x-nullable": true,
          "description": "Message session ID."
        },
        "bulkId": {
          "type": "integer",
          "example": null,
          "x-nullable": true,
          "description": "Bulk Session ID. See [Sending more than 1,000 messages in one session](https://docs.textmagic.com/#section/Tutorials/Sending-more-than-1000-messages-in-one-session)."
        },
        "messageId": {
          "type": "integer",
          "example": null,
          "x-nullable": true,
          "description": "Message ID."
        },
        "scheduleId": {
          "type": "integer",
          "example": null,
          "x-nullable": true,
          "description": "Message Schedule ID."
        },
        "chatId": {
          "type": "integer",
          "example": null,
          "x-nullable": true,
          "description": "Message Chat ID."
        }
      }
    },
    "GetMessageSessionStatResponse": {
      "required": [
        "failed",
        "delivered",
        "accepted",
        "rejected",
        "scheduled",
        "all",
        "sent"
      ],
      "additionalProperties": false,
      "properties": {
        "failed": {
          "type": "integer",
          "example": 12,
          "description": "Amount of failed messages."
        },
        "delivered": {
          "type": "integer",
          "example": 99,
          "description": "Amount of delivered messages."
        },
        "accepted": {
          "type": "integer",
          "example": 75,
          "description": "Amount of accepted messages."
        },
        "rejected": {
          "type": "integer",
          "example": 12,
          "description": "Amount of rejected messages."
        },
        "scheduled": {
          "type": "integer",
          "example": 0,
          "description": "Amount of scheduled messages."
        },
        "all": {
          "type": "integer",
          "example": 1,
          "description": "Total amount of messages."
        },
        "sent": {
          "type": "integer",
          "example": 1,
          "description": "Amount of sent but not yet delivered messages."
        }
      }
    },
    "GetMessagingCountersResponse": {
      "required": [
        "contacts",
        "sent",
        "received"
      ],
      "additionalProperties": false,
      "properties": {
        "contacts": {
          "type": "integer",
          "example": 10,
          "description": "Total contacts amount."
        },
        "sent": {
          "type": "integer",
          "example": 10,
          "description": "Total sent messages amount."
        },
        "received": {
          "type": "integer",
          "example": 10,
          "description": "Total received messages amount."
        }
      }
    },
    "GetUnreadMessagesTotalResponse": {
      "required": [
        "total"
      ],
      "additionalProperties": false,
      "properties": {
        "total": {
          "type": "integer",
          "example": 22,
          "description": "Amount of unread messages."
        }
      }
    },
    "UploadMessageAttachmentResponse": {
      "required": [
        "chars",
        "href",
        "name",
        "size",
        "resource"
      ],
      "additionalProperties": false,
      "properties": {
        "chars": {
          "type": "integer",
          "example": 10,
          "description": "`href` field characters count.\n"
        },
        "href": {
          "type": "string",
          "example": "click/Zwcj9",
          "description": "This is a relative link to your file. To construct a full link, just add “[https://my.textmagic.com/”](https://my.textmagic.com/%E2%80%9D) to the beginning (like this: [https://my.textmagic.com/click/Zwcj9](https://my.textmagic.com/click/Zwcj9)). For most modern devices, you can omit the “https://” part and write just [my.textmagic.com/click/Zwcj9](https://my.textmagic.com/click/Zwcj9), which will save you 8 characters.\n"
        },
        "name": {
          "type": "string",
          "example": "test.pdf",
          "description": "File name of the uploaded file.\n"
        },
        "size": {
          "type": "integer",
          "example": 1094,
          "description": "Attachment size in bytes."
        },
        "resource": {
          "type": "string",
          "example": "tmfGSR8ShMSDMy8Aa15904809817838.jpg",
          "description": "Internal file name"
        }
      }
    },
    "GetMessagePricesResponse": {
      "items": {
        "$ref": "#/definitions/MessagePriceItem"
      }
    },
    "GetStateResponse": {
      "additionalProperties": false,
      "required": [
        "systemCacheClear",
        "systemExit",
        "systemAlert",
        "systemAccountStateChanged",
        "systemAccountAcceptTermsUpdate",
        "systemAccountClosed",
        "systemAccountAdditionalFields",
        "systemAccountNumbersListChange",
        "systemAccountPermissionsChanged",
        "userProfileChanged",
        "userBalanceChanged",
        "userPresenceStatusChanged",
        "userImpersonationEnd",
        "messageDeleted",
        "messageIncoming",
        "messageIncomingDeleted",
        "messageStateChanged",
        "messageBulkEnd",
        "messageWipeEnd",
        "messageSent",
        "messageLog",
        "messageNote",
        "messageInitial",
        "lastMessageSet",
        "messageSessionDeleted",
        "messageCacheClear",
        "messageIncomingCacheClear",
        "messageScheduleAdded",
        "messageScheduleStateChanged",
        "messageScheduleDeleted",
        "messageScheduleCacheClear",
        "messageScheduleNotSentStateChanged",
        "messageTemplateCacheClear",
        "callFinished",
        "chatCreated",
        "chatMarkedAsRead",
        "chatMuted",
        "chatUnmuted",
        "chatPinned",
        "chatUnpinned",
        "chatDeleted",
        "chatClosed",
        "chatReopened",
        "chatActivated",
        "chatCacheClear",
        "chatRead",
        "chatUnread",
        "chatAssigneeChanged",
        "chatConversationEnded",
        "chatUpdated",
        "liveChatAgentChanged",
        "liveChatRated",
        "webWidgetUpdated",
        "webWidgetDeleted",
        "webWidgetCreated",
        "contactAdded",
        "contactDeleted",
        "contactBulkUpdated",
        "contactStateChanged",
        "contactUnsubscribed",
        "contactResubscribed",
        "contactNoteAdded",
        "contactNoteDeleted",
        "contactNoteStateChanged",
        "listAdded",
        "listDeleted",
        "listStateChanged",
        "listCountMembersUpdated",
        "contactWipeEnd",
        "contactImportEnd",
        "contactCacheClear",
        "listCacheClear",
        "customFieldsCacheClear",
        "progressCarrierBulkLookup",
        "progressSubAccountBulkImport",
        "emailLookupProgressState",
        "importProgressState",
        "forceRefreshWebApp",
        "chatSenderSettingsChanged",
        "countrySenderSettingsChanged",
        "chatSummaryChunk",
        "chatWaysToReplyChunk",
        "chatSuggestedReplyChunk",
        "automationAiChunk",
        "automationAiStatus",
        "automationAiSuggestions",
        "automationAiDone",
        "taskCreated",
        "taskUpdated",
        "taskReordered",
        "taskDeleted",
        "taskMovedAll",
        "taskStageCreated",
        "taskStageUpdated",
        "taskStageDeleted",
        "taskBoardCreated",
        "taskBoardUpdated",
        "taskBoardReordered",
        "taskBoardDeleted",
        "taskBoardArchived",
        "taskChecklistCreated",
        "taskChecklistUpdated",
        "taskChecklistDeleted",
        "taskChecklistBulkMarked",
        "taskChecklistItemCreated",
        "taskChecklistItemUpdated",
        "taskChecklistItemDeleted",
        "taskCommentCreated",
        "taskCommentDeleted",
        "pinnedContactAdded",
        "pinnedContactRemoved",
        "pinnedContactReordered",
        "pinnedContactStateChanged",
        "whatsappAccountAdded",
        "whatsappAccountRemoved",
        "whatsappAccountChanged",
        "facebookPageAdded",
        "facebookPageRemoved",
        "facebookPageChanged",
        "instagramAccountAdded",
        "instagramAccountRemoved",
        "instagramAccountChanged",
        "unreadTicketsCountUpdated",
        "ticketDeleted",
        "ticketUpdated",
        "ticketCreated",
        "ticketBulkUpdated",
        "ticketBulkDeleted",
        "ticketMessageCreated",
        "ticketMessageUpdated",
        "ticketMessageDeleted",
        "subAccountsClosed",
        "userInvited",
        "filteredViewCreated",
        "filteredViewCountUpdated",
        "filteredViewDeleted",
        "forwardingInboxWasVerified",
        "forwardingInboxCheckWasFailed",
        "chatTagsChanged",
        "forwardingInboxVerificationLinkWasParsed",
        "tendlcLinkNumberStatusUpdated",
        "channelPresence",
        "dealCreated",
        "dealUpdated",
        "dealDeleted",
        "dealMoved",
        "dealStageCreated",
        "dealStageUpdated",
        "dealStageDeleted",
        "dealPipelineCreated",
        "dealPipelineUpdated",
        "dealPipelineDeleted",
        "dealPipelineArchived",
        "dealPipelineReordered",
        "dealActivityUpdated",
        "dealActivityItemCreated",
        "dealActivityItemUpdated",
        "dealActivityItemDeleted",
        "dealActivityItemBulkMarked",
        "dealTimelineItemDeleted",
        "dealTimelineItemCreated",
        "AIAssistantCreated",
        "AIAssistantState",
        "AIAssistantDeleted",
        "AIAssistantLinkDeleted",
        "AIAssistantLinkState",
        "AIAssistantLinkCreated",
        "AIAssistantSubLinkState",
        "AIAssistantSubLinkCreated",
        "emailCampaignEmailSenderCreated",
        "emailCampaignEmailSenderUpdated",
        "emailCampaignEmailSenderDeleted",
        "emailCampaignDomainCreated",
        "emailCampaignDomainDeleted",
        "emailCampaignDomainStatusChanged",
        "emailCampaignDomainVerified",
        "emailCampaignDomainDkimVerified",
        "emailCampaignDomainReturnPathVerified",
        "emailCampaignDomainDmarcVerified",
        "emailCampaignDomainEntryVerificationChanged",
        "emailCampaignProgressState",
        "emailCampaignUpdated",
        "emailTemplateImproved",
        "emailTemplateImprovingFailed",
        "emailBonusUpdated",
        "smsCampaignInvalidated",
        "scheduledEmailCampaignCreated",
        "scheduledEmailCampaignUpdated",
        "scheduledEmailCampaignStatusUpdated",
        "scheduledEmailCampaignDeleted",
        "emailCampaignFailedAttemptCreated",
        "emailCampaignFailedAttemptDeleted",
        "emailCampaignFailedAttemptStateUpdated",
        "tollFreePreFillCompleted",
        "tollFreePreFillFailed",
        "tollFreeComplianceCheckCompleted",
        "tollFreeComplianceCheckFailed",
        "tenDlcPreFillCompleted",
        "tenDlcPreFillFailed",
        "tenDlcComplianceCheckCompleted",
        "tenDlcComplianceCheckFailed",
        "marketingDataModalChanged",
        "integrationStatusChanged",
        "integrationCustomerSyncProgressState",
        "integrationCustomerSyncEnd"
      ],
      "properties": {
        "systemCacheClear": {
          "type": "integer"
        },
        "systemExit": {
          "type": "integer"
        },
        "systemAlert": {
          "type": "integer"
        },
        "systemAccountStateChanged": {
          "type": "integer"
        },
        "systemAccountAcceptTermsUpdate": {
          "type": "integer"
        },
        "systemAccountClosed": {
          "type": "integer"
        },
        "systemAccountAdditionalFields": {
          "type": "integer"
        },
        "systemAccountNumbersListChange": {
          "type": "integer"
        },
        "systemAccountPermissionsChanged": {
          "type": "integer"
        },
        "userProfileChanged": {
          "type": "integer"
        },
        "userBalanceChanged": {
          "type": "integer"
        },
        "userPresenceStatusChanged": {
          "type": "integer"
        },
        "userImpersonationEnd": {
          "type": "integer"
        },
        "messageDeleted": {
          "type": "integer"
        },
        "messageIncoming": {
          "type": "integer"
        },
        "messageIncomingDeleted": {
          "type": "integer"
        },
        "messageStateChanged": {
          "type": "integer"
        },
        "messageBulkEnd": {
          "type": "integer"
        },
        "messageWipeEnd": {
          "type": "integer"
        },
        "messageSent": {
          "type": "integer"
        },
        "messageLog": {
          "type": "integer"
        },
        "messageNote": {
          "type": "integer"
        },
        "messageInitial": {
          "type": "integer"
        },
        "lastMessageSet": {
          "type": "integer"
        },
        "messageSessionDeleted": {
          "type": "integer"
        },
        "messageCacheClear": {
          "type": "integer"
        },
        "messageIncomingCacheClear": {
          "type": "integer"
        },
        "messageScheduleAdded": {
          "type": "integer"
        },
        "messageScheduleStateChanged": {
          "type": "integer"
        },
        "messageScheduleDeleted": {
          "type": "integer"
        },
        "messageScheduleNotSentStateChanged": {
          "type": "integer"
        },
        "messageScheduleCacheClear": {
          "type": "integer"
        },
        "messageTemplateCacheClear": {
          "type": "integer"
        },
        "callFinished": {
          "type": "integer"
        },
        "chatCreated": {
          "type": "integer"
        },
        "chatMarkedAsRead": {
          "type": "integer"
        },
        "chatMuted": {
          "type": "integer"
        },
        "chatUnmuted": {
          "type": "integer"
        },
        "chatPinned": {
          "type": "integer"
        },
        "chatUnpinned": {
          "type": "integer"
        },
        "chatDeleted": {
          "type": "integer"
        },
        "chatClosed": {
          "type": "integer"
        },
        "chatReopened": {
          "type": "integer"
        },
        "chatActivated": {
          "type": "integer"
        },
        "chatCacheClear": {
          "type": "integer"
        },
        "chatRead": {
          "type": "integer"
        },
        "chatUnread": {
          "type": "integer"
        },
        "chatAssigneeChanged": {
          "type": "integer"
        },
        "chatTagsChanged": {
          "type": "integer"
        },
        "chatConversationEnded": {
          "type": "integer"
        },
        "chatUpdated": {
          "type": "integer"
        },
        "liveChatAgentChanged": {
          "type": "integer"
        },
        "liveChatRated": {
          "type": "integer"
        },
        "webWidgetUpdated": {
          "type": "integer"
        },
        "webWidgetDeleted": {
          "type": "integer"
        },
        "webWidgetCreated": {
          "type": "integer"
        },
        "contactAdded": {
          "type": "integer"
        },
        "contactDeleted": {
          "type": "integer"
        },
        "contactBulkUpdated": {
          "type": "integer"
        },
        "contactStateChanged": {
          "type": "integer"
        },
        "contactUnsubscribed": {
          "type": "integer"
        },
        "contactResubscribed": {
          "type": "integer"
        },
        "contactNoteAdded": {
          "type": "integer"
        },
        "contactNoteDeleted": {
          "type": "integer"
        },
        "contactNoteStateChanged": {
          "type": "integer"
        },
        "listAdded": {
          "type": "integer"
        },
        "listDeleted": {
          "type": "integer"
        },
        "listStateChanged": {
          "type": "integer"
        },
        "listCountMembersUpdated": {
          "type": "integer"
        },
        "contactWipeEnd": {
          "type": "integer"
        },
        "contactImportEnd": {
          "type": "integer"
        },
        "contactCacheClear": {
          "type": "integer"
        },
        "listCacheClear": {
          "type": "integer"
        },
        "customFieldsCacheClear": {
          "type": "integer"
        },
        "progressCarrierBulkLookup": {
          "type": "integer"
        },
        "progressSubAccountBulkImport": {
          "type": "integer"
        },
        "emailLookupProgressState": {
          "type": "integer"
        },
        "importProgressState": {
          "type": "integer"
        },
        "forceRefreshWebApp": {
          "type": "integer"
        },
        "chatSenderSettingsChanged": {
          "type": "integer"
        },
        "countrySenderSettingsChanged": {
          "type": "integer"
        },
        "chatSummaryChunk": {
          "type": "integer"
        },
        "chatWaysToReplyChunk": {
          "type": "integer"
        },
        "chatSuggestedReplyChunk": {
          "type": "integer"
        },
        "automationAiChunk": {
          "type": "integer"
        },
        "automationAiStatus": {
          "type": "integer"
        },
        "automationAiSuggestions": {
          "type": "integer"
        },
        "automationAiDone": {
          "type": "integer"
        },
        "userSubscriptionChanged": {
          "type": "integer"
        },
        "userSubscriptionDeleted": {
          "type": "integer"
        },
        "taskCreated": {
          "type": "integer"
        },
        "taskUpdated": {
          "type": "integer"
        },
        "taskReordered": {
          "type": "integer"
        },
        "taskDeleted": {
          "type": "integer"
        },
        "taskMovedAll": {
          "type": "integer"
        },
        "taskStageCreated": {
          "type": "integer"
        },
        "taskStageUpdated": {
          "type": "integer"
        },
        "taskStageDeleted": {
          "type": "integer"
        },
        "taskBoardCreated": {
          "type": "integer"
        },
        "taskBoardUpdated": {
          "type": "integer"
        },
        "taskBoardReordered": {
          "type": "integer"
        },
        "taskBoardDeleted": {
          "type": "integer"
        },
        "taskBoardArchived": {
          "type": "integer"
        },
        "taskChecklistCreated": {
          "type": "integer"
        },
        "taskChecklistUpdated": {
          "type": "integer"
        },
        "taskChecklistDeleted": {
          "type": "integer"
        },
        "taskChecklistBulkMarked": {
          "type": "integer"
        },
        "taskChecklistItemCreated": {
          "type": "integer"
        },
        "taskChecklistItemUpdated": {
          "type": "integer"
        },
        "taskChecklistItemDeleted": {
          "type": "integer"
        },
        "taskCommentCreated": {
          "type": "integer"
        },
        "taskCommentDeleted": {
          "type": "integer"
        },
        "pinnedContactAdded": {
          "type": "integer"
        },
        "pinnedContactRemoved": {
          "type": "integer"
        },
        "pinnedContactReordered": {
          "type": "integer"
        },
        "pinnedContactStateChanged": {
          "type": "integer"
        },
        "whatsappAccountAdded": {
          "type": "integer"
        },
        "whatsappAccountRemoved": {
          "type": "integer"
        },
        "whatsappAccountChanged": {
          "type": "integer"
        },
        "facebookPageAdded": {
          "type": "integer"
        },
        "facebookPageRemoved": {
          "type": "integer"
        },
        "facebookPageChanged": {
          "type": "integer"
        },
        "instagramAccountAdded": {
          "type": "integer"
        },
        "instagramAccountRemoved": {
          "type": "integer"
        },
        "instagramAccountChanged": {
          "type": "integer"
        },
        "unreadTicketsCountUpdated": {
          "type": "integer"
        },
        "ticketDeleted": {
          "type": "integer"
        },
        "ticketUpdated": {
          "type": "integer"
        },
        "ticketCreated": {
          "type": "integer"
        },
        "ticketBulkUpdated": {
          "type": "integer"
        },
        "ticketBulkDeleted": {
          "type": "integer"
        },
        "ticketMessageCreated": {
          "type": "integer"
        },
        "ticketMessageUpdated": {
          "type": "integer"
        },
        "ticketMessageDeleted": {
          "type": "integer"
        },
        "subAccountsClosed": {
          "type": "integer"
        },
        "userInvited": {
          "type": "integer"
        },
        "filteredViewCreated": {
          "type": "integer"
        },
        "filteredViewCountUpdated": {
          "type": "integer"
        },
        "filteredViewDeleted": {
          "type": "integer"
        },
        "forwardingInboxWasVerified": {
          "type": "integer"
        },
        "forwardingInboxCheckWasFailed": {
          "type": "integer"
        },
        "forwardingInboxVerificationLinkWasParsed": {
          "type": "integer"
        },
        "tendlcLinkNumberStatusUpdated": {
          "type": "integer"
        },
        "channelPresence": {
          "type": "integer"
        },
        "dealCreated": {
          "type": "integer"
        },
        "dealUpdated": {
          "type": "integer"
        },
        "dealDeleted": {
          "type": "integer"
        },
        "dealMoved": {
          "type": "integer"
        },
        "dealStageCreated": {
          "type": "integer"
        },
        "dealStageUpdated": {
          "type": "integer"
        },
        "dealStageDeleted": {
          "type": "integer"
        },
        "dealPipelineCreated": {
          "type": "integer"
        },
        "dealPipelineUpdated": {
          "type": "integer"
        },
        "dealPipelineDeleted": {
          "type": "integer"
        },
        "dealPipelineArchived": {
          "type": "integer"
        },
        "dealPipelineReordered": {
          "type": "integer"
        },
        "dealActivityUpdated": {
          "type": "integer"
        },
        "dealActivityItemCreated": {
          "type": "integer"
        },
        "dealActivityItemUpdated": {
          "type": "integer"
        },
        "dealActivityItemDeleted": {
          "type": "integer"
        },
        "dealActivityItemBulkMarked": {
          "type": "integer"
        },
        "dealTimelineItemDeleted": {
          "type": "integer"
        },
        "dealTimelineItemCreated": {
          "type": "integer"
        },
        "AIAssistantCreated": {
          "type": "integer"
        },
        "AIAssistantState": {
          "type": "integer"
        },
        "AIAssistantDeleted": {
          "type": "integer"
        },
        "AIAssistantLinkDeleted": {
          "type": "integer"
        },
        "AIAssistantLinkState": {
          "type": "integer"
        },
        "AIAssistantLinkCreated": {
          "type": "integer"
        },
        "AIAssistantSubLinkState": {
          "type": "integer"
        },
        "AIAssistantSubLinkCreated": {
          "type": "integer"
        },
        "emailCampaignEmailSenderCreated": {
          "type": "integer"
        },
        "emailCampaignEmailSenderUpdated": {
          "type": "integer"
        },
        "emailCampaignEmailSenderDeleted": {
          "type": "integer"
        },
        "emailCampaignDomainCreated": {
          "type": "integer"
        },
        "emailCampaignDomainDeleted": {
          "type": "integer"
        },
        "emailCampaignDomainVerified": {
          "type": "integer"
        },
        "emailCampaignDomainStatusChanged": {
          "type": "integer"
        },
        "emailCampaignDomainDkimVerified": {
          "type": "integer"
        },
        "emailCampaignDomainReturnPathVerified": {
          "type": "integer"
        },
        "emailCampaignDomainDmarcVerified": {
          "type": "integer"
        },
        "emailCampaignDomainEntryVerificationChanged": {
          "type": "integer"
        },
        "emailCampaignProgressState": {
          "type": "integer"
        },
        "emailCampaignUpdated": {
          "type": "integer"
        },
        "emailTemplateImproved": {
          "type": "integer"
        },
        "emailTemplateImprovingFailed": {
          "type": "integer"
        },
        "emailBonusUpdated": {
          "type": "integer"
        },
        "smsCampaignInvalidated": {
          "type": "integer"
        },
        "scheduledEmailCampaignCreated": {
          "type": "integer"
        },
        "scheduledEmailCampaignUpdated": {
          "type": "integer"
        },
        "scheduledEmailCampaignStatusUpdated": {
          "type": "integer"
        },
        "scheduledEmailCampaignDeleted": {
          "type": "integer"
        },
        "emailCampaignFailedAttemptCreated": {
          "type": "integer"
        },
        "emailCampaignFailedAttemptDeleted": {
          "type": "integer"
        },
        "emailCampaignFailedAttemptStateUpdated": {
          "type": "integer"
        },
        "tollFreePreFillCompleted": {
          "type": "integer"
        },
        "tollFreePreFillFailed": {
          "type": "integer"
        },
        "tollFreeComplianceCheckCompleted": {
          "type": "integer"
        },
        "tollFreeComplianceCheckFailed": {
          "type": "integer"
        },
        "tenDlcPreFillCompleted": {
          "type": "integer"
        },
        "tenDlcPreFillFailed": {
          "type": "integer"
        },
        "tenDlcComplianceCheckCompleted": {
          "type": "integer"
        },
        "tenDlcComplianceCheckFailed": {
          "type": "integer"
        },
        "marketingDataModalChanged": {
          "type": "integer"
        },
        "integrationStatusChanged": {
          "type": "integer"
        },
        "integrationCustomerSyncProgressState": {
          "type": "integer"
        },
        "integrationCustomerSyncEnd": {
          "type": "integer"
        }
      }
    },
    "CallPriceResponse": {
      "additionalProperties": false,
      "required": [
        "outbound",
        "inbound",
        "forward",
        "country"
      ],
      "properties": {
        "outbound": {
          "type": "number",
          "description": "Price for outbound message."
        },
        "inbound": {
          "type": "number",
          "description": "Price for inbound message."
        },
        "forward": {
          "type": "number",
          "description": "Price for forward."
        },
        "country": {
          "description": "The 2-letter ISO country code for local phone numbers, used when local is  set to true. Default is account country.",
          "type": "string",
          "example": "US"
        }
      }
    },
    "User": {
      "x-nullable": true,
      "additionalProperties": false,
      "required": [
        "id",
        "username",
        "firstName",
        "lastName",
        "email",
        "status",
        "balance",
        "phone",
        "company",
        "currency",
        "country",
        "timezone",
        "subaccountType",
        "emailAccepted",
        "phoneAccepted",
        "avatar"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "example": 305,
          "description": "User ID."
        },
        "displayTimeFormat": {
          "type": "string",
          "example": "24h",
          "enum": [
            "12h",
            "24h"
          ],
          "description": "User's preferred format of time display:\n* *12h* - AM/PM format;\n* *24h* - 24-hour clock format.\n"
        },
        "username": {
          "type": "string",
          "example": "charles.conway",
          "description": "Username."
        },
        "firstName": {
          "type": "string",
          "example": "Charles",
          "description": "Account first name."
        },
        "lastName": {
          "type": "string",
          "example": "Conway",
          "description": "Account last name."
        },
        "email": {
          "type": "string",
          "example": "charles@example.com",
          "description": "User email address."
        },
        "status": {
          "type": "string",
          "example": "A",
          "enum": [
            "A",
            "T"
          ],
          "description": "Current account status:\n* **A** for Active;\n* **T** for Trial.\n"
        },
        "balance": {
          "type": "number",
          "example": 208.64,
          "description": "Account balance (in account currency)."
        },
        "phone": {
          "type": "string",
          "example": "447860021130",
          "x-nullable": true,
          "description": "User's phone number."
        },
        "company": {
          "type": "string",
          "example": "Example Ltd.",
          "x-nullable": true,
          "description": "Account company name."
        },
        "currency": {
          "$ref": "#/definitions/Currency"
        },
        "country": {
          "$ref": "#/definitions/Country"
        },
        "timezone": {
          "$ref": "#/definitions/Timezone"
        },
        "subaccountType": {
          "type": "string",
          "example": "P",
          "enum": [
            "P",
            "A",
            "U"
          ],
          "description": "Type of account:\n* **P** for Parent User;\n* **A** for Administrator Sub-Account;\n* **U** for Regular User.\n"
        },
        "emailAccepted": {
          "type": "boolean",
          "example": true,
          "description": "Does the account have a confirmed email?"
        },
        "phoneAccepted": {
          "type": "boolean",
          "example": true,
          "description": "Does the account have a confirmed phone number?"
        },
        "avatar": {
          "$ref": "#/definitions/UserImage"
        }
      },
      "type": "object"
    },
    "UsersInbound": {
      "required": [
        "id",
        "user",
        "purchasedAt",
        "expireAt",
        "status",
        "country"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 305,
          "description": "Dedicated number ID."
        },
        "displayTimeFormat": {
          "type": "string",
          "example": "24h",
          "description": "Format for representation of time."
        },
        "phone": {
          "type": "string",
          "example": "447860021130",
          "description": "Dedicated phone number."
        },
        "user": {
          "$ref": "#/definitions/User"
        },
        "purchasedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Time when the dedicated number was purchased.",
          "example": "2014-10-02T11:07:04+0000"
        },
        "expireAt": {
          "type": "string",
          "format": "date-time",
          "example": "2014-10-02T11:07:04+0000",
          "description": "Dedicated number subscription expiration time."
        },
        "status": {
          "type": "string",
          "description": "Number status:\n*   **U** for Unused. No messages have been sent from (or received to) this number;\n*   **A** for Active.\n",
          "example": "U",
          "enum": [
            "U",
            "A"
          ]
        },
        "country": {
          "$ref": "#/definitions/Country"
        }
      },
      "type": "object"
    },
    "SenderId": {
      "type": "object",
      "required": [
        "id",
        "senderId",
        "user",
        "status"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 37,
          "description": "Numeric sender ID."
        },
        "displayTimeFormat": {
          "type": "string",
          "example": "24h",
          "description": "Format for representation of time."
        },
        "senderId": {
          "type": "string",
          "description": "Alphanumeric ID.",
          "example": "HotRod"
        },
        "user": {
          "$ref": "#/definitions/User"
        },
        "status": {
          "type": "string",
          "enum": [
            "A",
            "R",
            "P"
          ],
          "example": "A",
          "description": "*   **P** for Pending - this Sender ID is being reviewed by our support team;\n*   **R** for Rejected - our support team rejected your application for this Sender ID;\n*   **A** for Active.\n"
        }
      }
    },
    "Contact": {
      "type": "object",
      "x-nullable": true,
      "required": [
        "id",
        "favorited",
        "firstName",
        "lastName",
        "companyName",
        "phone",
        "email",
        "country",
        "customFields",
        "customFieldValues",
        "user",
        "lists",
        "phoneType",
        "avatar",
        "notes",
        "blocked"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 27074,
          "description": "Contact ID."
        },
        "favorited": {
          "type": "boolean",
          "example": true,
          "description": "Is the Contact favorite? [Favorite list](https://docs.textmagic.com/#operation/getFavorites)."
        },
        "blocked": {
          "type": "boolean",
          "example": true,
          "description": "Is the Contact blocked? [Blocked contacts](https://docs.textmagic.com/#operation/getBlockedContacts)."
        },
        "firstName": {
          "type": "string",
          "example": "Charles",
          "description": "Contact first name.",
          "x-nullable": true
        },
        "lastName": {
          "type": "string",
          "example": "Conway",
          "description": "Contact last name.",
          "x-nullable": true
        },
        "companyName": {
          "type": "string",
          "example": "Example Ltd.",
          "description": "Company name.",
          "x-nullable": true
        },
        "phone": {
          "type": "string",
          "example": 447860021130,
          "description": "Phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164).",
          "x-nullable": true
        },
        "email": {
          "type": "string",
          "format": "email",
          "example": "charles@example.com",
          "description": "Contact email address.",
          "x-nullable": true
        },
        "country": {
          "$ref": "#/definitions/Country",
          "description": "Contact country."
        },
        "customFields": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CustomFieldListItem"
          }
        },
        "customFieldValues": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CustomFieldValues"
          }
        },
        "user": {
          "$ref": "#/definitions/User"
        },
        "lists": {
          "items": {
            "$ref": "#/definitions/List"
          },
          "type": "array"
        },
        "owner": {
          "$ref": "#/definitions/User",
          "description": "Contact Owner User ID."
        },
        "tags": {
          "items": {
            "$ref": "#/definitions/Tag",
            "description": "Tags"
          },
          "type": "array"
        },
        "phoneType": {
          "type": "string",
          "x-nullable": true,
          "description": "Phone number type:\n* **0** if it is fixed-line;\n* **1** if it is mobile;\n* **2** if it is mobile or fixed-line (in case we cannot distingush between fixed-line or mobile);\n* **3** if it is toll-free;\n* **4** if it is a premium rate phone;\n* **5** if it is a shared cost phone;\n* **6** if it is a VoIP;\n* **7** if it is a [Personal Number]();\n* **8** if it is a pager;\n* **9** if it is a Universal Access Number;\n* **10** if the phone type is unknown;\n* **-1** if the phone type is not yet processed or cannot be determined.\n"
        },
        "avatar": {
          "$ref": "#/definitions/ContactImage"
        },
        "notes": {
          "items": {
            "$ref": "#/definitions/ContactNote"
          },
          "type": "array"
        },
        "whatsappPhone": {
          "type": "string",
          "example": 447860021130,
          "description": "Whatsapp phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164).",
          "x-nullable": true
        }
      }
    },
    "Tag": {
      "required": [
        "id",
        "title"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "example": 23,
          "description": "Tag ID."
        },
        "title": {
          "type": "string",
          "description": "Tag title.",
          "example": "Red"
        }
      }
    },
    "UserCustomField": {
      "required": [
        "id",
        "name",
        "createdAt"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 23,
          "description": "Custom field ID."
        },
        "name": {
          "type": "string",
          "description": "Custom field name.",
          "example": "DOB"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "example": "2015-02-11T07:33:19+0000",
          "description": "Custom field creation time."
        }
      },
      "type": "object"
    },
    "List": {
      "required": [
        "id",
        "name",
        "description",
        "favorited",
        "membersCount",
        "user",
        "service",
        "shared",
        "avatar",
        "isDefault"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 715,
          "description": "List ID."
        },
        "name": {
          "type": "string",
          "example": "Private list",
          "description": "List name."
        },
        "description": {
          "type": "string",
          "example": "Private contacts of C. R. Conway",
          "x-nullable": true,
          "description": "Description of the list."
        },
        "favorited": {
          "type": "boolean",
          "example": false,
          "description": "Is the List favorited? See [Favorites list](https://docs.textmagic.com/#operation/getFavourites)."
        },
        "membersCount": {
          "type": "integer",
          "example": 332,
          "description": "List members count."
        },
        "user": {
          "$ref": "#/definitions/User"
        },
        "service": {
          "type": "boolean",
          "description": "Internal service field."
        },
        "shared": {
          "type": "boolean",
          "x-nullable": true,
          "example": false,
          "description": "Is the list **shared** among all sub-accounts?"
        },
        "avatar": {
          "$ref": "#/definitions/ListImage"
        },
        "isDefault": {
          "type": "boolean",
          "x-nullable": true,
          "description": "Indicates that List is used as a default. All new contacts added via the Web-app will be added in this List by default."
        }
      },
      "type": "object"
    },
    "DistributionList": {
      "required": [
        "id",
        "name",
        "email",
        "membersCount",
        "includeOptions",
        "maxLength",
        "recipients",
        "senderSource"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 715,
          "description": "Distribution list ID."
        },
        "name": {
          "type": "string",
          "example": "Support alerts",
          "description": "Distribution list name."
        },
        "email": {
          "type": "string",
          "example": "ab12345678@distributionlists.textmagic.com",
          "description": "The auto-generated email address. Emails sent here are forwarded as text messages to the list recipients."
        },
        "membersCount": {
          "type": "integer",
          "example": 332,
          "description": "Total number of unique recipients (contacts + list members + segment members + numbers, de-duplicated)."
        },
        "includeOptions": {
          "type": "string",
          "enum": [
            "body",
            "subject",
            "both"
          ],
          "example": "both",
          "description": "Which part of the incoming email is included in the outgoing SMS."
        },
        "maxLength": {
          "type": "integer",
          "example": 6,
          "description": "Maximum number of SMS parts per message (1-6)."
        },
        "recipients": {
          "$ref": "#/definitions/DistributionListRecipients"
        },
        "senderSource": {
          "$ref": "#/definitions/DistributionListSenderSource"
        }
      },
      "type": "object"
    },
    "DistributionListListItem": {
      "required": [
        "id",
        "name",
        "email",
        "membersCount"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 715,
          "description": "Distribution list ID."
        },
        "name": {
          "type": "string",
          "example": "Support alerts",
          "description": "Distribution list name."
        },
        "email": {
          "type": "string",
          "example": "ab12345678@distributionlists.textmagic.com",
          "description": "The auto-generated email address of the distribution list."
        },
        "membersCount": {
          "type": "integer",
          "example": 332,
          "description": "Total number of unique recipients."
        }
      },
      "type": "object"
    },
    "DistributionListRecipients": {
      "required": [
        "contactIds",
        "groupIds",
        "segmentIds",
        "numbers"
      ],
      "additionalProperties": false,
      "properties": {
        "contactIds": {
          "type": "array",
          "description": "IDs of individual contacts included in the list.",
          "items": {
            "type": "integer"
          },
          "example": [
            1,
            2
          ]
        },
        "groupIds": {
          "type": "array",
          "description": "IDs of contact lists (groups) included in the list.",
          "items": {
            "type": "integer"
          },
          "example": [
            3
          ]
        },
        "segmentIds": {
          "type": "array",
          "description": "IDs of segments (saved filter views) included in the list.",
          "items": {
            "type": "integer"
          },
          "example": [
            4,
            5
          ]
        },
        "numbers": {
          "type": "array",
          "description": "Plain phone numbers included in the list.",
          "items": {
            "type": "string"
          },
          "example": [
            "+15551234567"
          ]
        }
      },
      "type": "object"
    },
    "DistributionListSenderSource": {
      "properties": {
        "id": {
          "type": "integer",
          "x-nullable": true,
          "description": "ID of the sender number/entity the messages are sent from."
        },
        "phone": {
          "type": "string",
          "x-nullable": true,
          "example": "+15551234567",
          "description": "The resolved phone number or sender ID."
        },
        "type": {
          "type": "string",
          "x-nullable": true,
          "description": "Sender source type."
        },
        "countryId": {
          "type": "string",
          "x-nullable": true,
          "description": "Country of the sender number."
        },
        "label": {
          "type": "string",
          "x-nullable": true,
          "description": "Label of the sender number."
        },
        "status": {
          "type": "string",
          "x-nullable": true,
          "description": "Status of the sender number."
        },
        "carrierStatus": {
          "type": "string",
          "x-nullable": true,
          "description": "Carrier status of the sender number."
        }
      },
      "type": "object"
    },
    "UnsubscribedContact": {
      "required": [
        "id",
        "phone",
        "unsubscribeTime",
        "firstName",
        "lastName"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 27074,
          "description": "Unsubscribed contact ID."
        },
        "phone": {
          "type": "string",
          "example": 447860021130,
          "description": "Phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164)."
        },
        "unsubscribeTime": {
          "type": "string",
          "format": "date-time",
          "example": "2015-01-09T18:59:46+0000",
          "description": "Time when contact was opted-out."
        },
        "firstName": {
          "type": "string",
          "description": "Unsubscribed contact first name.",
          "example": "Charles",
          "x-nullable": true
        },
        "lastName": {
          "type": "string",
          "example": "Conway",
          "description": "Unsubscribed contact last name.",
          "x-nullable": true
        }
      },
      "type": "object"
    },
    "ContactNote": {
      "required": [
        "id",
        "createdAt",
        "note",
        "user"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 5,
          "description": "Contact note ID."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "example": "2015-06-19T09:48:24+0000",
          "description": "Contact note creation time."
        },
        "note": {
          "type": "string",
          "example": "Test note",
          "description": "Contact note text."
        },
        "user": {
          "$ref": "#/definitions/User"
        }
      },
      "type": "object"
    },
    "MessageTemplate": {
      "required": [
        "id",
        "name",
        "content",
        "lastModified"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 519,
          "description": "Template ID."
        },
        "name": {
          "type": "string",
          "example": "Appointment reminder",
          "description": "Template name."
        },
        "content": {
          "type": "string",
          "example": "Hello {First name}!",
          "description": "Template text. May contain dynamic fields inside braces. See the [Custom fields list](https://docs.textmagic.com/#tag/Templates/Custom-fields-list-(Merge-dynamic-fields))."
        },
        "lastModified": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true,
          "example": "2014-09-11T08:12:01+0000",
          "description": "Time when the template was last modified."
        }
      },
      "type": "object"
    },
    "MessageOut": {
      "required": [
        "id",
        "contactId",
        "sessionId",
        "messageTime",
        "status",
        "avatar",
        "text",
        "charset",
        "charsetLabel",
        "firstName",
        "lastName",
        "country",
        "partsCount"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 4991,
          "description": "Message ID."
        },
        "sender": {
          "type": "string",
          "example": 447624800500,
          "description": "Message sender (phone number or alphanumeric Sender ID).",
          "x-nullable": true
        },
        "receiver": {
          "type": "string",
          "example": 447860021130,
          "description": "Recipient`s phone number."
        },
        "text": {
          "type": "string",
          "example": "I love Textmagic!"
        },
        "status": {
          "enum": [
            "q",
            "s",
            "e",
            "r",
            "a",
            "d",
            "b",
            "f",
            "u",
            "j",
            "i",
            "p",
            "h"
          ],
          "example": "d",
          "description": "Delivery status of the message. See [message delivery statuses](https://docs.textmagic.com/#section/Delivery-status-codes) for details.\n"
        },
        "rejectReason": {
          "enum": [
            "a",
            "f",
            "l",
            "c",
            "u",
            "b",
            "s",
            "m",
            "n",
            "i",
            "if",
            "d",
            "t",
            "e",
            "h",
            "k",
            "r",
            "g",
            "j",
            "w",
            "v",
            "q",
            "x",
            "o",
            "p"
          ],
          "example": "a",
          "description": "Rejection reason."
        },
        "contactId": {
          "type": "integer",
          "example": 2764,
          "x-nullable": true,
          "description": "Recipient contact ID."
        },
        "sessionId": {
          "type": "integer",
          "example": 3122,
          "x-nullable": true,
          "description": "Message Session ID of a message."
        },
        "messageTime": {
          "type": "string",
          "format": "date-time",
          "example": "2019-08-12T11:43:37+0000",
          "description": "Sending time."
        },
        "avatar": {
          "type": "string",
          "example": "avatars/dummy_avatar.png",
          "x-nullable": true
        },
        "deleted": {
          "type": "boolean",
          "example": false,
          "description": "Indicates that the message has been deleted."
        },
        "deliveredAt": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true,
          "example": "2026-05-18T19:25:45+0000",
          "description": "Time when message was delivered."
        },
        "charset": {
          "type": "string",
          "example": "ISO-8859-1",
          "x-nullable": true,
          "description": "Message charset. Could be:\n*   **ISO-8859-1** for plaintext SMS;\n*   **UTF-16BE** for Unicode SMS.\n"
        },
        "charsetLabel": {
          "type": "string",
          "example": "ISO-8859-1",
          "x-nullable": true,
          "description": "Human-readable message charset label. Could be:\n*   **ISO-8859-1** for plaintext SMS;\n*   **UTF-16BE** for Unicode SMS;\n*   **Voice** for voice services (Text-to-Speech or Voice Broadcast) messages.\n"
        },
        "firstName": {
          "type": "string",
          "example": "John",
          "x-nullable": true,
          "description": "Contact first name. Could be substituted from your [Contacts](https://docs.textmagic.com/#tag/Contacts) (even if you submitted the phone number instead of the contact ID).\n"
        },
        "lastName": {
          "type": "string",
          "example": "Conway",
          "x-nullable": true,
          "description": "Contact last name."
        },
        "country": {
          "type": "string",
          "example": "US",
          "x-nullable": true,
          "description": "The 2-letter ISO country code of the recipient's phone number.\n"
        },
        "phone": {
          "type": "string",
          "example": "447624800500",
          "x-nullable": true,
          "description": "Receipent`s phone number."
        },
        "price": {
          "type": "number",
          "format": "float",
          "example": 0.025,
          "x-nullable": true,
          "description": "Message price."
        },
        "partsCount": {
          "type": "integer",
          "example": 6,
          "x-nullable": true,
          "description": "Message parts (multiples of 160 characters) count."
        },
        "fromEmail": {
          "type": "string",
          "example": "test@email.com",
          "x-nullable": true,
          "description": "The user email which this message came from. For Email2SMS and Distribution Lists the messages, it is an original email address - in other cases, it is an account email address."
        },
        "fromNumber": {
          "type": "string",
          "example": "447624800500",
          "x-nullable": true,
          "description": "The Phone number used to send the SMS."
        },
        "senderSource": {
          "properties": {
            "id": {
              "type": "integer",
              "x-nullable": true
            },
            "phone": {
              "type": "string",
              "x-nullable": true
            },
            "type": {
              "type": "string",
              "x-nullable": true
            },
            "countryId": {
              "type": "string",
              "x-nullable": true
            },
            "label": {
              "type": "string",
              "x-nullable": true
            },
            "status": {
              "type": "string",
              "x-nullable": true
            },
            "carrierStatus": {
              "type": "string",
              "x-nullable": true
            }
          }
        },
        "session": {
          "properties": {
            "id": {
              "type": "integer",
              "x-nullable": true
            },
            "startTime": {
              "type": "string",
              "x-nullable": true
            },
            "text": {
              "type": "string",
              "x-nullable": true
            },
            "price": {
              "type": "number",
              "format": "float",
              "x-nullable": true
            },
            "numbersCount": {
              "type": "integer",
              "x-nullable": true
            },
            "destination": {
              "type": "string",
              "x-nullable": true
            },
            "source": {
              "type": "string",
              "x-nullable": true
            },
            "referenceId": {
              "type": "string",
              "x-nullable": true
            },
            "initiatorId": {
              "type": "integer",
              "x-nullable": true
            }
          }
        }
      },
      "type": "object"
    },
    "MessagesIcs": {
      "required": [
        "id",
        "nextSend",
        "rrule",
        "session",
        "lastSent",
        "contactName",
        "parameters",
        "type",
        "summary",
        "textParameters",
        "firstOccurrence",
        "lastOccurrence",
        "recipientsCount",
        "timezone",
        "completed",
        "avatar",
        "createdAt"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 562,
          "description": "Schedule ID."
        },
        "nextSend": {
          "type": "string",
          "format": "date-time",
          "example": "2014-10-13T05:00:00+0000",
          "description": "The next send date in [ISO 8601](https://en.wikipedia.org/?title=ISO_8601) format.\n"
        },
        "rrule": {
          "type": "string",
          "example": "FREQ=DAILY;INTERVAL=2;COUNT=5;",
          "x-nullable": true,
          "description": "[iCal RRULE](http://www.kanzaki.com/docs/ical/rrule.html) string.\n"
        },
        "session": {
          "$ref": "#/definitions/MessageSession"
        },
        "lastSent": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true,
          "example": "2015-06-19T09:48:24+0000",
          "description": "The date and time when the last message was sent."
        },
        "contactName": {
          "type": "string",
          "example": "15 recipients",
          "description": "Aggregated contact information. If the message was scheduled to be sent to a single contact, a full name will be returned here. Otherwise, a total amount of contacts will be returned."
        },
        "parameters": {
          "required": [
            "text",
            "recipients"
          ],
          "properties": {
            "text": {
              "type": "string",
              "example": "I Love Textmagic!",
              "description": "Scheduled message text."
            },
            "recipients": {
              "required": [
                "contacts",
                "groups",
                "numbers",
                "filteredViews"
              ],
              "properties": {
                "contacts": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "example": 39318,
                    "description": "Contact ID to send a message."
                  }
                },
                "groups": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "example": 39318,
                    "description": "List ID to send a message."
                  }
                },
                "numbers": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "example": "447860021130",
                    "description": "Phone number to send the message."
                  }
                },
                "filteredViews": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "example": 39318,
                    "description": "Filtered View ID to send a message."
                  }
                }
              }
            }
          }
        },
        "type": {
          "type": "string",
          "example": "once",
          "enum": [
            "Once",
            "Hourly",
            "Daily",
            "Weekly",
            "Monthly",
            "Yearly"
          ]
        },
        "summary": {
          "type": "string",
          "example": "Every 2 weeks on Monday, Tuesday, Thursday at 10:30 (UTC+03:00)",
          "description": "A human-readable summary of the sending schedule."
        },
        "textParameters": {
          "required": [
            "cost",
            "parts",
            "chars",
            "encoding",
            "countries",
            "charsetLabel"
          ],
          "properties": {
            "cost": {
              "type": "number",
              "example": 0.04,
              "description": "Cost to check that one number is constant – 0.04 in your account currency.",
              "x-nullable": true
            },
            "parts": {
              "type": "integer",
              "example": 6,
              "x-nullable": true,
              "description": "Message parts (multiples of 160 characters) count."
            },
            "chars": {
              "type": "integer",
              "example": 125,
              "x-nullable": true,
              "description": "Characters count."
            },
            "encoding": {
              "type": "string",
              "example": "ISO-8859-1",
              "enum": [
                "ISO-8859-1",
                "UTF-16BE"
              ],
              "x-nullable": true,
              "description": "Message charset. Could be:\n* **ISO-8859-1** – for plaintext SMS;\n* **UTF-16BE** – for Unicode SMS.\n"
            },
            "countries": {
              "type": "array",
              "items": {
                "type": "string",
                "example": "US",
                "description": "The 2-letter ISO country ID."
              },
              "x-nullable": true
            },
            "charsetLabel": {
              "type": "string",
              "example": "ISO-8859-1",
              "x-nullable": true,
              "description": "Human-readable message charset label. Could be:\n*   **ISO-8859-1** for plaintext SMS;\n*   **UTF-16BE** for Unicode SMS;\n*   **Voice** for voice services (Text-to-Speech or Voice Broadcast) messages.\n"
            }
          }
        },
        "firstOccurrence": {
          "type": "string",
          "format": "date-time",
          "example": "2015-06-19T09:48:24+0000",
          "x-nullable": true,
          "description": "First occurence date."
        },
        "lastOccurrence": {
          "type": "string",
          "format": "date-time",
          "example": "2015-06-19T09:48:24+0000",
          "x-nullable": true,
          "description": "Last occurence date (could be `null` if the schedule is endless)."
        },
        "recipientsCount": {
          "type": "integer",
          "example": 2,
          "x-nullable": true,
          "description": "Amount of actual recipients."
        },
        "timezone": {
          "type": "string",
          "example": "Europe/Tallinn",
          "description": "User-friendly timezone name (with spaces replaced by underscores)."
        },
        "completed": {
          "type": "boolean",
          "example": true,
          "description": "Indicates that scheduling has been completed."
        },
        "avatar": {
          "type": "string",
          "example": "avatars/dummy_avatar.png",
          "x-nullable": true,
          "description": "A relative link to the contact avatar."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "example": "2015-06-19T09:48:24+0000",
          "description": "Scheduling creation time."
        }
      },
      "type": "object"
    },
    "MessageIn": {
      "required": [
        "id",
        "sender",
        "receiver",
        "messageTime",
        "text",
        "avatar"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 1782832,
          "description": "The ID of the inbound message."
        },
        "sender": {
          "type": "string",
          "example": "447860021130",
          "description": "The sender’s phone number."
        },
        "receiver": {
          "type": "string",
          "example": "447624800500",
          "x-nullable": true,
          "description": "The receiver’s phone number (i.e. your dedicated or shared reply number)."
        },
        "messageTime": {
          "type": "string",
          "format": "date-time",
          "example": "2012-11-28T18:38:28+0000",
          "description": "The time when the message reached the Textmagic API endpoint."
        },
        "text": {
          "type": "string",
          "example": "I Love Textmagic!",
          "description": "The text from the received message."
        },
        "contactId": {
          "type": "integer",
          "example": 1,
          "x-nullable": true,
          "description": "Sender contact ID."
        },
        "firstName": {
          "type": "string",
          "example": "Charles",
          "x-nullable": true,
          "description": "Sender contact first name."
        },
        "lastName": {
          "type": "string",
          "example": "Conway",
          "x-nullable": true,
          "description": "Sender contact last name."
        },
        "avatar": {
          "x-nullable": true,
          "type": "string",
          "example": "avatars/dummy_avatar.png"
        },
        "email": {
          "type": "string",
          "example": "charles@example.com",
          "x-nullable": true,
          "description": "Sender email."
        },
        "contactUserId": {
          "type": "integer",
          "x-nullable": true
        },
        "userId": {
          "type": "integer",
          "x-nullable": true
        }
      },
      "type": "object"
    },
    "MessageSession": {
      "x-nullable": true,
      "required": [
        "id",
        "startTime",
        "text",
        "source",
        "referenceId",
        "price",
        "numbersCount",
        "destination",
        "initiatorId",
        "title"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 4991,
          "description": "Session ID."
        },
        "startTime": {
          "type": "string",
          "x-nullable": true,
          "example": "2015-06-19T09:48:24+0000",
          "description": "Session creation time."
        },
        "text": {
          "type": "string",
          "example": "Hello {First name}!",
          "x-nullable": true,
          "description": "Session text. If a template was used for the session text (see [Messages: Send](https://docs.textmagic.com/#tag/Outbound-Messages) for details), it may contain template tags.\n"
        },
        "source": {
          "type": "string",
          "example": "O",
          "x-nullable": true,
          "description": "*   **O** – for Textmagic Online;\n*   **A** – for API;\n*   **M** – for Textmagic Messenger;\n*   **E** – for [Email to SMS](https://docs.textmagic.com/#tag/Send-Email-to-SMS);\n*   **X** – for [Distribution Lists](https://docs.textmagic.com/#tag/Distribution-Lists).\n"
        },
        "referenceId": {
          "type": "string",
          "example": "my_reference_id_4991",
          "x-nullable": true,
          "description": "Custom reference ID (see [Messages: Send](https://docs.textmagic.com/#tag/Send-Email-to-SMS) for details).\n"
        },
        "price": {
          "type": "number",
          "example": 3.45,
          "description": "Session cost (in account currency).",
          "x-nullable": true
        },
        "numbersCount": {
          "type": "integer",
          "example": 18,
          "description": "Session recipient count.",
          "x-nullable": true
        },
        "destination": {
          "type": "string",
          "example": "t",
          "x-nullable": true,
          "enum": [
            "t",
            "s",
            "v"
          ],
          "description": "Destination type of a Message Session:\n* **t** – text SMS;\n* **s** – text-to-speech;\n* **v** – voice broadcast.\n"
        },
        "initiatorId": {
          "type": "integer",
          "example": 305,
          "x-nullable": true,
          "description": "Initiator ID."
        },
        "title": {
          "type": "string",
          "x-nullable": true
        }
      },
      "type": "object"
    },
    "BulkSession": {
      "required": [
        "id",
        "status",
        "itemsProcessed",
        "itemsTotal",
        "createdAt",
        "session",
        "text"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 599,
          "description": "Bulk Session ID."
        },
        "status": {
          "type": "string",
          "example": "n",
          "enum": [
            "n",
            "w",
            "f",
            "c",
            "s"
          ],
          "description": "* **n** – bulk session is just created\n* **w** - work in progress\n* **f** - failed\n* **c** - completed with success\n* **s** - suspended\n"
        },
        "itemsProcessed": {
          "type": "integer",
          "example": 564,
          "x-nullable": true,
          "description": "Amount of messages already processed."
        },
        "itemsTotal": {
          "type": "integer",
          "example": 2,
          "x-nullable": true,
          "description": "Total amount of messages to be processed."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "example": "2015-01-08T06:13:21+0000",
          "description": "Creation date and time of a Bulk Session."
        },
        "session": {
          "$ref": "#/definitions/MessageSession"
        },
        "text": {
          "type": "string",
          "example": "I Love Textmagic!",
          "description": "Message text of a Bulk Session.",
          "x-nullable": true
        }
      },
      "type": "object"
    },
    "UserStatement": {
      "required": [
        "id",
        "userId",
        "date",
        "balance",
        "delta",
        "type",
        "value",
        "comment"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 305,
          "description": "User statement ID."
        },
        "userId": {
          "type": "integer",
          "example": 4627,
          "x-nullable": true,
          "description": "User ID."
        },
        "date": {
          "type": "string",
          "format": "date-time",
          "example": "2014-09-19T00:00:00+0000",
          "description": "User statement date."
        },
        "balance": {
          "type": "number",
          "format": "double",
          "example": 101.05,
          "x-nullable": true
        },
        "delta": {
          "type": "number",
          "format": "float",
          "example": -0.15,
          "x-nullable": true,
          "description": "Balance change amount."
        },
        "type": {
          "type": "string",
          "example": "sms",
          "description": "Type of statement (what you have been charged for):\n*   **sms** - for sending SMS\n*   **number** - for renewing a dedicated number;\n*   **schedule** - for scheduling text messages;\n*   **topup** - for adding credits to your account.\n"
        },
        "value": {
          "type": "string",
          "example": 350,
          "x-nullable": true,
          "description": "Value differs by **type**:\n*   for **sms**, it is the sent messages amount;\n*   for **number**, it is a dedicated phone number;\n*   for **schedule**, it is a scheduled messages amount;\n*   for **top-up**, it is an invoice ID.\n"
        },
        "comment": {
          "type": "string",
          "example": "This is a test comment",
          "x-nullable": true,
          "description": "Optional comment."
        }
      },
      "type": "object"
    },
    "Invoice": {
      "required": [
        "id",
        "bundle",
        "currency",
        "vat",
        "paymentMethod"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "description": "The invoice ID.",
          "example": 1099
        },
        "bundle": {
          "type": "integer",
          "description": "Top-up amount.",
          "example": 200
        },
        "currency": {
          "type": "string",
          "description": "Top-up currency.",
          "example": "USD"
        },
        "vat": {
          "type": "number",
          "format": "float",
          "description": "VAT charged (if any).",
          "example": 2
        },
        "paymentMethod": {
          "type": "string",
          "x-nullable": true,
          "example": "MasterCard ending in 1234",
          "description": "Payment method description."
        }
      },
      "type": "object"
    },
    "Chat": {
      "required": [
        "id",
        "originalId",
        "phone",
        "contact",
        "unsubscribedContactId",
        "unread",
        "updatedAt",
        "status",
        "mute",
        "lastMessage",
        "direction",
        "replyOptionsType",
        "from",
        "mutedUntil",
        "timeLeftMute",
        "country",
        "pinned",
        "type",
        "smsPrice",
        "mmsPrice",
        "assigneeId",
        "createdAt",
        "messageTime"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 43328,
          "description": "Chat ID."
        },
        "originalId": {
          "type": "integer",
          "example": 43328,
          "x-nullable": true,
          "deprecated": true
        },
        "phone": {
          "type": "string",
          "example": 447860021130,
          "description": "Chat partner's phone number."
        },
        "contact": {
          "$ref": "#/definitions/Contact"
        },
        "unsubscribedContactId": {
          "type": "integer",
          "example": 546,
          "x-nullable": true,
          "description": "If this field has a value, it means that the chat phone number has been unsubscribed from you and this value is an ID of an Unsubscribed contact entity. See [Get all unsubscribed contacts](https://docs.textmagic.com/#operation/getUnsubscribers)."
        },
        "unread": {
          "type": "integer",
          "example": 5,
          "description": "Total unread incoming messages."
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "example": "2015-01-08T06:13:21+0000",
          "description": "Time when the last incoming message arrived at this chat."
        },
        "status": {
          "description": "Chat status:\n  * **a** - Active;\n  * **c** - Closed;\n  * **d** - Deleted.\n",
          "type": "string",
          "enum": [
            "a",
            "c",
            "d"
          ]
        },
        "mute": {
          "type": "integer",
          "example": 0,
          "enum": [
            0,
            1
          ],
          "description": "Indicates when the chat is muted."
        },
        "lastMessage": {
          "type": "string",
          "example": "Hello world!",
          "x-nullable": true,
          "description": "The last message content of a chat."
        },
        "direction": {
          "type": "string",
          "x-nullable": true,
          "enum": [
            "ci",
            "co",
            "i",
            "o"
          ],
          "description": "Last message type:\n* **ci** - incoming call;\n* **co** - outgoing call;\n* **i** - incoming message;\n* **o** - outgoing message.\n"
        },
        "replyOptionsType": {
          "type": "string",
          "x-nullable": true,
          "example": "user_carrier_twilio",
          "description": "Used for chats prices."
        },
        "from": {
          "type": "string",
          "x-nullable": true,
          "example": 447860021130,
          "description": "If filled, the value will be used as a sender number for all outgoing messages of a chat."
        },
        "mutedUntil": {
          "type": "string",
          "x-nullable": true,
          "description": "Date and time until the chat will be muted.",
          "format": "date-time",
          "example": "2019-10-10T14:44:00+0000"
        },
        "timeLeftMute": {
          "type": "integer",
          "description": "Time left untill the chat will be unmuted (seconds).",
          "example": 17988
        },
        "country": {
          "$ref": "#/definitions/Country"
        },
        "pinned": {
          "type": "boolean",
          "x-nullable": true,
          "example": true,
          "description": "Indicates when the chat is pinned."
        },
        "type": {
          "type": "string",
          "example": "sms",
          "description": "Chat type."
        },
        "smsPrice": {
          "type": "number",
          "example": 12.34
        },
        "mmsPrice": {
          "type": "number",
          "example": 12.34
        },
        "tags": {
          "items": {
            "$ref": "#/definitions/Tag",
            "description": "Tags"
          },
          "type": "array"
        },
        "assigneeId": {
          "type": "integer",
          "x-nullable": true,
          "example": 1
        },
        "updatedBy": {
          "$ref": "#/definitions/NullableUserPersonalInfo"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "example": "2015-01-08T06:13:21+0000",
          "description": "Chat creation date and time."
        },
        "messageTime": {
          "type": "string",
          "format": "date-time",
          "example": "2015-01-08T06:13:21+0000",
          "description": "Chat last message date and time."
        },
        "conversationEnded": {
          "type": "boolean",
          "x-nullable": true,
          "example": true,
          "description": "Indicates whether the live chat conversation has ended. Null for non-live chats."
        },
        "rating": {
          "type": "object",
          "x-nullable": true,
          "description": "Live chat satisfaction survey result. Null when the chat has no rating.",
          "properties": {
            "rate": {
              "type": "string",
              "enum": [
                "good",
                "poor",
                "no-rate"
              ],
              "example": "good",
              "description": "Satisfaction survey reaction."
            },
            "comment": {
              "type": "string",
              "x-nullable": true,
              "example": "Great support!",
              "description": "Optional survey comment left by a contact."
            }
          }
        }
      },
      "type": "object"
    },
    "Conversation": {
      "required": [
        "id",
        "direction",
        "sender",
        "messageTime",
        "text",
        "receiver",
        "status",
        "firstName",
        "lastName",
        "sessionId"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 1
        },
        "direction": {
          "type": "string",
          "example": "in",
          "enum": [
            "in",
            "out",
            "o",
            "i"
          ],
          "description": "Message type: inbound or outbound.\n"
        },
        "sender": {
          "type": "string",
          "x-nullable": true,
          "example": 447860021130,
          "description": "Sender phone number."
        },
        "messageTime": {
          "type": "string",
          "format": "date-time",
          "description": "Time when  the message arrived at Textmagic.",
          "example": "2012-11-28T18:38:28+0000"
        },
        "text": {
          "type": "string",
          "example": "This is a sample message",
          "description": "Message text."
        },
        "receiver": {
          "type": "string",
          "example": 447624800500,
          "description": "Receiver's phone number."
        },
        "status": {
          "type": "string",
          "example": "d",
          "description": "Message status (for chats outbound only). See [message delivery statuses](https://docs.textmagic.com/#section/Delivery-status-codes) for details."
        },
        "firstName": {
          "type": "string",
          "example": "Charles",
          "description": "Contact first name."
        },
        "lastName": {
          "type": "string",
          "example": "Conway",
          "description": "Contact last name."
        },
        "sessionId": {
          "type": "integer",
          "x-nullable": true,
          "description": "Session ID of a message. See [message sessions](https://docs.textmagic.com/#tag/Outbound-Message-Sessions) for details."
        },
        "initiatorId": {
          "type": "integer",
          "x-nullable": true,
          "description": "Initiator ID of a message. See [message sessions](https://docs.textmagic.com/#tag/Outbound-Message-Sessions) for details."
        },
        "messageFileId": {
          "type": "integer",
          "x-nullable": true,
          "description": "Message file id."
        },
        "type": {
          "type": "string",
          "example": "text",
          "enum": [
            "text",
            "image",
            "audio",
            "voice",
            "document",
            "video",
            "log",
            "initial",
            "note"
          ],
          "description": "Message type."
        },
        "chatType": {
          "type": "string",
          "example": "text",
          "enum": [
            "sms",
            "facebook_messenger",
            "instagram",
            "whatsapp_business",
            "live_chat"
          ],
          "description": "Chat type."
        },
        "chatId": {
          "type": "integer",
          "x-nullable": false,
          "description": "Chat id."
        },
        "isEdited": {
          "type": "boolean",
          "example": false
        },
        "errorCode": {
          "type": "string",
          "example": "test_error_code",
          "description": "Error code.",
          "x-nullable": true
        },
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/File"
          }
        },
        "payload": {
          "$ref": "#/definitions/MessagePayload"
        },
        "avatar": {
          "type": "string",
          "example": "avatars/dummy_avatar.png",
          "x-nullable": true
        }
      },
      "type": "object"
    },
    "MessagePayload": {
      "x-nullable": true,
      "required": [
        "type",
        "mediaPreview"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "example": "story_reply",
          "description": "Payload type."
        },
        "mediaPreview": {
          "type": "string",
          "example": "https://example.com/preview.jpg",
          "description": "Media preview link."
        }
      }
    },
    "File": {
      "required": [
        "id",
        "name",
        "originalName",
        "mimeType",
        "size",
        "type",
        "createdAt"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": "f90115c0-7ad8-44a5-a863-a4b8f00df248"
        },
        "name": {
          "type": "string",
          "example": "image-66aba1bc787b40.51413958.png"
        },
        "originalName": {
          "type": "string",
          "example": "image.png"
        },
        "mimeType": {
          "type": "string",
          "example": "image/png"
        },
        "size": {
          "type": "integer",
          "example": 1024
        },
        "type": {
          "type": "string",
          "example": "text",
          "enum": [
            "attachment",
            "import",
            "raw_email",
            "inline_attachment",
            "chat-attachment",
            "knowledge_base",
            "facebook_page_picture",
            "instagram_account_picture",
            "logo"
          ],
          "description": "File type."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "previewUrl": {
          "type": "string",
          "example": "https://example.com/image-preview.jpg"
        },
        "url": {
          "type": "string",
          "example": "https://example.com/image.png"
        },
        "metadata": {
          "$ref": "#/definitions/FileMetadata"
        }
      }
    },
    "FileMetadata": {
      "x-nullable": true,
      "required": [
        "type",
        "height",
        "width",
        "preview"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "example": "text",
          "enum": [
            "image",
            "video"
          ],
          "description": "File metadata type."
        },
        "height": {
          "type": "integer",
          "example": 1024
        },
        "width": {
          "type": "integer",
          "example": 1024
        },
        "preview": {
          "$ref": "#/definitions/FileMetadataPreview"
        }
      }
    },
    "FileMetadataPreview": {
      "x-nullable": true,
      "required": [
        "height",
        "width"
      ],
      "additionalProperties": false,
      "properties": {
        "height": {
          "type": "integer",
          "example": 1024
        },
        "width": {
          "type": "integer",
          "example": 1024
        }
      }
    },
    "Survey": {
      "required": [
        "id",
        "name",
        "status",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 1
        },
        "name": {
          "type": "string",
          "example": "My test survey"
        },
        "status": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "receipents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SurveyRecipient"
          }
        },
        "countries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SurveySenderCountries"
          }
        }
      },
      "type": "object"
    },
    "SurveyRecipient": {
      "required": [
        "phone"
      ],
      "additionalProperties": false,
      "properties": {
        "phone": {
          "type": "string"
        }
      }
    },
    "SurveySenderCountries": {
      "required": [
        "id",
        "fromNumber",
        "countryName",
        "allowDedicated"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 1
        },
        "countryName": {
          "type": "string",
          "example": "GB"
        },
        "fromNumber": {
          "type": "string",
          "example": "447860021130"
        },
        "allowDedicated": {
          "type": "boolean",
          "example": true,
          "description": "Is allowed to use a dedicated number?"
        }
      }
    },
    "Currency": {
      "required": [
        "id",
        "unicodeSymbol",
        "htmlSymbol"
      ],
      "properties": {
        "id": {
          "type": "string",
          "example": "GBP",
          "description": "The 3-letter ISO currency ID."
        },
        "unicodeSymbol": {
          "type": "string",
          "example": "£",
          "description": "Unicode-compatible currency symbol."
        },
        "htmlSymbol": {
          "type": "string",
          "example": "&pound;",
          "description": "HTML-compatible currency symbol."
        }
      },
      "type": "object"
    },
    "Country": {
      "x-nullable": true,
      "required": [
        "id",
        "name"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "example": "US",
          "description": "The 2-letter ISO country ID."
        },
        "name": {
          "type": "string",
          "example": "India",
          "description": "Full country name."
        }
      },
      "type": "object"
    },
    "Timezone": {
      "additionalProperties": false,
      "required": [
        "id",
        "area",
        "dst",
        "offset",
        "timezone"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "example": 55,
          "description": "Internal timezone ID."
        },
        "area": {
          "type": "string",
          "example": "Europe",
          "description": "Timezone area."
        },
        "dst": {
          "type": "integer",
          "example": 1,
          "description": "Is daylight saving time used in this timezone?"
        },
        "offset": {
          "type": "integer",
          "example": 10800,
          "description": "Offset from UTC time in seconds. In this example, it is 21600/60/60=6 hours."
        },
        "timezone": {
          "type": "string",
          "example": "Europe\\/Tallinn",
          "description": "User-friendly timezone name (with spaces replaced by underscores)."
        }
      },
      "type": "object"
    },
    "UserImage": {
      "x-nullable": true,
      "additionalProperties": false,
      "required": [
        "href"
      ],
      "properties": {
        "href": {
          "type": "string",
          "example": "avatars/lav5d8de21d89971646555094.png",
          "description": "The URI of a user avatar."
        }
      },
      "type": "object"
    },
    "ContactCustomField": {
      "properties": {
        "value": {
          "type": "string"
        },
        "userCustomField": {
          "$ref": "#/definitions/UserCustomField"
        }
      },
      "type": "object"
    },
    "CustomFieldValues": {
      "properties": {
        "fieldId": {
          "type": "integer"
        },
        "fieldTitle": {
          "type": "string"
        },
        "fieldType": {
          "type": "string"
        },
        "value": {
          "type": "object"
        }
      },
      "type": "object"
    },
    "ContactImage": {
      "x-nullable": true,
      "required": [
        "href"
      ],
      "additionalProperties": false,
      "properties": {
        "href": {
          "type": "string",
          "example": "avatars/lav5d8de21d89971646555094.png",
          "description": "The URI of a contact avatar."
        }
      },
      "type": "object"
    },
    "ListImage": {
      "x-nullable": true,
      "required": [
        "href"
      ],
      "additionalProperties": false,
      "properties": {
        "href": {
          "type": "string",
          "example": "avatars/lav5d8de21d89971646555094.png",
          "description": "The URI of a list avatar."
        }
      },
      "type": "object"
    },
    "SurveyNode": {
      "required": [
        "id",
        "label",
        "body",
        "nodeType",
        "isEndNode",
        "sendDelay",
        "startNodes",
        "endNodes"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 1
        },
        "label": {
          "type": "string",
          "example": "Question 1"
        },
        "body": {
          "type": "string",
          "example": "Hello {First name}! Would you like to participate in a short survey? To continue, just reply Yes."
        },
        "nodeType": {
          "type": "string",
          "example": "q"
        },
        "isEndNode": {
          "type": "boolean",
          "example": false
        },
        "sendDelay": {
          "type": "integer",
          "example": 0
        },
        "startNodes": {
          "type": "array",
          "items": {
            "type": "string",
            "example": "1"
          },
          "x-nullable": true
        },
        "endNodes": {
          "type": "array",
          "items": {
            "type": "string",
            "example": "1"
          },
          "x-nullable": true
        }
      }
    },
    "MessagingStatItem": {
      "required": [
        "replyRate",
        "date",
        "deliveryRate",
        "costs",
        "messagesReceived",
        "messagesSentDelivered",
        "messagesSentAccepted",
        "messagesSentBuffered",
        "messagesSentFailed",
        "messagesSentRejected",
        "messagesSentParts"
      ],
      "additionalProperties": false,
      "properties": {
        "replyRate": {
          "type": "number",
          "format": "float",
          "example": 0.32,
          "x-nullable": true,
          "description": "The number of incoming messages divided by the number of total messages."
        },
        "date": {
          "type": "string",
          "format": "date-time",
          "x-nullable": true,
          "example": "2014-09-19T00:00:00+0000",
          "description": "Time interval start: empty if the **by** parameter was set to **off**.\n"
        },
        "deliveryRate": {
          "type": "number",
          "format": "float",
          "example": 0.95,
          "x-nullable": true,
          "description": "Message delivery rate:the number of delivered messages divided by the number of total messages."
        },
        "costs": {
          "type": "number",
          "format": "float",
          "example": 30.15,
          "x-nullable": true,
          "description": "Cost for sent messages during this period. The costs are in the [Account](https://docs.textmagic.com/#tag/User) currency.\n"
        },
        "messagesReceived": {
          "type": "integer",
          "example": 1085,
          "x-nullable": true,
          "description": "Total received messages count."
        },
        "messagesSentDelivered": {
          "type": "integer",
          "example": 11893,
          "x-nullable": true,
          "description": "Delivered messages count. As messages are retried for up to 48 hours, this value could change."
        },
        "messagesSentAccepted": {
          "type": "integer",
          "example": 2,
          "x-nullable": true,
          "description": "Messages accepted for delivery (in queue) but not yet delivered."
        },
        "messagesSentBuffered": {
          "type": "integer",
          "example": 0,
          "x-nullable": true,
          "description": "Messages buffered by endpoint cell phone operators."
        },
        "messagesSentFailed": {
          "type": "integer",
          "example": 3,
          "x-nullable": true,
          "description": "Messages that have failed for whatever reason, e.g. the destination phone was switched off for 48 hours or the recipient's phone account is out of service."
        },
        "messagesSentRejected": {
          "type": "integer",
          "example": 50,
          "x-nullable": true,
          "description": "Messages that were rejected: invalid Sender ID used (e.g. you cannot use the Sender ID or your own mobile number when sending to the United States and Canada.)\n"
        },
        "messagesSentParts": {
          "type": "integer",
          "example": 15080,
          "x-nullable": true,
          "description": "Total sent messages **parts** count. Note that this is not equal to the sent messages count, because one message could consist of 1 to 6 parts and users are charged per part, not per message."
        }
      },
      "type": "object"
    },
    "PushToken": {
      "type": "object",
      "required": [
        "type",
        "token"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "example": "a",
          "enum": [
            "a",
            "g",
            "f"
          ],
          "description": "type of the token:\n* **GCM** — Google Cloud Messaging\n* **APN** — Apple Push Notification\n* **FCM** — Firebase Cloud Messaging\n"
        },
        "token": {
          "type": "string",
          "example": "03df25c845d460bcdad7802d2vf6fc1dfde97283bf75cc993eb6dca835ea2e2",
          "description": "Push token value."
        }
      }
    },
    "SubaccountWithToken": {
      "x-internal": true,
      "required": [
        "id",
        "username",
        "firstName",
        "lastName",
        "email",
        "status",
        "balance",
        "phone",
        "company",
        "currency",
        "country",
        "timezone",
        "subaccountType",
        "emailAccepted",
        "phoneAccepted",
        "avatar",
        "token"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 1,
          "description": "Sub-account ID."
        },
        "username": {
          "type": "string",
          "example": "charles.conway",
          "description": "Username."
        },
        "firstName": {
          "type": "string",
          "example": "Charles",
          "description": "Account first name."
        },
        "lastName": {
          "type": "string",
          "example": "Conway",
          "description": "Account last name."
        },
        "email": {
          "type": "string",
          "example": "charles@example.com",
          "description": "Account Email address."
        },
        "status": {
          "type": "string",
          "enum": [
            "A",
            "T"
          ],
          "description": "Current account status:\n* **A** for Active;\n* **T** for Trial.\n"
        },
        "balance": {
          "type": "number",
          "format": "double",
          "example": 208.64,
          "description": "Account balance (in account currency)."
        },
        "phone": {
          "type": "string",
          "example": "447860021130",
          "description": "Contact phone number."
        },
        "company": {
          "type": "string",
          "example": "Example Ltd.",
          "description": "Account company name."
        },
        "currency": {
          "$ref": "#/definitions/Currency"
        },
        "country": {
          "$ref": "#/definitions/Country"
        },
        "timezone": {
          "$ref": "#/definitions/Timezone"
        },
        "subaccountType": {
          "type": "string",
          "description": "Type of account:\n*   **A** for Administrator sub-account;\n*   **U** for Regular User.\n",
          "enum": [
            "A",
            "U"
          ],
          "example": "U"
        },
        "emailAccepted": {
          "type": "boolean",
          "example": true,
          "description": "Does the account have a confirmed Email?."
        },
        "phoneAccepted": {
          "type": "boolean",
          "example": true,
          "description": "Does the account have a confirmed Phone Number?."
        },
        "avatar": {
          "$ref": "#/definitions/UserImage"
        },
        "token": {
          "type": "string",
          "example": "RANDOM_TOKEN",
          "description": "Access token of account."
        }
      }
    },
    "FavoriteContact": {
      "required": [
        "entityId",
        "entityType",
        "primaryLabel",
        "secondaryLabel",
        "tertiaryLabel",
        "avatar"
      ],
      "additionalProperties": true,
      "properties": {
        "entityId": {
          "type": "integer",
          "example": 629,
          "description": "List or Contact ID."
        },
        "entityType": {
          "type": "string",
          "example": "contact",
          "description": "Entity type which should be marked as **favorite**.",
          "enum": [
            "list",
            "contact"
          ]
        },
        "primaryLabel": {
          "type": "string",
          "example": "Favorite contact name.",
          "description": "Contact first name/last name if entityType is **contact**; List name if entity type is **list**."
        },
        "secondaryLabel": {
          "type": "string",
          "example": "45",
          "description": "Phone number if entityType is **contact**; List contacts number if entity type is **list**."
        },
        "tertiaryLabel": {
          "type": "string",
          "x-nullable": true,
          "example": "Australia",
          "description": "Contact country if entityType is **contact**; else, null."
        },
        "avatar": {
          "type": "string",
          "example": "avatars/dummy_avatar.png",
          "x-nullable": true
        }
      }
    },
    "CustomFieldListItem": {
      "required": [
        "id",
        "userCustomFieldId",
        "name",
        "value",
        "createdAt"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "example": 515,
          "description": "Custom Field ID."
        },
        "userCustomFieldId": {
          "type": "integer",
          "example": 515,
          "description": "Old property custom Field ID."
        },
        "name": {
          "type": "string",
          "example": "Custom name",
          "description": "Custom Field name."
        },
        "value": {
          "type": "string",
          "example": "Custom value",
          "description": "Custom Field value."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "example": "2015-02-11T07:33:19+0000",
          "description": "Custom field creation time."
        }
      }
    },
    "MessagePriceItem": {
      "required": [
        "name",
        "price",
        "country"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "example": "United Kingdom",
          "description": "Country name."
        },
        "price": {
          "type": "string",
          "example": "0.049",
          "description": "Price to send message to desired country."
        },
        "country": {
          "type": "string",
          "example": "UK",
          "description": "The 2-letter ISO country code of the recipient's phone number."
        }
      }
    },
    "SenderSettingsItem": {
      "required": [
        "country",
        "phone"
      ],
      "additionalProperties": false,
      "properties": {
        "country": {
          "type": "string",
          "example": "US",
          "description": "The 2-letter ISO country code of the recipient's phone number.\n"
        },
        "phone": {
          "type": "string",
          "example": "+447937946700",
          "description": "Phone enabled for sending to a specified country."
        }
      }
    },
    "GetMessagePriceResponseCountriesItem": {
      "required": [
        "country",
        "countryName",
        "allowDedicated",
        "count",
        "max",
        "sum",
        "landline"
      ],
      "additionalProperties": false,
      "properties": {
        "country": {
          "type": "string",
          "example": "US",
          "description": "The 2-letter ISO country code."
        },
        "countryName": {
          "type": "string",
          "example": "United State",
          "description": "Country name."
        },
        "allowDedicated": {
          "type": "boolean",
          "example": true,
          "description": "Is allowed to use a dedicated number?"
        },
        "count": {
          "type": "number",
          "example": 1,
          "description": "Parts count to send."
        },
        "max": {
          "type": "number",
          "example": 6,
          "description": "Maximum parts to send."
        },
        "sum": {
          "type": "string",
          "example": 1,
          "description": "Total price to send."
        },
        "landline": {
          "type": "number",
          "example": 0,
          "description": "Is this a landline number?"
        }
      }
    },
    "UpdateSurveyCountryItem": {
      "required": [
        "country",
        "userInboundId"
      ],
      "additionalProperties": false,
      "properties": {
        "country": {
          "type": "string",
          "example": "US",
          "description": "The 2-letter ISO country code."
        },
        "userInboundId": {
          "type": "integer",
          "example": 10,
          "description": "User inbound phone ID."
        }
      }
    },
    "CreateTagResponse": {
      "type": "object",
      "required": [
        "id",
        "title"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "example": 12345,
          "description": "Unique tag ID."
        },
        "title": {
          "type": "string",
          "example": "Favorites",
          "description": "Tag title."
        }
      }
    },
    "GetTimezonesResponse": {
      "type": "object",
      "example": [
        {
          "id": 3,
          "name": "(UTC -11:00): Pacific/Samoa",
          "offset": -39600,
          "timezone": "Pacific/Samoa"
        },
        {
          "id": 2,
          "name": "(UTC -11:00): Pacific/Midway",
          "offset": -39600,
          "timezone": "Pacific/Midway"
        },
        {
          "id": 4,
          "name": "(UTC -10:00): Pacific/Tahiti",
          "offset": -36000,
          "timezone": "Pacific/Tahiti"
        },
        {
          "id": 5,
          "name": "(UTC -10:00): Pacific/Honolulu",
          "offset": -36000,
          "timezone": "Pacific/Honolulu"
        },
        {
          "id": 6,
          "name": "(UTC -09:30): Pacific/Marquesas",
          "offset": -34200,
          "timezone": "Pacific/Marquesas"
        }
      ]
    },
    "GetCountriesResponse": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Country"
      }
    },
    "GetDisallowedRulesResponse": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "example": [
        "SEND_MESSAGES",
        "MAKE_CALLS",
        "EMAIL_LOOKUP"
      ]
    },
    "GetUserDedicatedNumbersPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UsersInbound"
          }
        }
      }
    },
    "GetSenderIdsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SenderId"
          }
        }
      }
    },
    "GetCallsPricesResponse": {
      "required": [
        "outbound",
        "inbound",
        "forward",
        "country"
      ],
      "additionalProperties": false,
      "properties": {
        "outbound": {
          "type": "number",
          "description": "Price for outbound message."
        },
        "inbound": {
          "type": "number",
          "description": "Price for inbound message."
        },
        "forward": {
          "type": "number",
          "description": "Price for forward."
        },
        "country": {
          "description": "2-letter ISO country code for local phone numbers, used when local is  set to true. Default is account country.",
          "type": "string",
          "example": "US"
        }
      },
      "example": {
        "GF": {
          "outbound": "0.197",
          "inbound": "0.016388",
          "forward": "0.197"
        },
        "KN": {
          "outbound": "0.231",
          "inbound": "0.016388",
          "forward": "0.231"
        },
        "SX": {
          "outbound": "0.204",
          "inbound": "0.016388",
          "forward": "0.204"
        }
      }
    },
    "SearchContactsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Contact"
          }
        }
      }
    },
    "GetContactsAutocompleteResponse": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/GetContactsAutocompleteResponseItem"
      }
    },
    "GetContactsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Contact"
          }
        }
      }
    },
    "GetUnsubscribersPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UnsubscribedContact"
          }
        }
      }
    },
    "GetCustomFieldsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UserCustomField"
          }
        }
      }
    },
    "GetListsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/List"
          }
        }
      }
    },
    "SearchListsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/List"
          }
        }
      }
    },
    "GetListsOfContactPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/List"
          }
        }
      }
    },
    "GetFavoritesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FavoriteContact"
          }
        }
      }
    },
    "GetDistributionListsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DistributionListListItem"
          }
        }
      }
    },
    "GetBlockedContactsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Contact"
          }
        }
      }
    },
    "GetContactNotesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ContactNote"
          }
        }
      }
    },
    "GetContactsByListIdPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Contact"
          }
        }
      }
    },
    "GetAllTemplatesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessageTemplate"
          }
        }
      }
    },
    "SearchTemplatesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessageTemplate"
          }
        }
      }
    },
    "GetAllOutboundMessagesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "resources",
        "limit"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessageOut"
          }
        }
      }
    },
    "SearchOutboundMessagesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessageOut"
          }
        }
      }
    },
    "GetOutboundMessagesHistoryPaginatedResponse": {
      "required": [
        "resources",
        "limit",
        "lastId",
        "nextLastId"
      ],
      "additionalProperties": false,
      "properties": {
        "lastId": {
          "type": "integer",
          "example": 1,
          "x-nullable": true
        },
        "nextLastId": {
          "type": "integer",
          "example": 1
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessageOut"
          }
        }
      }
    },
    "GetAllBulkSessionsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/BulkSession"
          }
        }
      }
    },
    "GetAllMessageSessionsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessageSession"
          }
        }
      }
    },
    "GetMessagesBySessionIdPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessageOut"
          }
        }
      }
    },
    "GetAllScheduledMessagesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessagesIcs"
          }
        }
      }
    },
    "SearchScheduledMessagesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessagesIcs"
          }
        }
      }
    },
    "GetAllInboundMessagesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessageIn"
          }
        }
      }
    },
    "SearchInboundMessagesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "resources",
        "limit"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MessageIn"
          }
        }
      }
    },
    "GetSpendingStatPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UserStatement"
          }
        }
      }
    },
    "GetInvoicesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Invoice"
          }
        }
      }
    },
    "GetAllChatsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Chat"
          }
        }
      }
    },
    "GetChatMessagesPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Conversation"
          }
        }
      }
    },
    "SearchChatsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Chat"
          }
        }
      }
    },
    "SearchChatsByIdsPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Chat"
          }
        }
      }
    },
    "SearchChatsByReceipentPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Chat"
          }
        }
      }
    },
    "GetSurveysPaginatedResponse": {
      "required": [
        "page",
        "pageCount",
        "limit",
        "resources"
      ],
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "integer",
          "example": 1
        },
        "pageCount": {
          "type": "integer",
          "example": 10,
          "description": "The total number of pages."
        },
        "limit": {
          "type": "integer",
          "example": 10,
          "description": "The number of results per page."
        },
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Survey"
          }
        }
      }
    }
  },
  "securityDefinitions": {
    "BasicAuth": {
      "type": "basic"
    }
  },
  "x-ignoredHeaderParameters": [
    "X-Ignore-Null-Values"
  ],
  "x-tagGroups": [
    {
      "name": "Overview",
      "tags": [
        "Getting started",
        "Sandbox",
        "SDKs"
      ]
    },
    {
      "name": "Messaging",
      "tags": [
        "Outbound Messages",
        "Inbound Messages",
        "Scheduled Messages",
        "Two Factor auth",
        "Chats",
        "Outbound Message Sessions",
        "Templates"
      ]
    },
    {
      "name": "Email Campaigns",
      "tags": [
        "Email Campaigns",
        "Scheduled Email Campaigns",
        "Email campaign senders"
      ]
    },
    {
      "name": "Contacts",
      "tags": [
        "Lists",
        "Contacts",
        "Custom Fields",
        "Contact Notes",
        "Lookup"
      ]
    },
    {
      "name": "Email to SMS",
      "tags": [
        "Send Email to SMS",
        "Receive SMS to Email",
        "Distribution Lists"
      ]
    },
    {
      "name": "Sender Settings",
      "tags": [
        "Sender Settings",
        "Numbers",
        "Sender IDs"
      ]
    },
    {
      "name": "Account",
      "tags": [
        "User",
        "Statistic",
        "Billing"
      ]
    },
    {
      "name": "Common",
      "tags": [
        "Common"
      ]
    },
    {
      "name": "Tags",
      "tags": [
        "Tags"
      ]
    },
    {
      "name": "Resources",
      "tags": [
        "Response Codes",
        "Restrictions and Limits",
        "Encoding"
      ]
    }
  ]
}