                                       walk/keywordize-keys)]
                         (if (:error body)
                             (throw (Exception. (if (:message body) (:message body)
-                                                                   "Error or blank response from Beats Platform.")))
+                                                                   "Error or blank response from GMail.")))
                             body))
                 :raw @response
                 :url {:url (get-in @response [:opts :url])})

  (api-request :get (str "/users/me/messages/" message-id) {:format (name format)} :auth (get-token)))

(defn message-send
  "Sends an email to a specified user."
  [message & {:keys [thread-id]}]
  (let [message (if (map? message) (map->mime message) message)
        bytes (with-open [os (java.io.ByteArrayOutputStream.)]
                (.writeTo message os)
                (.toByteArray os))
        b64 (str->b64 bytes)]
    (api-request :post-json "/users/me/messages/send" {:raw (URLEncoder/encode b64 "UTF-8")} :auth (get-token) :resp :raw)))

; Users.threads


                (.writeTo message os)
                (.toByteArray os))
        b64 (str->b64 bytes)]
    (api-request :post-json "/users/me/drafts" {:message {:raw (URLEncoder/encode b64 "UTF-8")}} :auth (get-token))))

(defn draft-delete
  "Delete a draft by message-id."
