def send_message(from, to, body, contains_markup, options={ spool: true,
      spool_timeout: 60*60*24*7, auth_token: nil })

      auth_token = options[:auth_token] || @auth_token

      if from == @app_name
        check_auth_token(auth_token, ["message/send"])
      else
        check_auth_token(auth_token, ["message/user"])
      end

      response = http_client(MXIT_API_URI + "/message/send/") do |http, path|

        request = Net::HTTP::Post.new(path)
        set_api_headers(request, auth_token.access_token)

        spool = options[:spool].nil? ? true : options[:spool]
        spool_timeout = options[:spool_timeout] || 60*60*24*7

        request.body = {
          "Body" => body,
          "ContainsMarkup" => contains_markup,
          "From" => from,
          "To" => to,
          "Spool" => spool,
          "SpoolTimeOut" => spool_timeout
        }.to_json

        http.request(request)
      end

      handle_response(response)
    end
def send_message(from, to, body, contains_markup, options={ spool: true,
      spool_timeout: 60*60*24*7, auth_token: nil })

      auth_token = options[:auth_token] || @auth_token

      if from == @app_name
        check_auth_token(auth_token, ["message/send"])
      else
        check_auth_token(auth_token, ["message/user"])
      end

      response = http_client(MXIT_API_URI + "/message/send/") do |http, path|

        request = Net::HTTP::Post.new(path)
        set_api_headers(request, auth_token.access_token)

        spool = options[:spool].nil? ? true : options[:spool]
        spool_timeout = options[:spool_timeout] || 60*60*24*7

        request.body = {
          "Body" => body,
          "ContainsMarkup" => contains_markup,
          "From" => from,
          "To" => to,
          "Spool" => spool,
          "SpoolTimeOut" => spool_timeout
        }.to_json

        http.request(request)
      end

      handle_response(response)
    end
API methods requiring authorisation.
 When sending as the app the `message/send` scope is required otherwise `message/user`