{"action":"created","issue":{"url":"https://api.github.com/repos/mgp25/WhatsAPINet/issues/13","labels_url":"https://api.github.com/repos/mgp25/WhatsAPINet/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/mgp25/WhatsAPINet/issues/13/comments","events_url":"https://api.github.com/repos/mgp25/WhatsAPINet/issues/13/events","html_url":"https://github.com/mgp25/WhatsAPINet/issues/13","id":65058925,"number":13,"title":"Send Image with caption","user":{"login":"Abtab","id":10356321,"avatar_url":"https://avatars.githubusercontent.com/u/10356321?v=3","gravatar_id":"","url":"https://api.github.com/users/Abtab","html_url":"https://github.com/Abtab","followers_url":"https://api.github.com/users/Abtab/followers","following_url":"https://api.github.com/users/Abtab/following{/other_user}","gists_url":"https://api.github.com/users/Abtab/gists{/gist_id}","starred_url":"https://api.github.com/users/Abtab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abtab/subscriptions","organizations_url":"https://api.github.com/users/Abtab/orgs","repos_url":"https://api.github.com/users/Abtab/repos","events_url":"https://api.github.com/users/Abtab/events{/privacy}","received_events_url":"https://api.github.com/users/Abtab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-29T13:01:00Z","updated_at":"2015-03-30T17:24:37Z","closed_at":null,"body":"Hi tried sending image with caption.. but not working.\r\nI have updated code but still its not adding caption. please have a look on my code and correct me if i am wrong some where:\r\n\r\nIn `whatsapp.cs` i have added caption parameter to method:\r\n\r\n```c#\r\n protected WaUploadResponse UploadFile(string b64hash, string type, long size, byte[] fileData, string to, string contenttype, string extension,string caption)\r\n        {\r\n            ProtocolTreeNode media = new ProtocolTreeNode(\"media\", new KeyValue[] {\r\n                new KeyValue(\"hash\", b64hash),\r\n                new KeyValue(\"type\", type),\r\n                new KeyValue(\"size\", size.ToString()),\r\n             new KeyValue(\"caption\", caption )\r\n            });\r\n            string id = TicketManager.GenerateId();\r\n            ProtocolTreeNode node = new ProtocolTreeNode(\"iq\", new KeyValue[] {\r\n                new KeyValue(\"id\", id),\r\n                new KeyValue(\"to\", WhatsConstants.WhatsAppServer),\r\n                new KeyValue(\"caption\", caption ),\r\n                new KeyValue(\"type\", \"set\"),\r\n               new KeyValue(\"xmlns\", \"w:m\")\r\n              \r\n            }, media);\r\n            this.uploadResponse = null;\r\n            this.SendNode(node);\r\n```\r\n\r\nothers methods updated are:\r\n\r\n```c#\r\n  public void SendMessageImage(string to, byte[] ImageData, ImageType imgtype,string caption)\r\n        {\r\n            FMessage msg = this.getFmessageImage(to, ImageData, imgtype,caption );\r\n            if (msg != null)\r\n            {\r\n                this.SendMessage(msg);\r\n            }\r\n        }\r\n\r\n\r\n\r\n\r\n       protected FMessage getFmessageImage(string to, byte[] ImageData, ImageType imgtype,string caption)\r\n        {\r\n            string type = string.Empty;\r\n            string extension = string.Empty;\r\n            switch (imgtype)\r\n            {\r\n                case ImageType.PNG:\r\n                    type = \"image/png\";\r\n                    extension = \"png\";\r\n                    break;\r\n                case ImageType.GIF:\r\n                    type = \"image/gif\";\r\n                    extension = \"gif\";\r\n                    break;\r\n                default:\r\n                    type = \"image/jpeg\";\r\n                    extension = \"jpg\";\r\n                    break;\r\n            }\r\n            \r\n            //create hash\r\n            string filehash = string.Empty;\r\n            using(HashAlgorithm sha = HashAlgorithm.Create(\"sha256\"))\r\n            {\r\n                byte[] raw = sha.ComputeHash(ImageData);\r\n                filehash = Convert.ToBase64String(raw);\r\n            }\r\n\r\n            //request upload\r\n            WaUploadResponse response = this.UploadFile(filehash, \"image\", ImageData.Length, ImageData, to, type, extension,caption );\r\n\r\n            if (response != null && !String.IsNullOrEmpty(response.url))\r\n            {\r\n                //send message\r\n                FMessage msg = new FMessage(to, true)\r\n                {\r\n                    media_wa_type = FMessage.Type.Image,\r\n                    media_mime_type = response.mimetype,\r\n                    media_name = response.url.Split('/').Last(),\r\n                    media_size = response.size,\r\n                    media_url = response.url,\r\n                    binary_data = this.CreateThumbnail(ImageData)\r\n                };\r\n                return msg;\r\n            }\r\n            return null;\r\n        }\r\n```\r\n \r\n\r\n\r\n\r\nalso updated in `tokenMap.cs` class. \r\n\r\n\r\nPlease update me If i am wrong some where."},"comment":{"url":"https://api.github.com/repos/mgp25/WhatsAPINet/issues/comments/87760078","html_url":"https://github.com/mgp25/WhatsAPINet/issues/13#issuecomment-87760078","issue_url":"https://api.github.com/repos/mgp25/WhatsAPINet/issues/13","id":87760078,"user":{"login":"Abtab","id":10356321,"avatar_url":"https://avatars.githubusercontent.com/u/10356321?v=3","gravatar_id":"","url":"https://api.github.com/users/Abtab","html_url":"https://github.com/Abtab","followers_url":"https://api.github.com/users/Abtab/followers","following_url":"https://api.github.com/users/Abtab/following{/other_user}","gists_url":"https://api.github.com/users/Abtab/gists{/gist_id}","starred_url":"https://api.github.com/users/Abtab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abtab/subscriptions","organizations_url":"https://api.github.com/users/Abtab/orgs","repos_url":"https://api.github.com/users/Abtab/repos","events_url":"https://api.github.com/users/Abtab/events{/privacy}","received_events_url":"https://api.github.com/users/Abtab/received_events","type":"User","site_admin":false},"created_at":"2015-03-30T17:24:37Z","updated_at":"2015-03-30T17:24:37Z","body":"This is debug print.. but cant find caption in this .. you cant see in above code i added caption\r\n\r\n\r\nRECVD: <iq from=\"8613025531436@s.whatsapp.net\" id=\"last_14\" type=\"result\">\r\nRECVD:   <query seconds=\"246\"></query>\r\nRECVD: </iq>\r\n\r\nRECVD: <iq from=\"s.whatsapp.net\" id=\"1427735751-15\" type=\"result\">\r\nRECVD:   <media url=\"https://mmi642.whatsapp.net/u/DYZjfnEkY2BmmuVBtwzI9wsXYswABRKEpapQqg/AuLlR8HI4TSMQT8813MT5HhcuY4iD-4RY11UngATQGSc\" ip=\"169.53.29.133\"></media>\r\nRECVD: </iq>\r\n\r\nSENT: <message to=\"918054595391@s.whatsapp.net\" type=\"media\" id=\"1427735751-16\">\r\nSENT:   <x xmlns=\"jabber:x:event\">\r\nSENT:     <server></server>\r\nSENT:   </x>\r\nSENT:   <media xmlns=\"urn:xmpp:whatsapp:mms\" type=\"image\" file=\"AuLlR8HI4TSMQT8813MT5HhcuY4iD-4RY11UngATQGSc.jpg\" size=\"9805\" url=\"https://mmi642.whatsapp.net/d/AuLlR8HI4TSMQT8813MT5HhcuY4iD-4RY11UngATQGSc.jpg\" encoding=\"raw\">--3383 byte--</media>\r\nSENT:   <offline></offline>\r\nSENT: </message>\r\n\r\nSENT: <iq id=\"last_17\" type=\"get\" to=\"8613025531436@s.whatsapp.net\" xmlns=\"jabber:iq:last\">\r\nSENT:   <query></query>\r\nSENT: </iq>\r\n\r\nRECVD: <ack from=\"918054595391@s.whatsapp.net\" id=\"1427735751-16\" class=\"message\" t=\"1427735821\"></ack>\r\nMessage 1427735751-16 to 918054595391@s.whatsapp.net received by server\r\n\r\nRECVD: <iq from=\"8613025531436@s.whatsapp.net\" id=\"last_17\" type=\"result\">\r\nRECVD:   <query seconds=\"276\"></query>\r\nRECVD: </iq>\r\n\r\nRECVD: <receipt from=\"918054595391@s.whatsapp.net\" id=\"1427735751-16\" t=\"1427735826\"></receipt>\r\nMessage 1427735751-16 to 918054595391@s.whatsapp.net received by client\r\n\r\nSENT: <ack to=\"918054595391@s.whatsapp.net\" class=\"receipt\" id=\"1427735751-16\" type=\"delivery\"></ack>\r\n"}}