{"action":"created","issue":{"url":"https://api.github.com/repos/mgp25/Chat-API/issues/1598","repository_url":"https://api.github.com/repos/mgp25/Chat-API","labels_url":"https://api.github.com/repos/mgp25/Chat-API/issues/1598/labels{/name}","comments_url":"https://api.github.com/repos/mgp25/Chat-API/issues/1598/comments","events_url":"https://api.github.com/repos/mgp25/Chat-API/issues/1598/events","html_url":"https://github.com/mgp25/Chat-API/issues/1598","id":131137729,"number":1598,"title":"Cannot get profile picture","user":{"login":"siracuervo","id":6690881,"avatar_url":"https://avatars.githubusercontent.com/u/6690881?v=3","gravatar_id":"","url":"https://api.github.com/users/siracuervo","html_url":"https://github.com/siracuervo","followers_url":"https://api.github.com/users/siracuervo/followers","following_url":"https://api.github.com/users/siracuervo/following{/other_user}","gists_url":"https://api.github.com/users/siracuervo/gists{/gist_id}","starred_url":"https://api.github.com/users/siracuervo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siracuervo/subscriptions","organizations_url":"https://api.github.com/users/siracuervo/orgs","repos_url":"https://api.github.com/users/siracuervo/repos","events_url":"https://api.github.com/users/siracuervo/events{/privacy}","received_events_url":"https://api.github.com/users/siracuervo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-03T20:08:21Z","updated_at":"2016-02-03T23:42:39Z","closed_at":"2016-02-03T21:12:19Z","body":"Hello, first thanks for this amazing work. API works great, but i cannot get a profile picture. \r\n\r\nThe contact is synced and suscribed, i can send any message (video, audio, image) but i dont get a server response when requesting profile picture.\r\nMy contact has the option in whatsapp \"who can see my profile picture\" set to everybody.\r\n\r\nThis is my script:\r\n\r\n```php\r\n<?php\r\n\r\nset_time_limit(10);\r\nrequire_once \"src/whatsprot.class.php\";\r\nrequire_once \"src/events/MyEvents.php\";\r\n\r\n\r\n$username = \"549XXXXXXXXX\";\r\n$nickname = 'Jonny';    // Your nickname, it will appear in push notifications\r\n$password = \"XXXXX\"; // The one we got registering the number\r\n$debug = true;\r\n$log = true; \r\n$target = 'XXXXXXXX'; // The number of the person you are sending the message\r\n//This function only needed to show how eventmanager works.\r\n\r\n// Create a instance of WhastPort.\r\n$w = new WhatsProt($username, $nickname, $debug, $log);\r\n\r\n//Retrieve large profile picture. Output is in /src/php/pictures/ (you need to bind a function\r\n//to the event onProfilePicture so the script knows what to do.\r\n$w->eventManager()->bind('onGetProfilePicture', 'onGetProfilePicture');\r\n$w->sendGetProfilePicture($target, true);\r\n\r\n\r\n$w->connect(); // Connect to WhatsApp network\r\n$w->loginWithPassword($password); // logging in with the password we got!\r\n\r\n$w->pollMessage();\r\n$w->pollMessage();\r\n$w->pollMessage();\r\n$w->pollMessage();\r\n\r\n  //request contact picture only on first call\r\n    $w->sendGetProfilePicture($target, true);\r\n?>\r\n```\r\n\r\nIt executes fine but when requesting the picture you can see there is a \"tx\" but not a \"rx\"\r\n\r\n```xml\r\ntx  <iq id=\"01\" type=\"get\" xmlns=\"w:profile:picture\" to=\"54991133209595@s.whatsapp.net\">\r\ntx    <picture type=\"image\"></picture>\r\ntx  </iq>\r\n\r\ntx  <stream:features></stream:features>\r\n\r\ntx  <auth user=\"5491126710678\" mechanism=\"WAUTH-2\">22571ea135343931313236373130363738b769e60be63dc748f1204f6c93b6b48a0284f62d31343534353330303236</auth>\r\n\r\nrx  <from s.whatsapp.net=\"\"></from>\r\n\r\nrx  <stream:features></stream:features>\r\n\r\nrx  <challenge>0d5f512d689c8b8c63f74123d5bfdd4c12866f20</challenge>\r\n\r\ntx  <response>b5c64fa9391f82660a93b4bc57ed3b740cd3b3cc23a2a16f810e41dee800a3bf61d02f92174e155c454abce2e477a66c0e23e74743fbf1d991b5a2c810ff90a0a2b51d3f1adc31f079e3dc1e49bf80</response>\r\n\r\nrx  <success t=\"1454530027\" props=\"4\" kind=\"free\" status=\"active\" creation=\"1454443826\" expiration=\"4444444444\">38438199165ade3a63b5020f26578ec3a4bb9a81</success>\r\n\r\ntx  <presence name=\"Jonny\" type=\"available\"></presence>\r\n\r\ntx  <iq id=\"02\" xmlns=\"jabber:iq:privacy\" type=\"get\">\r\ntx    <query>\r\ntx      <list name=\"default\"></list>\r\ntx    </query>\r\ntx  </iq>\r\n\r\ntx  <iq id=\"03\" xmlns=\"urn:xmpp:whatsapp:push\" type=\"get\" to=\"s.whatsapp.net\">\r\ntx    <config></config>\r\ntx  </iq>\r\n\r\nrx  <ib from=\"s.whatsapp.net\">\r\nrx    <offline count=\"0\"></offline>\r\nrx  </ib>\r\n\r\nrx  <presence from=\"5491126710678@s.whatsapp.net\"></presence>\r\n\r\nrx  <iq from=\"5491126710678@s.whatsapp.net\" type=\"error\" id=\"02\">\r\nrx    <error code=\"404\" text=\"item-not-found\"></error>\r\nrx  </iq>\r\n\r\ntx  <iq id=\"04\" type=\"set\" xmlns=\"urn:xmpp:whatsapp:push\" to=\"s.whatsapp.net\">\r\ntx    <config platform=\"gcm\" id=\"OWwLk_FcbpR:APA91bOGiObQTpaIu3M8FhrPLKi4ERR7VNUfHdWMroi7lJKOGppjMoVa5ZQ1kf2T8FcyWL_m33Jn-xX9al4oya6QM_Ac7iH8B0t_Xhju7nF6h6P_k_pZcaHADyW7chmnkqc8Z0UFX8Sk\"></config>\r\ntx  </iq>\r\n\r\nrx  <iq from=\"s.whatsapp.net\" type=\"result\" id=\"03\">\r\nrx    <config platform=\"gcm\" id=\"nR1iV_EiJPS:APA91byoNUFQDwxkcDR7Uhcmu8etmT0aXXavQkzP5itza5qbK9YaIfyAzQ9h7pNrpmgIvP_JOj2F-XvhfFXxpoKiE_MZ8nhu84y_S6PX4FkS9Ma_G_xxriKdc1RKtRCx8PkhSiaRlWxb\"></config>\r\nrx  </iq>\r\n\r\n//this is what i mean\r\ntx  <iq id=\"05\" type=\"get\" xmlns=\"w:profile:picture\" to=\"54991133209595@s.whatsapp.net\">\r\ntx    <picture type=\"image\"></picture>\r\ntx  </iq>\r\n\r\n```\r\n\r\nI have tried with the examplefuctional script but it gives me the same, just changes de id to \"03\" instead of \"05\".\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/mgp25/Chat-API/issues/comments/179534425","html_url":"https://github.com/mgp25/Chat-API/issues/1598#issuecomment-179534425","issue_url":"https://api.github.com/repos/mgp25/Chat-API/issues/1598","id":179534425,"user":{"login":"mgp25","id":5390120,"avatar_url":"https://avatars.githubusercontent.com/u/5390120?v=3","gravatar_id":"","url":"https://api.github.com/users/mgp25","html_url":"https://github.com/mgp25","followers_url":"https://api.github.com/users/mgp25/followers","following_url":"https://api.github.com/users/mgp25/following{/other_user}","gists_url":"https://api.github.com/users/mgp25/gists{/gist_id}","starred_url":"https://api.github.com/users/mgp25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgp25/subscriptions","organizations_url":"https://api.github.com/users/mgp25/orgs","repos_url":"https://api.github.com/users/mgp25/repos","events_url":"https://api.github.com/users/mgp25/events{/privacy}","received_events_url":"https://api.github.com/users/mgp25/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T23:42:39Z","updated_at":"2016-02-03T23:42:39Z","body":"Use event system, is explained in the wiki, and there are also examples.\r\n\r\nRegards"}}