Template:Json DirectMessageSend Block - Java

From Updox API
Revision as of 16:28, 2 December 2013 by Frank (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
   private Map<String,Object> BuildMessage() throws Exception
   {
       Map<String,Object> messageData = new HashMap();
       List<String> to = new ArrayList<String>();
       to.add("dublin@direct.updoxqa.com");
       messageData.put("to",to);
       messageData.put("subject","Test Subject");
       messageData.put("textMessage","Test message body");
       List<Map<String,String>> attachments = new ArrayList<Map<String,String>>();
       Map<String,String> attachment = new HashMap();
       attachment.put("content", "CgoKCgoKCgoKCgoKCgoKCgoKCgoKVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1Qg VEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRF U1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lT QVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJ U0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1Qg VEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRF U1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lT QVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJ U0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1Qg VEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRF U1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lT QVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJ U0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1Qg VEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1QgVEhJU0lTQVRFU1Qg");
       attachment.put("mimeType", "text/plain");
       attachment.put("fileName", "test.txt");
       attachments.add(attachment);
       Map<String,String>[] attachmentMap = attachments.toArray(new HashMap[attachments.size()]);
       messageData.put("attachments", attachmentMap);
       Map<String,String> authData = new HashMap();
       authData.put("applicationId", "updox");
       authData.put("applicationPassword", "password");
       authData.put("accountId", "605");
       authData.put("userId", "605");
       messageData.put("auth", authData);
       return messageData;
   }