Leads can be imported through our interface, or via API.

Using Dashly interface for leads import

Dashly has a user import interface, but it’s usage has limitations. For instance, only 4000 users can be imported at once. User import interface is described in detail in our knowledge base

Import via REST API

Leads can be imported via REST API by using set user properties.

Important! Refrain from synchronous API calls, while importing. They can result in high load on our service and cause your token being banned. Optimal calls frequency — 2-3 per second.

PHP example:

# Список пользователей, которых нужно импортировать
# Первый элемент - User ID из вашей системы
$users = array(
    array('id' => 123,
          'email' => 'mail1@mail.com',
          'phone' => '891xxxxxx',
          'name' => 'Test'
    ),
    array('id' => 456,
          'email' => 'mail2@mail.com',
          'phone' => '891xxxxxx',
          'name' => 'Test2'
    )
);
$auth_token = 'xxx'  # TODO: Insert your AUTH_TOKEN. Can be copied in settings > API keys


for ($i =0; $i < count($users); ++$i ) {
    $url = 'http://api.dashly.app/v1/users/'.$users[$i]['id'].'/props?auth_token='.$auth_token;
    $operations = json_encode(array(
            array('op' => 'update_or_create',
                  'key' => '$email',
                  'value' => $users[$i]['email']
            ),
            array('op' => 'update_or_create',
                  'key' => '$phone',
                  'value' => $users[$i]['phone']
            ),
            array('op' => 'update_or_create',
                  'key' => '$name',
                  'value' => $users[$i]['name']
            ),
        )
    );

    $result = file_get_contents($url, false, stream_context_create(array(
      'http' => array(
        'method'  => 'POST',
        'header'  => 'Content-type: application/x-www-form-urlencoded',
        'content' =>http_build_query(array('operations' => $operations,'by_user_id'  => 'true')),
      )
    )));


    print $result;
}