How use / encode $filter in a curl call
How do you encode a $filter query param in a curl call, e.g. 'First name' eq 'John'
curl "https://api.wildapricot.org/v2.2/accounts/{accountId}/contacts?$async=false&$filter='First name' eq 'John'" \
-H "Authorization: Bearer {token}"
I tried several ways of encoding, including URLEncode, but I keep getting:
---->>>> curl: (3) URL rejected: Malformed input to a URL function
-
Jack Kerkhof commented
Hi. I'm no expert with cURL but looking at your URL there are a few things I could suggest:
'First name' should be 'FirstName' (no space). Use elements exactly as in the model.
The API filter examples https://gethelp.wildapricot.com/en/articles/502#filtering give you some hints, but they seem to be wildly inaccurate regarding the use of quotes. I would try all combinations of quotes on your target fields and literals.I assume you are putting your actual account Id in place of {accountId} ditto {token}.