Contacts API query that filters also on having (or not) a specific Membership Level
Trying to get a list of members that does not have the membership level 'Commitee member'. This query of course works:
https://api.wildapricot.org/v2.2/accounts/ACCOUNTID/Contacts?$async=false&$filter=(Status eq 'Active')AND(Archived eq false)
.. and gets me the +220 contacts that I expect, but this does not work:
https://api.wildapricot.org/v2.2/accounts/ACCOUNTID/Contacts?$async=false&$filter=(Status eq 'Active')AND(Archived eq false)AND(MembershipLevel ne 'Committee member')
Looking at the response from the preceding query.. the following is an example of a response:
////
{
"Contacts": [
{
"FirstName": "NAME",
"LastName": "LASTNAME",
"Email": "EMAIL",
"DisplayName": "NAME LASTNAME",
"Organization": "",
"ProfileLastUpdated": "2017-11-16T00:10:13.337+11:00",
"MembershipLevel": {
"Id": 679139,
"Url": "https://api.wildapricot.org/v2.2/accounts/<ACCOUNTID>/MembershipLevels/679139",
"Name": "Committee member"
},
.
.
////
How can I get a query defined that enables me to filter the results having or not having a specific membership level? Building a messaging gateway in Laravel php and have most all working, but just need to get the query going properly.
Any pointers would be welcomed... and oh.. I am using https://api.wildapricot.org/ui/home/ to test this on and so far works pretty well!
-
wa commented
Use
$filter=MembershipLevelId ne [desired level ID]
The level ID will be a number that you obtain from examining other query results or querying the Membership.Levels API. For example
$filter=MembershipLevelId ne 1125777