Forums

Exporting Contact Database for Dummies

 Hi,


I am swimming in information about how to use the API, and how to retrieve contact details, and I don't know whether to take the Red pill or the Blue pill, frankly.


We are establishing a Learning Management system with a WP Template and I wanted an simple, automatic way to incorporate the details from our Contact Database so that people would only need to remember one username and password to access Elvanto and our LMS. I can manually create a csv with the data I need, but as time goes on I would prefer it to automatically push changes.


I am hoping to only retrieve the following [username, email, security_code, departments, volunteer (if active), firstname]

But I also need to categorise a user if they are the leader of a department.


I can use a plugin to perfrom a cron job to periodically check if a csv has new information. But how would I use the API to daily call for the same data to be export to a csv file?


Is there some basic information to get me underway, or if I engage someone more API friendly, what would I say to engage them?


Thanks

Hi Alby!


Thanks for the email.


At this stage it's not possible to ONLY get those fields, but I would suggest something along the following lines.


First of all, as you've said this is for Wordpress you can make use of our PHP API Wrapper to make getting the calls a little easier for you. 


Once you've got that in a your project, something like the following should do the trick for you.

 

require_once 'Elvanto_API.php';

$elvanto = new Elvanto_API(array('api_key'=>$api_key));

$params = array(
    'fields' => array(
        'security_code',
        'departments'
    )
);
$results = $elvanto->call('people/getAll', $params=$params);

 Keep in mind, if you've got more than 1000 people you might want to view the response data and make a few calls to get the next few pages of data, instead of just the first page.


Hopefully this can be a nice starting point to get the information you need :)


Stewart



Login or Signup to post a comment