Liking cljdoc? Tell your friends :D

smsbrana

A connector for SMS brána https://www.smsbrana.cz

CircleCI Dependencies Status License

Leiningen/Boot

[smsbrana "0.2.0"]

Documentation

All functions are designed to return errors instead of throwing exceptions.

All API calls return a tuple within following structure: [keyword response http-response] where keyword can be:

  • :ok when a response is a success and parsed
  • :error when a response is parsed but it's an error response
  • :error-malformed when a response is not an expected XML structure
  • :error-unmarshalling when a response is not a valid XML

A response is a parsed body of an original HTTP response.

To be able to run examples this line is needed:

(require '[smsbrana.core :as sms])

send

Sends a SMS within opts.

(sms/send {:login "login", :password "password", :message "TEST", :number "+420777666555"})
;; [:ok
;;  {:credit 1523.32, :price 1.1, :sms_count 1, :sms_id "377351", :err 0}
;;  {:request-time 386, ...

Example of an error response:

(sms/send {:login "login", :password "password", :message "TEST", :number "+420777666555"})
;; [:error
;;  {:err 4}
;;  {:request-time 386, ...

Or

(sms/send {:login "login", :password "password", :message "TEST", :number "+420777666555"})
;; [:error-unmarshalling
;;  nil
;;  {:request-time 386, ...

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close