title: How to import mailbox from Yandex Mail for Domain API
body: <p><strong>THE SITUATION:</strong></p>
  
  <p>I am going to use <a href="https://tech.yandex.com/domain/doc/concepts/termin-docpage/" rel="nofollow">Yandex Mail for Domain API</a> for my app. <br />
  I am testing all the http request to the API, using php curl.
  Everything is working fine except two functions: <br /></p>
  
  <ul>
  <li>Import single mailbox </li>
  <li>Import multiple mailboxes</li>
  </ul>
  
  <p>I don't know if the problem is related to the sintax or to other factors.</p>
  
  <p><strong>THE CODE:</strong></p>
  
  <pre><code>public function yandex_import_mailbox()
  {
      $url ='https://pddimp.yandex.ru/api2/admin/import/start_one_import?domain=MY_DOMAIN.com&amp;method=pop3&amp;server=pop.yandex.ru&amp;port=110&amp;ssl=no&amp;ext-login=NAME@MY_DOMAIN.com&amp;ext-passwd=MY_PASSWORD&amp;int-login=LOGIN_YANDEX_API&amp;int-passwd=PASSWORD_YANDEX_API';
  
      $header = array("PddToken: MY_TOKEN");
  
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)');
  
      $retValue = curl_exec($ch);
      $response = json_decode(curl_exec($ch));
      $ee       = curl_getinfo($ch);
      print_r($ee);
  
      print_r($retValue);
  }
  </code></pre>
  
  <p>This the json that i get:</p>
  
  <pre><code>{"domain": "MY_DOMAIN.com", "success": "error", "error": "empty_import_list"}
  </code></pre>
  
  <p><br/><br/>
  <strong>THE DOCUMENTATION:</strong></p>
  
  <p>This is the documentation link, to the section regarding the import of a single mailbox.</p>
  
  <p><a href="https://tech.yandex.com/domain/doc/reference/import-start-one-docpage/" rel="nofollow">https://tech.yandex.com/domain/doc/reference/import-start-one-docpage/</a></p>
  
  <p><br/><br/>
  <strong>WORKING EXAMPLE:</strong></p>
  
  <p>This is an example of a working http request, which outcome is related to this issue. The function return the status of the import.</p>
  
  <pre><code>public function yandex_get_import_status()
  {
      $url = 'https://pddimp.yandex.ru/api2/admin/import/check_imports?domain=MY_DOMAIN.com';
  
      $header = array("PddToken: MY_TOKEN");
  
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)');
  
      $retValue = curl_exec($ch);
      $response = json_decode(curl_exec($ch));
      $ee       = curl_getinfo($ch);
      print_r($ee);
  
      print_r($retValue);
  }
  </code></pre>
  
  <p>This is the output, in json format:</p>
  
  <pre><code>{"import": {"on_page": 10, "complete_box_count": 0, "failed_boxes_current_page": 1, "total_box_count": 0, "done_box_count": 0, "state": "no_import", "failed_boxes_count": 0, "total_message_count": 0, "failed_boxes_pages": 0, "page": 1, "failed_boxes": []}, "domain": "MY_DOMAIN.com", "progress_percent": 0, "success": "ok", "settings": {"port": 0, "ssl": "yes", "method": "", "server": ""}}
  </code></pre>
  
  <p><br /><br />
  <strong>THE QUESTION:</strong> </p>
  
  <p>How can i properly make the http request to import a single mailbox to the Yandex Mail for Domain API?</p>