{
  "openapi": "3.0.0",
  "info": {
    "title": "MMS",
    "description": "Everything about MMS"
  },
  "servers": [
    {
      "url": "https://rest.clicksend.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    },
    "schemas": {
      "mms": {
        "type": "object",
        "properties": {
          "list_id": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the list (if applicable).",
            "example": null
          },
          "contact_id": {
            "type": "integer",
            "description": "The ID of the contact.",
            "example": 4
          },
          "message_id": {
            "type": "string",
            "description": "The ID of the message.",
            "example": "D7A79BF1-4806-43F8-8339-6B9F8385D9A4"
          },
          "to": {
            "type": "string",
            "description": "The recipient of the message.",
            "example": "+61298444214"
          },
          "subject": {
            "type": "string",
            "description": "The subject of the message.",
            "example": "This is a subject"
          },
          "from": {
            "type": "string",
            "description": "The sender of the message.",
            "example": "+61411111111"
          },
          "body": {
            "type": "string",
            "description": "The body of the message.",
            "example": "John This is a test message."
          },
          "country": {
            "type": "string",
            "description": "The country code.",
            "example": "AU"
          },
          "custom_string": {
            "type": "string",
            "description": "Custom string associated with the message.",
            "example": ""
          },
          "schedule": {
            "type": "string",
            "description": "The schedule time of the message.",
            "example": ""
          },
          "message_parts": {
            "type": "integer",
            "description": "The number of parts the message was split into.",
            "example": 1
          },
          "message_price": {
            "type": "string",
            "description": "The price of the message.",
            "example": "2.4200"
          },
          "_media_file_url": {
            "type": "string",
            "description": "The URL of the media file attached to the message.",
            "example": "https://yourdomain.com/tpLaX6A.gif"
          },
          "status": {
            "type": "string",
            "description": "The status of the message.",
            "example": "SUCCESS"
          }
        }
      },
      "send-mms": {
        "type": "object",
        "properties": {
          "http_code": {
            "type": "integer",
            "description": "The HTTP status code of the response.",
            "example": 200
          },
          "response_code": {
            "type": "string",
            "description": "The response code indicating the status of the operation.",
            "example": "SUCCESS"
          },
          "response_msg": {
            "type": "string",
            "description": "A message describing the outcome of the operation.",
            "example": "Messages queued for delivery."
          },
          "data": {
            "type": "object",
            "properties": {
              "total_price": {
                "type": "number",
                "example": 13.2,
                "description": "The total price of the MMS messages."
              },
              "total_count": {
                "type": "integer",
                "example": 1,
                "description": "The total count of the MMS messages."
              },
              "queued_count": {
                "type": "integer",
                "example": 1,
                "description": "The count of the queued MMS messages."
              },
              "messages": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/mms"
                }
              }
            }
          }
        }
      },
      "calculate-mms-price": {
        "type": "object",
        "properties": {
          "http_code": {
            "type": "integer",
            "description": "The HTTP status code of the response.",
            "example": 200
          },
          "response_code": {
            "type": "string",
            "description": "The response code indicating the status of the operation.",
            "example": "SUCCESS"
          },
          "response_msg": {
            "type": "string",
            "description": "A message describing the outcome of the operation.",
            "example": "Messages queued for delivery."
          },
          "data": {
            "type": "object",
            "properties": {
              "total_price": {
                "type": "number",
                "example": 19.36,
                "description": "The total price of the MMS messages."
              },
              "total_count": {
                "type": "integer",
                "example": 1,
                "description": "The total count of the MMS messages."
              },
              "queued_count": {
                "type": "integer",
                "example": 1,
                "description": "The count of the queued MMS messages."
              },
              "messages": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/mms"
                }
              }
            }
          }
        }
      },
      "pagination": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": "The total number of items available for viewing.",
            "example": 2
          },
          "per_page": {
            "type": "integer",
            "description": "The number of items returned per page. This is specified in the limit parameter. You can have 100 items at maximum, and 15 at minimum.",
            "example": 15
          },
          "current_page": {
            "type": "integer",
            "description": "The current page number.",
            "example": 1
          },
          "last_page": {
            "type": "integer",
            "description": "The last page number.",
            "example": 1
          },
          "next_page_url": {
            "type": "string",
            "nullable": true,
            "description": "A URL of the next page. It will return **null** if there’s no next page.",
            "example": null
          },
          "prev_page_url": {
            "type": "string",
            "nullable": true,
            "description": "A URL of the previous page. It will return **null** if there’s no previous page.",
            "example": null
          },
          "from": {
            "type": "integer",
            "description": "The number of the first result in the current page.",
            "example": 1
          },
          "to": {
            "type": "integer",
            "description": "The number of the last result in the current page.",
            "example": 2
          }
        }
      },
      "view-mms-history": {
        "type": "object",
        "properties": {
          "http_code": {
            "type": "integer",
            "description": "The HTTP status code of the response.",
            "example": 200
          },
          "response_code": {
            "type": "string",
            "description": "The response code indicating the status of the operation.",
            "example": "SUCCESS"
          },
          "response_msg": {
            "type": "string",
            "description": "A message describing the outcome of the operation.",
            "example": "Here are your data."
          },
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/pagination"
              },
              {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "direction": {
                          "type": "string",
                          "description": "The direction of the message (in or out).",
                          "example": "out"
                        },
                        "date": {
                          "type": "string",
                          "description": "The date of the message.",
                          "example": "1436932432"
                        },
                        "to": {
                          "type": "string",
                          "description": "The recipient of the message.",
                          "example": "+16783270696"
                        },
                        "body": {
                          "type": "string",
                          "description": "The body of the message.",
                          "example": "Chocolate bar icing icing oat cake carrot cake jelly cotton 1iQByXxdLN."
                        },
                        "subject": {
                          "type": "string",
                          "nullable": true,
                          "description": "The subject of the message.",
                          "example": "This is a subject"
                        },
                        "priority": {
                          "type": "integer",
                          "description": "The priority of the message.",
                          "example": 2
                        },
                        "_media_file_url": {
                          "type": "string",
                          "nullable": true,
                          "description": "A temporary, signed URL to download the message's media attachment.",
                          "example": "https://clicksend-api-downloads.s3.ap-southeast-2.amazonaws.com/_private/example.jpg"
                        },
                        "status": {
                          "type": "string",
                          "description": "The status of the message.",
                          "example": "Completed"
                        },
                        "from": {
                          "type": "string",
                          "description": "The sender of the message.",
                          "example": "sendlist"
                        },
                        "schedule": {
                          "type": "string",
                          "description": "The schedule time of the message.",
                          "example": "1436879372"
                        },
                        "date_added": {
                          "type": "integer",
                          "description": "The Unix timestamp when the message was added.",
                          "example": 1436879372
                        },
                        "status_code": {
                          "type": "string",
                          "description": "The status code (if applicable).",
                          "nullable": true,
                          "example": null
                        },
                        "status_text": {
                          "type": "string",
                          "nullable": true,
                          "description": "The status text (if applicable).",
                          "example": null
                        },
                        "error_code": {
                          "type": "string",
                          "nullable": true,
                          "description": "The error code (if applicable).",
                          "example": null
                        },
                        "error_text": {
                          "type": "string",
                          "description": "The error text (if applicable)."
                        },
                        "message_id": {
                          "type": "string",
                          "description": "The ID of the message.",
                          "example": "4E90F4C3-43A3-489D-9AB8-DA1F4332A0C3"
                        },
                        "message_parts": {
                          "type": "string",
                          "description": "The number of parts the message was split into.",
                          "example": "1.00"
                        },
                        "message_price": {
                          "type": "string",
                          "description": "The price of the message.",
                          "example": "0.070000"
                        },
                        "from_email": {
                          "type": "string",
                          "nullable": true,
                          "description": "The email of the sender (if applicable).",
                          "example": null
                        },
                        "list_id": {
                          "type": "string",
                          "nullable": true,
                          "description": "The ID of the list (if applicable).",
                          "example": null
                        },
                        "custom_string": {
                          "type": "string",
                          "description": "Custom string associated with the message.",
                          "example": "this is a test"
                        },
                        "contact_id": {
                          "type": "integer",
                          "description": "The ID of the contact.",
                          "example": 0
                        },
                        "user_id": {
                          "type": "integer",
                          "description": "The ID of the user.",
                          "example": 1
                        },
                        "subaccount_id": {
                          "type": "integer",
                          "description": "The ID of the subaccount.",
                          "example": 1
                        },
                        "country": {
                          "type": "string",
                          "description": "The country code.",
                          "example": "US"
                        },
                        "carrier": {
                          "type": "string",
                          "description": "The carrier information."
                        },
                        "first_name": {
                          "type": "string",
                          "description": "The first name of the sender.",
                          "example": "John"
                        },
                        "last_name": {
                          "type": "string",
                          "description": "The last name of the sender.",
                          "example": "Doe"
                        },
                        "_api_username": {
                          "type": "string",
                          "description": "The API username associated with the message.",
                          "example": "johndoe"
                        }
                      }
                    }
                  }
                }
              }
            ]
          }
        }
      },
      "export-mms-history": {
        "type": "object",
        "properties": {
          "http_code": {
            "type": "integer",
            "description": "The HTTP status code of the response.",
            "example": 200
          },
          "response_code": {
            "type": "string",
            "description": "The response code indicating the status of the operation.",
            "example": "SUCCESS"
          },
          "response_msg": {
            "type": "string",
            "description": "A message describing the outcome of the operation.",
            "example": "Download your file here."
          },
          "data": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "description": "The URL to download the file.",
                "example": "https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv"
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v3/mms/send": {
      "post": {
        "summary": "Send MMS",
        "operationId": "send-mms",
        "description": "_Send MMS_\n\nYou can post **up to 1000 messages** with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000. The response contains a status and details for each recipient.\n\nRefer to [<b>Application Status Codes</b>](/#application-status-codes) for the possible response message status strings.\n\n### **How many characters can I send in a message?**\n\n### Standard MMS Message\n\n1500 characters\n\n### Unicode MMS Message\n\n500 characters\n\nIf a message is longer the allowed number of characters it will be truncated. If a message contains any characters that aren't in the GSM 03.38 character set, the message type will be treated as unicode. ([https://en.wikipedia.org/wiki/GSM_03.38](https://en.wikipedia.org/wiki/GSM_03.38))\n\n### Maximum File Size\n\nYou can send a single attachment with a size of up to 250 kB. Some older devices can only accept attachments with up to 30 kB.\n\n### Supported File Types\n\n- Supported file types are listed below. If you need to convert a file to a supported format, it can be first passed to our uploads endpoint: `/uploads?convert=mms`\n- This will return a URL to the converted image file that can be used in the /mms/send endpoint.\n- Contact us to add support for any other file type.\n    \n\n### Images\n\n| File type | Required to be passed to uploads endpoint first? |\n| --- | --- |\n| `jpg` | No |\n| `gif` | No |\n| `jpeg` | Yes |\n| `png` | Yes |\n| `bmp` | Yes |\n\n### Properties\n\n| Name | Type | Required | Restrictions | Description |\n| --- | --- | --- | --- | --- |\n| media_file | string | true | none | Media file you want to send |\n| to | string | true | none | Recipient phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format |\n| body | string | true | none | Your message |\n| subject | string | true | none | Subject line (max 20 characters) |\n| from | string | true | [yes](http://help.clicksend.com/SMS/what-is-a-sender-id-or-sender-number) | Your sender id |\n\nRefer to [Status Codes](/#status-codes) for definitions of HTTP status code responses.\n\n<div style=\"background-color: #FF6A4B; padding: 10px; border-radius: 8px;\">\n  <span style=\"color: white;\">This endpoint requires authentication,</span> \n  <a href=\"/docs/#authentication\" style=\"color: white; text-decoration: underline;\">more info...</a>\n</div>",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "media_file": {
                    "type": "string"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        },
                        "subject": {
                          "type": "string"
                        },
                        "body": {
                          "type": "string"
                        },
                        "schedule": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "media_file": "{{imageFileURL}}",
                  "messages": [
                    {
                      "source": "php",
                      "to": "+61411111111",
                      "from": "+61411111111",
                      "subject": "Test MMS",
                      "body": "Image attached",
                      "schedule": 1512538536
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "application/json"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/send-mms"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl --include \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request POST \\\n     --header \"Content-Type: application/json\" \\\n\n     --data-binary \"    {\n        \\\"media_file\\\":\\\"http://yourdomain.com/tpLaX6A.gif\\\",\n        \\\"messages\\\":[\n           {\n             \\\"source\\\" : \\\"php\\\",\n             \\\"subject\\\": \\\"This is a subject\\\",\n             \\\"from\\\" : \\\"test\\\",\n             \\\"body\\\" : \\\"This is a test body with special character: 英\\\",\n             \\\"to\\\": \\\"+61437111222\\\",\n             \\\"country\\\": \\\"AU\\\"\n           }\n        ]\n    }\" \\\n'https://rest.clicksend.com/v3/mms/send'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\MMSApi(new GuzzleHttp\\Client(),$config);\n$mms_message = new \\ClickSend\\Model\\MmsMessage();\n$mms_message->setTo(\"+61437111222\");\n$mms_message->setBody(\"This is a test body with special character\");\n$mms_message->setSubject(\"This is a subject\");\n$mms_message->setFrom(\"test\");\n$mms_message->setCountry(\"AU\");\n$mms_message->setSource(\"php\");\n$mms_message->setListId(185161);\n$mms_message->setCustomString(\"custom\");\n$mms_message->setFromEmail(\"xxx@gmail.com\");\n// \\ClickSend\\Model\\MmsMessageCollection | MmsMessageCollection model\n$mms_messages = new \\ClickSend\\Model\\MmsMessageCollection();\n$mms_messages->setMediaFile(\"https://media.tenor.com/images/a3c2a6cf42e0ac49ebd7cd347d10fe94/tenor.gif\");\n$mms_messages->setMessages([$mms_message]);\n\ntry {\n    $result = $apiInstance->mmsSendPost($mms_messages);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling MMSApi->mmsSendPost: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar mmsApi = new MMSApi(configuration);\nvar listOfMessages = new List<MmsMessage>();\nlistOfMessages.Add(new MmsMessage() { \n    To = \"+11231231234\",\n    Body = \"This is test body\",\n    Subject = \"test subject\",\n    From = \"+11231231234\",\n    Country = \"CA\",\n    Source = \"sdk\",\n    Schedule = TimeStamp,\n    CustomString = \"Custom String\",\n    FromEmail = \"john@doe.com\"\n});\nvar mmsCollection = new MmsMessageCollection(\"https://yourdomain.com/file.jpg\", listOfMessages);\nvar response = mmsApi.MmsSendPost(mmsCollection);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport ClickSend.Api.MmsApi;\nimport ClickSend.Model.MmsMessage;\nimport ClickSend.Model.MmsMessageCollection;\n\npublic class send_mms {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    MmsApi apiInstance = new MmsApi(defaultClient);\n    MmsMessage mmsMessage=new MmsMessage();\n    mmsMessage.to(\"+61437111222\");\n    mmsMessage.body(\"This is a test body with special character\");\n    mmsMessage.subject(\"This is a subject\");\n    mmsMessage.from(\"test\");\n    mmsMessage.country(\"AU\");\n    mmsMessage.source(\"source\");\n    List<MmsMessage> mmsMessageList=Arrays.asList(mmsMessage);\n    // MmsMessageCollection | MmsMessageCollection model\n    MmsMessageCollection mmsMessages = new MmsMessageCollection(); \n    mmsMessages.mediaFile(\"https://test.com/test.gif\");\n    mmsMessages.messages(mmsMessageList);\n    try {\n        String result = apiInstance.mmsSendPost(mmsMessages);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling MmsApi#mmsSendPost\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar mmsApi = new api.MMSApi(\"USERNAME\", \"API_KEY\");\n\nvar mmsMessage = new api.MmsMessage();\n\nmmsMessage.to = \"+61437111222\";\nmmsMessage.body = \"body\";\nmmsMessage.subject = \"subject\";\nmmsMessage.from = \"abc@gmail.com\";\nmmsMessage.country = \"US\";\nmmsMessage.source = \"source\";\nmmsMessage.listId = 185161;\nmmsMessage.customString = \"custom\";\nmmsMessage.fromEmail = \"xxx@gmail.com\";\n\nvar mmsMessages = new api.MmsMessageCollection();\n\nmmsMessages.mediaFile = \"https://yourdomain/sample.gif\";\nmmsMessages.messages = [mmsMessage]\n\nmmsApi.mmsSendPost(mmsMessages).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::MMSApi.new\n\n# MmsMessageCollection | MmsMessageCollection model\nmms_messages = ClickSendClient::MmsMessageCollection.new(\n  \"media_file\": \"media_file\",\n  messages: [\n    ClickSendClient::MmsMessage.new(\n      \"schedule\": 0,\n      \"subject\": \"subject\",\n      \"from\": \"from\",\n      \"to\": \"+61411111111\",\n      \"source\": \"sdk\",\n      \"body\": \"body\",\n      \"custom_string\": \"custom_string\"\n    ),\n    ClickSendClient::MmsMessage.new(\n      \"schedule\": 0,\n      \"subject\": \"subject\",\n      \"from\": \"from\",\n      \"to\": \"+61422222222\",\n      \"source\": \"sdk\",\n      \"body\": \"body\",\n      \"custom_string\": \"custom_string\"\n    )\n  ]\n)\n\nbegin\n  # Send MMS\n  result = api_instance.mms_send_post(mms_messages)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling MMSApi->mms_send_post: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client import MmsMessage\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.MMSApi(clicksend_client.ApiClient(configuration))\nMmsMessage=MmsMessage(to='+61437111222',\n                      body='This is a test body with special character',\n                      subject='This is a subject',\n                      _from='test',\n                      country='AU')\nmms_messages = clicksend_client.MmsMessageCollection(\n              media_file='https://test.com/test.gif',\n              messages=[MmsMessage])\ntry:\n    # Send MMS\n    api_response = api_instance.mms_send_post(mms_messages)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling MMSApi->mms_send_post: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::MMSApi;\nuse WWW::ClickSendClient::Object::MmsMessageCollection;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::MMSApi->new(username => $username, password => $password);\n\nmy %params = (\n    'media_file' => 'https://domain.com/Example.jpg',\n    'messages'   => [\n        {\n            'to'            => 'to',\n            'body'          => 'body',\n            'subject'       => 'subject',\n            'from'          => 'from',\n            'country'       => 'country',\n            'source'        => 'source',\n            'schedule'      => 'schedule',\n            'custom_string' => 'custom_string',\n            'from_email'    => 'from_email',\n            'messages'      => 'messages',\n        }\n    ],\n);\n\nmy $mms_messages_obj = WWW::ClickSendClient::Object::MmsMessageCollection->new(%params);\n\nmy $json_output = $api->mms_send_post('mms_messages' => $mms_messages_obj);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSmsApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n[apiConfig setUsername:@\"USERNAME\"];\n[apiConfig setPassword:@\"PASSWORD\"];\n\nCSSmsMessage *smsMessages = [[CSSmsMessage alloc] init];\nsmsMessages.from = @\"from\";\nsmsMessages.body = @\"body\";\nsmsMessages.to = @\"to\";\nsmsMessages.source = @\"objc\";\nsmsMessages.schedule = nil;\nsmsMessages.customString = @\"custom_string\";\nsmsMessages.listId = nil;\nsmsMessages.country = @\"country\";\nsmsMessages.fromEmail = @\"from_email\";\n\nCSSmsMessageCollection *smsMessagesCollection = [[CSSmsMessageCollection alloc] init];\n\nCSSMSApi *smsApiInstance = [[CSSMSApi alloc] init];\n[smsApiInstance smsSendPostWithSmsMessages:smsMessagesCollection completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nlet messages = MmsMessage(to: \"to\",\n                          body: \"body\",\n                          subject: \"subject\",\n                          from: \"from\",\n                          country: \"country\",\n                          source: \"swift\",\n                          listId: 1,\n                          schedule: nil,\n                          customString: \"custom_string\",\n                          fromEmail: nil)\n\nlet mmsMessages =  MmsMessageCollection(mediaFile: \"mediaFile\", messages: [messages])\nMMSAPI.mmsSendPost(mmsMessages: mmsMessages) { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"Cannot convert the String value to JSON\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/v3/mms/price": {
      "post": {
        "summary": "Calculate MMS Price",
        "operationId": "calculate-mms-price",
        "description": "_Get Price for MMS sent_\n\n### Properties\n\n| Name | Type | Required | Restrictions | Description |\n| --- | --- | --- | --- | --- |\n| media_file | string | true | none | Media file you want to send |\n| to | string | true | none | Recipient phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format |\n| body | string | true | none | Your message |\n| subject | string | true | none | Subject line (max 20 characters) |\n| from | string | true | [yes](http://help.clicksend.com/SMS/what-is-a-sender-id-or-sender-number) | Your sender id |\n\n\nRefer to [Status Codes](/#status-codes) for definitions of HTTP status code responses.\n\n\n<div style=\"background-color: #FF6A4B; padding: 10px; border-radius: 8px;\">\n  <span style=\"color: white;\">This endpoint requires authentication,</span> \n  <a href=\"/docs/#authentication\" style=\"color: white; text-decoration: underline;\">more info...</a>\n</div>",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "media_file": {
                    "type": "string"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "string"
                        },
                        "subject": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        },
                        "body": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "country": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "media_file": "{{imageFileURL}}",
                  "messages": [
                    {
                      "source": "php",
                      "subject": "This is a subject",
                      "from": "test",
                      "body": "This is a test message.",
                      "to": "+61437887639",
                      "country": "AU"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "application/json"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/calculate-mms-price"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl --include \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n     --request POST \\\n     --header \"Content-Type: application/json\" \\\n\n     --data-binary \"    {\n        \\\"media_file\\\":\\\"http://yourdomain.com/tpLaX6A.gif\\\",\n        \\\"messages\\\":[\n           {\n             \\\"source\\\" : \\\"php\\\",\n             \\\"subject\\\": \\\"This is a subject\\\",\n             \\\"from\\\" : \\\"test\\\",\n             \\\"body\\\" : \\\"This is a test body with special character: 英\\\",\n             \\\"to\\\": \\\"+61437111222\\\",\n             \\\"country\\\": \\\"AU\\\"\n           }\n        ]\n    }\" \\\n'https://rest.clicksend.com/v3/mms/price'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\MMSApi(new GuzzleHttp\\Client(),$config);\n$mms_message = new \\ClickSend\\Model\\MmsMessage();\n$mms_message->setTo(\"+61437111222\");\n$mms_message->setBody(\"This is a test body with special character\");\n$mms_message->setSubject(\"This is a subject\");\n$mms_message->setFrom(\"test\");\n$mms_message->setCountry(\"AU\");\n$mms_message->setSource(\"php\");\n$mms_message->setListId(185161);\n$mms_message->setCustomString(\"custom\");\n$mms_message->setFromEmail(\"xxx@gmail.com\");\n// \\ClickSend\\Model\\MmsMessageCollection | MmsMessageCollection model\n$mms_messages = new \\ClickSend\\Model\\MmsMessageCollection();\n$mms_messages->setMediaFile(\"https://media.tenor.com/images/a3c2a6cf42e0ac49ebd7cd347d10fe94/tenor.gif\");\n$mms_messages->setMessages([$mms_message]);\n\ntry {\n    $result = $apiInstance->mmsPricePost($mms_messages);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling MMSApi->mmsPricePost: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar mmsApi = new MMSApi(configuration);\nvar listOfMessages = new List<MmsMessage>();\nlistOfMessages.Add(new MmsMessage(\n    to: \"+11231231234\",\n    body: \"This is test body\",\n    subject: \"test subject\",\n    from: \"+11231231234\",\n    country: \"CA\",\n    source: \"sdk\",\n    schedule: TimeStamp,\n    customString: \"Custom String\",\n    fromEmail: \"john@doe.com\"\n));\nvar mmsCollection = new MmsMessageCollection(\"https://mydomain.com/file.jpg\", listOfMessages);\nvar response = mmsApi.MmsPricePost(mmsCollection);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport ClickSend.Api.MmsApi;\nimport ClickSend.Model.MmsMessage;\nimport ClickSend.Model.MmsMessageCollection;\n\npublic class calculate_mms_price {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    MmsApi apiInstance = new MmsApi(defaultClient);\n    MmsMessage mmsMessage=new MmsMessage();\n    mmsMessage.to(\"+61437111222\");\n    mmsMessage.body(\"This is a test body with special character\");\n    mmsMessage.subject(\"This is a subject\");\n    mmsMessage.from(\"test\");\n    mmsMessage.country(\"AU\");\n    mmsMessage.source(\"source\");\n    List<MmsMessage> mmsMessageList=Arrays.asList(mmsMessage);\n    // MmsMessageCollection | MmsMessageCollection model\n    MmsMessageCollection mmsMessages = new MmsMessageCollection(); \n    mmsMessages.mediaFile(\"https://test.com/test.gif\");\n    mmsMessages.messages(mmsMessageList);\n    try {\n        String result = apiInstance.mmsPricePost(mmsMessages);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling MmsApi#mmsPricePost\");\n        e.printStackTrace();\n    }\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar mmsApi = new api.MMSApi(\"USERNAME\", \"API_KEY\");\n\nvar mmsMessage = new api.MmsMessage();\n\nmmsMessage.to = \"+61437111222\";\nmmsMessage.body = \"body\";\nmmsMessage.subject = \"subject\";\nmmsMessage.from = \"abc@gmail.com\";\nmmsMessage.country = \"US\";\nmmsMessage.source = \"source\";\nmmsMessage.listId = 185161;\nmmsMessage.customString = \"custom\";\nmmsMessage.fromEmail = \"xxx@gmail.com\";\n\nvar mmsMessages = new api.MmsMessageCollection();\n\nmmsMessages.mediaFile = \"https://your-domain/sample.gif\";\nmmsMessages.messages = [mmsMessage]\n\nmmsApi.mmsPricePost(mmsMessages).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::MMSApi.new\n\n# MmsMessageCollection | MmsMessageCollection model\nmms_messages = ClickSendClient::MmsMessageCollection.new(\n  \"media_file\": \"media_file\",\n  messages: [\n    ClickSendClient::MmsMessage.new(\n      \"subject\": \"subject\",\n      \"from\": \"from\",\n      \"to\": \"+61411111111\",\n      \"source\": \"sdk\",\n      \"body\": \"body\",\n      \"custom_string\": \"custom_string\"\n    ),\n    ClickSendClient::MmsMessage.new(\n      \"subject\": \"subject\",\n      \"from\": \"from\",\n      \"to\": \"+61422222222\",\n      \"source\": \"sdk\",\n      \"body\": \"body\",\n      \"custom_string\": \"custom_string\"\n    )\n  ]\n)\n\nbegin\n  # Get Price for MMS sent\n  result = api_instance.mms_price_post(mms_messages)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling MMSApi->mms_price_post: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client import MmsMessage\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.MMSApi(clicksend_client.ApiClient(configuration))\nMmsMessage=MmsMessage(to='+61437111222',\n                      body='This is a test body with special character',\n                      subject='This is a subject',\n                      _from='test',\n                      country='AU')\n# MmsMessageCollection | MmsMessageCollection model\nmms_messages = clicksend_client.MmsMessageCollection(\n                media_file='https://test.com/test.gif',\n                messages=[MmsMessage]) \n\ntry:\n    # Get Price for MMS sent\n    api_response = api_instance.mms_price_post(mms_messages)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling MMSApi->mms_price_post: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::MMSApi;\nuse WWW::ClickSendClient::Object::MmsMessageCollection;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::MMSApi->new(username => $username, password => $password);\n\nmy %params = (\n    'media_file' => 'https://domain.com/Example.jpg',\n    'messages'   => [\n        {\n            'to'            => 'to',\n            'body'          => 'body',\n            'subject'       => 'subject',\n            'from'          => 'from',\n            'country'       => 'country',\n            'source'        => 'source',\n            'schedule'      => 'schedule',\n            'custom_string' => 'custom_string',\n            'from_email'    => 'from_email',\n            'messages'      => 'messages',\n        }\n    ],\n);\n\nmy $mms_messages_obj = WWW::ClickSendClient::Object::MmsMessageCollection->new(%params);\n\nmy $json_output = $api->mms_price_post('mms_messages' => $mms_messages_obj);\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSSmsApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n[apiConfig setUsername:@\"USERNAME\"];\n[apiConfig setPassword:@\"PASSWORD\"];\n\nCSSmsMessage *smsMessages = [[CSSmsMessage alloc] init];\nsmsMessages.from = @\"from\";\nsmsMessages.body = @\"body\";\nsmsMessages.to = @\"to\";\nsmsMessages.source = @\"objc\";\nsmsMessages.schedule = nil;\nsmsMessages.customString = @\"custom_string\";\nsmsMessages.listId = nil;\nsmsMessages.country = @\"country\";\nsmsMessages.fromEmail = @\"from_email\";\n\nCSSmsMessageCollection *smsMessagesCollection = [[CSSmsMessageCollection alloc] init];\n\nCSSMSApi *smsApiInstance = [[CSSMSApi alloc] init];\n[smsApiInstance smsPricePostWithSmsMessages:smsMessagesCollection completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nlet messages = MmsMessage(to: \"to\",\n                          body: \"body\",\n                          subject: \"subject\",\n                          from: \"from\",\n                          country: \"country\",\n                          source: \"swift\",\n                          listId: 1,\n                          schedule: nil,\n                          customString: nil,\n                          fromEmail: nil)\n\nlet mmsMessages = MmsMessageCollection(mediaFile: \"media_file\", messages: [messages])\nMMSAPI.mmsPricePost(mmsMessages:mmsMessages) { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"Cannot convert the String value to JSON\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/v3/mms/history": {
      "get": {
        "summary": "View MMS History",
        "operationId": "view-mms-history",
        "description": "_Get all mms history_\n\n### Parameters\n\n| Parameter | In | Type | Required | Description |\n| --- | --- | --- | --- | --- |\n| date_from | query | integer(int32) | false | Start date (Unix Timestamp e.g. 1436849372) |\n| date_to | query | integer(int32) | false | End date (Unix Timestamp e.g. 1436879372) |\n| page | query | integer(int32) | false | [Page number](/#pagination) |\n| limit | query | integer(int32) | false | [Number of records per page](/#pagination) |\n\n\nRefer to [Status Codes](/#status-codes) for definitions of HTTP status code responses.\n\n\n<div style=\"background-color: #FF6A4B; padding: 10px; border-radius: 8px;\">\n  <span style=\"color: white;\">This endpoint requires authentication,</span> \n  <a href=\"/docs/#authentication\" style=\"color: white; text-decoration: underline;\">more info...</a>\n</div>",
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "application/json"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "example": "100"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/view-mms-history"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl --include \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/mms/history?date_from=&date_to='"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\MMSApi(new GuzzleHttp\\Client(),$config);\n$q = \"q_example\"; // string | Custom query Example: from:{number},status_code:201.\n$date_from = '1436879372'; // int | Start date\n$date_to = '1436879372'; // int | End date\n$page = 1; // int | Page number\n$limit = 10; // int | Number of records per page\n\ntry {\n    $result = $apiInstance->mmsHistoryGet($q, $date_from, $date_to, $page, $limit);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling MMSApi->mmsHistoryGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar mmsApi = new MMSApi(configuration);\n\nvar q = \"q_example\";\nvar dateFrom = '1436879372';\nvar dateTo = '1436879372';\nvar page = 1;\nvar limit = 10;\n\nvar response = mmsApi.MmsHistoryGet(q, dateFrom, dateTo, page, limit);"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.MmsApi;\n\npublic class view_mms_history {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    MmsApi apiInstance = new MmsApi(defaultClient);\n    // String | Custom query Example: from:{number},status_code:201.\n    String q = \"q_example\"; \n    Integer dateFrom = 1436879372; // Integer | Start date\n    Integer dateTo = 1436879372; // Integer | End date\n    Integer page = 1; // Integer | Page number\n    Integer limit = 10; // Integer | Number of records per page\n    try {\n      String result = apiInstance.mmsHistoryGet(q, dateFrom, dateTo, page, limit);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling MmsApi#mmsHistoryGet\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar mmsApi = new api.MMSApi(\"USERNAME\", \"API_KEY\");\n\nvar q = \"q_example\";\nvar dateFrom = '1436879372';\nvar dateTo = '1436879372';\nvar page = 1;\nvar limit = 10;\n\nmmsApi.mmsHistoryGet(q, dateFrom, dateTo, page, limit).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nend\n\napi_instance = ClickSendClient::MMSApi.new\n\nopts = {\n  date_from: 1436849372, # Integer | Start date\n  date_to: 1436879372,   # Integer | End date\n  page: 1,       # Integer | Page number\n  limit: 10      # Integer | Number of records per page\n}\n\nbegin\n  # Get all mms history\n  result = api_instance.mms_history_get(opts)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling MMSApi->mms_history_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.MMSApi(clicksend_client.ApiClient(configuration))\ndate_from = 1436879372 # int | Start date (optional)\ndate_to = 1436879372 # int | End date (optional)\npage = 1 # int | Page number (optional) (default to 1)\nlimit = 10 # int | Number of records per page (optional) (default to 10)\n\ntry:\n    # Get all mms history\n    api_response = api_instance.mms_history_get(date_from=date_from, date_to=date_to, page=page, limit=limit)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling MMSApi->mms_history_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::MMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::MMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->mms_history_get('date_from' => '1436879372','date_to' => '1446879372' , 'page'  => '1','limit'=> '20');\n\nprint $json_output;\n"
          },
          {
            "lang": "objc",
            "source": "#import \"CSMMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\n\nCSMMSApi *mmsAPI = [[CSMMSApi alloc] init];\n\nNSNumber *dateFromTimestamp = [NSNumber numberWithInt:1436849372];\nNSNumber *dateToTimestamp = [NSNumber numberWithInt:1436879372];\n\n[mmsAPI mmsHistoryGetWithQ:@\"\" dateFrom:dateFromTimestamp dateTo:dateToTimestamp page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nMMSAPI.mmsHistoryGet { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"Cannot convert the String value to JSON\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    },
    "/v3/mms/history/export": {
      "get": {
        "summary": "Export MMS History",
        "operationId": "export-mms-history",
        "description": "_Export all mms history_\n\n### Parameters\n\n| Parameter | In | Type | Required | Description |\n| --- | --- | --- | --- | --- |\n| filename | query | string | true | Filename to download history as |\n\n\nRefer to [Status Codes](/#status-codes) for definitions of HTTP status code responses.\n\n\n<div style=\"background-color: #FF6A4B; padding: 10px; border-radius: 8px;\">\n  <span style=\"color: white;\">This endpoint requires authentication,</span> \n  <a href=\"/docs/#authentication\" style=\"color: white; text-decoration: underline;\">more info...</a>\n</div>",
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "application/json"
          },
          {
            "name": "filename",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "MMS_history.csv"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order_by",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "date_added:desc"
          },
          {
            "name": "date_from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "example": "50000"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/export-mms-history"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl --include \\\n     --header \"Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==\"  \\\n\n'https://rest.clicksend.com/v3/mms/history/export?filename={filename}'"
          },
          {
            "lang": "PHP",
            "source": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure HTTP basic authorization: BasicAuth\n$config = ClickSend\\Configuration::getDefaultConfiguration()\n              ->setUsername('USERNAME')\n              ->setPassword('API_KEY');\n\n$apiInstance = new ClickSend\\Api\\MMSApi(new GuzzleHttp\\Client(),$config);\n$filename = \"filename_example\"; // string | Filename to download history as\n\ntry {\n    $result = $apiInstance->mmsHistoryExportGet($filename);\n    print_r($result);\n} catch (Exception $e) {\n    echo 'Exception when calling MMSApi->mmsHistoryExportGet: ', $e->getMessage(), PHP_EOL;\n}\n?>"
          },
          {
            "lang": "C#",
            "source": "using IO.ClickSend.ClickSend.Api;\nusing IO.ClickSend.Client;\nusing IO.ClickSend.ClickSend.Model;\n\nvar configuration = new Configuration()\n{\n    Username = USERNAME, \n    Password = API_KEY  \n};\nvar mmsApi = new MMSApi(configuration);\nvar response = mmsApi.MmsHistoryExportGet(\"File Name\");"
          },
          {
            "lang": "Java",
            "source": "package ClickSend;\n\nimport ClickSend.Api.MmsApi;\n\npublic class export_mms_history {\n  public static void main(String[] args) {\n    ApiClient defaultClient = new ApiClient();\n    defaultClient.setUsername(\"USERNAME\");\n    defaultClient.setPassword(\"API_KEY\");\n    MmsApi apiInstance = new MmsApi(defaultClient);\n    // String | Filename to download history as\n    String filename = \"filename_example\"; \n    try {\n        String result = apiInstance.mmsHistoryExportGet(filename);\n        System.out.println(result);\n    } catch (ApiException e) {\n        System.err.println(\"Exception when calling MmsApi#mmsHistoryExportGet\");\n        e.printStackTrace();\n    }\n  }\n}"
          },
          {
            "lang": "Node.js",
            "source": "var api = require('./api.js');\n\nvar mmsApi = new api.MMSApi(\"USERNAME\", \"API_KEY\");\n\nvar filename = \"filename\";\n\nmmsApi.mmsHistoryExportGet(filename).then(function(response) {\n  console.log(response.body);\n}).catch(function(err){\n  console.error(err.body);\n});"
          },
          {
            "lang": "Ruby",
            "source": "# load the gem\nrequire 'clicksend_client'\nrequire 'json'\n\n# setup authorization\n  config.username = 'USERNAME'\n  config.password = 'API_KEY'\nClickSendClient.configure do |config|\n  # Configure HTTP basic authorization: BasicAuth\nend\n\napi_instance = ClickSendClient::MMSApi.new\n\nfilename = \"filename_example\" # String | Filename to download history as\n\nbegin\n  # Export all mms history\n  result = api_instance.mms_history_export_get(filename)\n  p JSON.parse(result)\nrescue ClickSendClient::ApiError => e\n  puts \"Exception when calling MMSApi->mms_history_export_get: #{e.response_body}\"\nend"
          },
          {
            "lang": "Python",
            "source": "from __future__ import print_function\nimport clicksend_client\nfrom clicksend_client.rest import ApiException\n\n# Configure HTTP basic authorization: BasicAuth\nconfiguration = clicksend_client.Configuration()\nconfiguration.username = 'USERNAME'\nconfiguration.password = 'API_KEY'\n\n# create an instance of the API class\napi_instance = clicksend_client.MMSApi(clicksend_client.ApiClient(configuration))\nfilename = 'mms_history' # str | Filename to download history as\n\ntry:\n    # Export all mms history\n    api_response = api_instance.mms_history_export_get(filename)\n    print(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling MMSApi->mms_history_export_get: %s\\n\" % e)"
          },
          {
            "lang": "perl",
            "source": "use WWW::ClickSendClient::MMSApi;\n\nmy $username = 'YOUR_API_USER_NAME';\nmy $password = 'YOUR_API_PASSWORD';\n\nmy $api = WWW::ClickSendClient::MMSApi->new(username => $username, password => $password);\n\nmy $json_output = $api->mms_history_export_get('filename' => 'test_file');\n\nprint $json_output;"
          },
          {
            "lang": "objc",
            "source": "#import \"CSMMSApi.h\"\n\nCSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n// Configure HTTP basic authorization (authentication scheme: BasicAuth)\n[apiConfig setUsername:@\"YOUR_USERNAME\"];\n[apiConfig setPassword:@\"YOUR_PASSWORD\"];\n\nCSMMSApi *mmsAPI = [[CSMMSApi alloc] init];\n[mmsAPI mmsHistoryExportGetWithFilename:@\"string\" completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
          },
          {
            "lang": "swift",
            "source": "import Alamofire\n\nif let authHeader = Request.authorizationHeader(user: \"USERNAME\", password: \"PASSWORD\") {\n    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]\n}\n\nMMSAPI.mmsHistoryExportGet(filename: \"test.csv\") { (dataString, error) in\n    guard let dataString = dataString else {\n        print(error!)\n        return\n    }\n\n    if let data = dataString.data(using: String.Encoding.utf8) {\n        do {\n            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {\n                print(dictonary)\n            } else {\n                print(\"bad json\")\n            }\n        } catch let error as NSError {\n            print(error)\n        }\n    }\n}"
          }
        ]
      }
    }
  }
}