I know this question is old but I thought I would post my solution, for anyone who might need a head start writing code. First of all, W.A. has posted some code examples on github that are very helpful. I recommend using them.
I'm writing some PHP scripts, so the following snippet is based on the PHP example on github. It's a function that assembles the query parameters and returns the newest users based on the date provided. It's very simple. Should be easy to adapt this to any other language. Hope this helps someone.
function getNewMemberList($accountUrl, $date, $async='false', $records=50, $offset=0) {
global $waApiClient;
$queryParams = array(
'$async' => $async, // execute request synchronously
'$skip' => $offset, // offset, for pagination
'$top' => $records, // limit result set
'$filter' => "'Creation date' ge " . $date . " AND ('Membership status' eq active OR 'Membership status' eq Pending - New)",
'$select' => "Id, 'First name', 'Last name', Email, 'Member since', 'Manager email'"
);
I know this question is old but I thought I would post my solution, for anyone who might need a head start writing code. First of all, W.A. has posted some code examples on github that are very helpful. I recommend using them.
I'm writing some PHP scripts, so the following snippet is based on the PHP example on github. It's a function that assembles the query parameters and returns the newest users based on the date provided. It's very simple. Should be easy to adapt this to any other language. Hope this helps someone.
function getNewMemberList($accountUrl, $date, $async='false', $records=50, $offset=0) {
global $waApiClient;
$queryParams = array(
'$async' => $async, // execute request synchronously
'$skip' => $offset, // offset, for pagination
'$top' => $records, // limit result set
'$filter' => "'Creation date' ge " . $date . " AND ('Membership status' eq active OR 'Membership status' eq Pending - New)",
'$select' => "Id, 'First name', 'Last name', Email, 'Member since', 'Manager email'"
);
$url = $accountUrl . '/Contacts/?' . http_build_query($queryParams);
return $waApiClient->makeRequest($url);
}