How to use $select API?
The documentation for the
contacts endpoint says "$select - Controls which fields are returned in the Contacts API call."
Dmitry Smirnov provided some examples in the post below.
His example was:
$select='First name','Last name',Phone
I'm not seeing a difference in the API response with or without the select, and I'd love to use it to reduce the amount of data being returned.
Below is a cURL example:
curl -X GET \
'https://api.wildapricot.org/v2/Accounts/$MYACCOUNTID/Contacts?$async=false&$select=%27First Name%27,%27Last Name%27,%27Email%27' \
-H 'Accept: /' \
-H 'Authorization: Bearer $MY_TOKEN' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Host: api.wildapricot.org' \
-H 'accept-encoding: gzip, deflate'
I've also tried $select='FirstName','LastName','Email' to remove spaces and match the casing of the keys returned in the JSON.
In general you request looks right. The thing I would check is field names in your account. Use this endpoint to get full list of all contact fields. You need to pass 'FieldName' as a select parameter. https://app.swaggerhub.com/apis-docs/WildApricot/wild-apricot_public_api/2.1.0#/Contacts.CustomFields/GetContactFieldDefinitions
Another possible thing is a misuse of ’ instead '. They look similar for human, but API works with ' only. MacOS likes to replace ' with ’.
This API call I just checked and it works as expected