Commits

MailChimp committed bea79d6

Add /messages/info API call

Comments (0)

Files changed (3)

     port:   443,
     prefix: '/api/1.0/',
     method: 'POST',
-    headers: {'Content-Type': 'application/json', 'User-Agent': 'Mandrill-Node/1.0.26'}
+    headers: {'Content-Type': 'application/json', 'User-Agent': 'Mandrill-Node/1.0.27'}
 }
 
 class exports.Mandrill
         @master.call('messages/search', params, onsuccess, onerror)
 
     ###
+    Get the information for a single recently sent message
+    @param {Object} params the hash of the parameters to pass to the request
+    @option params {String} id the unique id of the message to get - passed as the "_id" field in webhooks, send calls, or search calls
+    @param {Function} onsuccess an optional callback to execute when the API call is successfully made
+    @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception
+    ###
+    info: (params={}, onsuccess, onerror) ->
+        if typeof params == 'function'
+            onerror = onsuccess
+            onsuccess = params
+            params = {}
+
+
+        @master.call('messages/info', params, onsuccess, onerror)
+
+    ###
     Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces
     @param {Object} params the hash of the parameters to pass to the request
     @option params {String} raw_message the full MIME document of an email message
     method: 'POST',
     headers: {
       'Content-Type': 'application/json',
-      'User-Agent': 'Mandrill-Node/1.0.26'
+      'User-Agent': 'Mandrill-Node/1.0.27'
     }
   };
 
     };
 
     /*
+        Get the information for a single recently sent message
+        @param {Object} params the hash of the parameters to pass to the request
+        @option params {String} id the unique id of the message to get - passed as the "_id" field in webhooks, send calls, or search calls
+        @param {Function} onsuccess an optional callback to execute when the API call is successfully made
+        @param {Function} onerror an optional callback to execute when the API call errors out - defaults to throwing the error as an exception
+    */
+
+
+    Messages.prototype.info = function(params, onsuccess, onerror) {
+      if (params == null) {
+        params = {};
+      }
+      if (typeof params === 'function') {
+        onerror = onsuccess;
+        onsuccess = params;
+        params = {};
+      }
+      return this.master.call('messages/info', params, onsuccess, onerror);
+    };
+
+    /*
         Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces
         @param {Object} params the hash of the parameters to pass to the request
         @option params {String} raw_message the full MIME document of an email message
   "author": "Mandrill Devs <community@mandrill.com> (http://mandrill.com)",
   "name": "mandrill-api",
   "description": "The official API client for the Mandrill email as a service product.",
-  "version": "1.0.26",
+  "version": "1.0.27",
   "homepage": "https://bitbucket.org/mailchimp/mandrill-api-node",
   "repository": {
     "type": "git",