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


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


        Refer to [<b>Application Status
        Codes</b>](https://developers.clicksend.com/docs/rest/v3/#application-status-codes)
        for the possible response message status strings.


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


        ### Standard MMS Message


        1500 characters


        ### Unicode MMS Message


        500 characters


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


        ### Maximum File Size


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


        ### Supported File Types


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

        - This will return a URL to the converted image file that can be used in
        the /mms/send endpoint.

        - Contact us to add support for any other file type.
            

        ### Images


        | File type | Required to be passed to uploads endpoint first? |

        | --- | --- |

        | `jpg` | No |

        | `gif` | No |

        | `jpeg` | Yes |

        | `png` | Yes |

        | `bmp` | Yes |


        ### Properties


        | Name | Type | Required | Restrictions | Description |

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

        | media_file | string | true | none | Media file you want to send |

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

        | body | string | true | none | Your message |

        | subject | string | true | none | Subject line (max 20 characters) |

        | from | string | true |
        [yes](http://help.clicksend.com/SMS/what-is-a-sender-id-or-sender-number)
        | Your sender id |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              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 \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \

                 --data-binary "    {
                    \"media_file\":\"http://yourdomain.com/tpLaX6A.gif\",
                    \"messages\":[
                       {
                         \"source\" : \"php\",
                         \"subject\": \"This is a subject\",
                         \"from\" : \"test\",
                         \"body\" : \"This is a test body with special character: 英\",
                         \"to\": \"+61437111222\",
                         \"country\": \"AU\"
                       }
                    ]
                }" \
            'https://rest.clicksend.com/v3/mms/send'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

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

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

            $mms_message = new \ClickSend\Model\MmsMessage();

            $mms_message->setTo("+61437111222");

            $mms_message->setBody("This is a test body with special character");

            $mms_message->setSubject("This is a subject");

            $mms_message->setFrom("test");

            $mms_message->setCountry("AU");

            $mms_message->setSource("php");

            $mms_message->setListId(185161);

            $mms_message->setCustomString("custom");

            $mms_message->setFromEmail("xxx@gmail.com");

            // \ClickSend\Model\MmsMessageCollection | MmsMessageCollection
            model

            $mms_messages = new \ClickSend\Model\MmsMessageCollection();

            $mms_messages->setMediaFile("https://media.tenor.com/images/a3c2a6cf42e0ac49ebd7cd347d10fe94/tenor.gif");

            $mms_messages->setMessages([$mms_message]);


            try {
                $result = $apiInstance->mmsSendPost($mms_messages);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling MMSApi->mmsSendPost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var mmsApi = new MMSApi(configuration);

            var listOfMessages = new List<MmsMessage>();

            listOfMessages.Add(new MmsMessage() { 
                To = "+11231231234",
                Body = "This is test body",
                Subject = "test subject",
                From = "+11231231234",
                Country = "CA",
                Source = "sdk",
                Schedule = TimeStamp,
                CustomString = "Custom String",
                FromEmail = "john@doe.com"
            });

            var mmsCollection = new
            MmsMessageCollection("https://yourdomain.com/file.jpg",
            listOfMessages);

            var response = mmsApi.MmsSendPost(mmsCollection);
        - lang: Java
          source: |-
            package ClickSend;

            import java.util.Arrays;
            import java.util.List;
            import ClickSend.Api.MmsApi;
            import ClickSend.Model.MmsMessage;
            import ClickSend.Model.MmsMessageCollection;

            public class send_mms {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                MmsApi apiInstance = new MmsApi(defaultClient);
                MmsMessage mmsMessage=new MmsMessage();
                mmsMessage.to("+61437111222");
                mmsMessage.body("This is a test body with special character");
                mmsMessage.subject("This is a subject");
                mmsMessage.from("test");
                mmsMessage.country("AU");
                mmsMessage.source("source");
                List<MmsMessage> mmsMessageList=Arrays.asList(mmsMessage);
                // MmsMessageCollection | MmsMessageCollection model
                MmsMessageCollection mmsMessages = new MmsMessageCollection(); 
                mmsMessages.mediaFile("https://test.com/test.gif");
                mmsMessages.messages(mmsMessageList);
                try {
                    String result = apiInstance.mmsSendPost(mmsMessages);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling MmsApi#mmsSendPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var mmsApi = new api.MMSApi("USERNAME", "API_KEY");

            var mmsMessage = new api.MmsMessage();

            mmsMessage.to = "+61437111222";
            mmsMessage.body = "body";
            mmsMessage.subject = "subject";
            mmsMessage.from = "abc@gmail.com";
            mmsMessage.country = "US";
            mmsMessage.source = "source";
            mmsMessage.listId = 185161;
            mmsMessage.customString = "custom";
            mmsMessage.fromEmail = "xxx@gmail.com";

            var mmsMessages = new api.MmsMessageCollection();

            mmsMessages.mediaFile = "https://yourdomain/sample.gif";
            mmsMessages.messages = [mmsMessage]

            mmsApi.mmsSendPost(mmsMessages).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::MMSApi.new

            # MmsMessageCollection | MmsMessageCollection model
            mms_messages = ClickSendClient::MmsMessageCollection.new(
              "media_file": "media_file",
              messages: [
                ClickSendClient::MmsMessage.new(
                  "schedule": 0,
                  "subject": "subject",
                  "from": "from",
                  "to": "+61411111111",
                  "source": "sdk",
                  "body": "body",
                  "custom_string": "custom_string"
                ),
                ClickSendClient::MmsMessage.new(
                  "schedule": 0,
                  "subject": "subject",
                  "from": "from",
                  "to": "+61422222222",
                  "source": "sdk",
                  "body": "body",
                  "custom_string": "custom_string"
                )
              ]
            )

            begin
              # Send MMS
              result = api_instance.mms_send_post(mms_messages)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling MMSApi->mms_send_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client import MmsMessage

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

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

            MmsMessage=MmsMessage(to='+61437111222',
                                  body='This is a test body with special character',
                                  subject='This is a subject',
                                  _from='test',
                                  country='AU')
            mms_messages = clicksend_client.MmsMessageCollection(
                          media_file='https://test.com/test.gif',
                          messages=[MmsMessage])
            try:
                # Send MMS
                api_response = api_instance.mms_send_post(mms_messages)
                print(api_response)
            except ApiException as e:
                print("Exception when calling MMSApi->mms_send_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::MMSApi;

            use WWW::ClickSendClient::Object::MmsMessageCollection;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my %params = (
                'media_file' => 'https://domain.com/Example.jpg',
                'messages'   => [
                    {
                        'to'            => 'to',
                        'body'          => 'body',
                        'subject'       => 'subject',
                        'from'          => 'from',
                        'country'       => 'country',
                        'source'        => 'source',
                        'schedule'      => 'schedule',
                        'custom_string' => 'custom_string',
                        'from_email'    => 'from_email',
                        'messages'      => 'messages',
                    }
                ],
            );


            my $mms_messages_obj =
            WWW::ClickSendClient::Object::MmsMessageCollection->new(%params);


            my $json_output = $api->mms_send_post('mms_messages' =>
            $mms_messages_obj);


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


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

            smsMessages.from = @"from";

            smsMessages.body = @"body";

            smsMessages.to = @"to";

            smsMessages.source = @"objc";

            smsMessages.schedule = nil;

            smsMessages.customString = @"custom_string";

            smsMessages.listId = nil;

            smsMessages.country = @"country";

            smsMessages.fromEmail = @"from_email";


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


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

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


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


            let messages = MmsMessage(to: "to",
                                      body: "body",
                                      subject: "subject",
                                      from: "from",
                                      country: "country",
                                      source: "swift",
                                      listId: 1,
                                      schedule: nil,
                                      customString: "custom_string",
                                      fromEmail: nil)

            let mmsMessages =  MmsMessageCollection(mediaFile: "mediaFile",
            messages: [messages])

            MMSAPI.mmsSendPost(mmsMessages: mmsMessages) { (dataString, error)
            in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/mms/price:
    post:
      summary: Calculate MMS Price
      operationId: calculate-mms-price
      description: >-
        _Get Price for MMS sent_


        ### Properties


        | Name | Type | Required | Restrictions | Description |

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

        | media_file | string | true | none | Media file you want to send |

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

        | body | string | true | none | Your message |

        | subject | string | true | none | Subject line (max 20 characters) |

        | from | string | true |
        [yes](http://help.clicksend.com/SMS/what-is-a-sender-id-or-sender-number)
        | Your sender id |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              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 \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \

                 --data-binary "    {
                    \"media_file\":\"http://yourdomain.com/tpLaX6A.gif\",
                    \"messages\":[
                       {
                         \"source\" : \"php\",
                         \"subject\": \"This is a subject\",
                         \"from\" : \"test\",
                         \"body\" : \"This is a test body with special character: 英\",
                         \"to\": \"+61437111222\",
                         \"country\": \"AU\"
                       }
                    ]
                }" \
            'https://rest.clicksend.com/v3/mms/price'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

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

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

            $mms_message = new \ClickSend\Model\MmsMessage();

            $mms_message->setTo("+61437111222");

            $mms_message->setBody("This is a test body with special character");

            $mms_message->setSubject("This is a subject");

            $mms_message->setFrom("test");

            $mms_message->setCountry("AU");

            $mms_message->setSource("php");

            $mms_message->setListId(185161);

            $mms_message->setCustomString("custom");

            $mms_message->setFromEmail("xxx@gmail.com");

            // \ClickSend\Model\MmsMessageCollection | MmsMessageCollection
            model

            $mms_messages = new \ClickSend\Model\MmsMessageCollection();

            $mms_messages->setMediaFile("https://media.tenor.com/images/a3c2a6cf42e0ac49ebd7cd347d10fe94/tenor.gif");

            $mms_messages->setMessages([$mms_message]);


            try {
                $result = $apiInstance->mmsPricePost($mms_messages);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling MMSApi->mmsPricePost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var mmsApi = new MMSApi(configuration);

            var listOfMessages = new List<MmsMessage>();

            listOfMessages.Add(new MmsMessage(
                to: "+11231231234",
                body: "This is test body",
                subject: "test subject",
                from: "+11231231234",
                country: "CA",
                source: "sdk",
                schedule: TimeStamp,
                customString: "Custom String",
                fromEmail: "john@doe.com"
            ));

            var mmsCollection = new
            MmsMessageCollection("https://mydomain.com/file.jpg",
            listOfMessages);

            var response = mmsApi.MmsPricePost(mmsCollection);
        - lang: Java
          source: |
            package ClickSend;

            import java.util.Arrays;
            import java.util.List;
            import ClickSend.Api.MmsApi;
            import ClickSend.Model.MmsMessage;
            import ClickSend.Model.MmsMessageCollection;

            public class calculate_mms_price {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                MmsApi apiInstance = new MmsApi(defaultClient);
                MmsMessage mmsMessage=new MmsMessage();
                mmsMessage.to("+61437111222");
                mmsMessage.body("This is a test body with special character");
                mmsMessage.subject("This is a subject");
                mmsMessage.from("test");
                mmsMessage.country("AU");
                mmsMessage.source("source");
                List<MmsMessage> mmsMessageList=Arrays.asList(mmsMessage);
                // MmsMessageCollection | MmsMessageCollection model
                MmsMessageCollection mmsMessages = new MmsMessageCollection(); 
                mmsMessages.mediaFile("https://test.com/test.gif");
                mmsMessages.messages(mmsMessageList);
                try {
                    String result = apiInstance.mmsPricePost(mmsMessages);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling MmsApi#mmsPricePost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var mmsApi = new api.MMSApi("USERNAME", "API_KEY");

            var mmsMessage = new api.MmsMessage();

            mmsMessage.to = "+61437111222";
            mmsMessage.body = "body";
            mmsMessage.subject = "subject";
            mmsMessage.from = "abc@gmail.com";
            mmsMessage.country = "US";
            mmsMessage.source = "source";
            mmsMessage.listId = 185161;
            mmsMessage.customString = "custom";
            mmsMessage.fromEmail = "xxx@gmail.com";

            var mmsMessages = new api.MmsMessageCollection();

            mmsMessages.mediaFile = "https://your-domain/sample.gif";
            mmsMessages.messages = [mmsMessage]

            mmsApi.mmsPricePost(mmsMessages).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::MMSApi.new

            # MmsMessageCollection | MmsMessageCollection model
            mms_messages = ClickSendClient::MmsMessageCollection.new(
              "media_file": "media_file",
              messages: [
                ClickSendClient::MmsMessage.new(
                  "subject": "subject",
                  "from": "from",
                  "to": "+61411111111",
                  "source": "sdk",
                  "body": "body",
                  "custom_string": "custom_string"
                ),
                ClickSendClient::MmsMessage.new(
                  "subject": "subject",
                  "from": "from",
                  "to": "+61422222222",
                  "source": "sdk",
                  "body": "body",
                  "custom_string": "custom_string"
                )
              ]
            )

            begin
              # Get Price for MMS sent
              result = api_instance.mms_price_post(mms_messages)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling MMSApi->mms_price_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client import MmsMessage

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

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

            MmsMessage=MmsMessage(to='+61437111222',
                                  body='This is a test body with special character',
                                  subject='This is a subject',
                                  _from='test',
                                  country='AU')
            # MmsMessageCollection | MmsMessageCollection model

            mms_messages = clicksend_client.MmsMessageCollection(
                            media_file='https://test.com/test.gif',
                            messages=[MmsMessage]) 

            try:
                # Get Price for MMS sent
                api_response = api_instance.mms_price_post(mms_messages)
                print(api_response)
            except ApiException as e:
                print("Exception when calling MMSApi->mms_price_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::MMSApi;

            use WWW::ClickSendClient::Object::MmsMessageCollection;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


            my %params = (
                'media_file' => 'https://domain.com/Example.jpg',
                'messages'   => [
                    {
                        'to'            => 'to',
                        'body'          => 'body',
                        'subject'       => 'subject',
                        'from'          => 'from',
                        'country'       => 'country',
                        'source'        => 'source',
                        'schedule'      => 'schedule',
                        'custom_string' => 'custom_string',
                        'from_email'    => 'from_email',
                        'messages'      => 'messages',
                    }
                ],
            );


            my $mms_messages_obj =
            WWW::ClickSendClient::Object::MmsMessageCollection->new(%params);


            my $json_output = $api->mms_price_post('mms_messages' =>
            $mms_messages_obj);


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


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

            smsMessages.from = @"from";

            smsMessages.body = @"body";

            smsMessages.to = @"to";

            smsMessages.source = @"objc";

            smsMessages.schedule = nil;

            smsMessages.customString = @"custom_string";

            smsMessages.listId = nil;

            smsMessages.country = @"country";

            smsMessages.fromEmail = @"from_email";


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


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

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


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


            let messages = MmsMessage(to: "to",
                                      body: "body",
                                      subject: "subject",
                                      from: "from",
                                      country: "country",
                                      source: "swift",
                                      listId: 1,
                                      schedule: nil,
                                      customString: nil,
                                      fromEmail: nil)

            let mmsMessages = MmsMessageCollection(mediaFile: "media_file",
            messages: [messages])

            MMSAPI.mmsPricePost(mmsMessages:mmsMessages) { (dataString, error)
            in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/mms/history:
    get:
      summary: View MMS History
      operationId: view-mms-history
      description: >-
        _Get all mms history_


        ### Parameters


        | Parameter | In | Type | Required | Description |

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

        | date_from | query | integer(int32) | false | Start date (Unix
        Timestamp e.g. 1436849372) |

        | date_to | query | integer(int32) | false | End date (Unix Timestamp
        e.g. 1436879372) |

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

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



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - 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 \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/mms/history?date_from=&date_to='
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

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

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

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

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

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

            $page = 1; // int | Page number

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


            try {
                $result = $apiInstance->mmsHistoryGet($q, $date_from, $date_to, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling MMSApi->mmsHistoryGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var mmsApi = new MMSApi(configuration);


            var q = "q_example";

            var dateFrom = '1436879372';

            var dateTo = '1436879372';

            var page = 1;

            var limit = 10;


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

            import ClickSend.Api.MmsApi;

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


            var mmsApi = new api.MMSApi("USERNAME", "API_KEY");


            var q = "q_example";

            var dateFrom = '1436879372';

            var dateTo = '1436879372';

            var page = 1;

            var limit = 10;


            mmsApi.mmsHistoryGet(q, dateFrom, dateTo, page,
            limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::MMSApi.new

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

            begin
              # Get all mms history
              result = api_instance.mms_history_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling MMSApi->mms_history_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

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

            date_from = 1436879372 # int | Start date (optional)

            date_to = 1436879372 # int | End date (optional)

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

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


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


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


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


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];



            CSMMSApi *mmsAPI = [[CSMMSApi alloc] init];


            NSNumber *dateFromTimestamp = [NSNumber numberWithInt:1436849372];

            NSNumber *dateToTimestamp = [NSNumber numberWithInt:1436879372];


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


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


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

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/mms/history/export:
    get:
      summary: Export MMS History
      operationId: export-mms-history
      description: >-
        _Export all mms history_


        ### Parameters


        | Parameter | In | Type | Required | Description |

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

        | filename | query | string | true | Filename to download history as |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: filename
          in: query
          schema:
            type: string
          example: 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 \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/mms/history/export?filename={filename}'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

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

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

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


            try {
                $result = $apiInstance->mmsHistoryExportGet($filename);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling MMSApi->mmsHistoryExportGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var mmsApi = new MMSApi(configuration);
            var response = mmsApi.MmsHistoryExportGet("File Name");
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.MmsApi;

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

            var mmsApi = new api.MMSApi("USERNAME", "API_KEY");

            var filename = "filename";

            mmsApi.mmsHistoryExportGet(filename).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: >-
            # load the gem

            require 'clicksend_client'

            require 'json'


            # setup authorization
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
            end


            api_instance = ClickSendClient::MMSApi.new


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


            begin
              # Export all mms history
              result = api_instance.mms_history_export_get(filename)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling MMSApi->mms_history_export_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

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

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


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


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


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


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


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


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

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

            [apiConfig setUsername:@"YOUR_USERNAME"];

            [apiConfig setPassword:@"YOUR_PASSWORD"];


            CSMMSApi *mmsAPI = [[CSMMSApi alloc] init];

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


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


            MMSAPI.mmsHistoryExportGet(filename: "test.csv") { (dataString,
            error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("bad json")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
