Is it correct that users cannot get their membership data via API?
I'm working with a tool called Cognito Forms that allow some fairly complex form functionality. One great feature is the ability to pass values to a form embedded on a Wild Apricot page.
We are currently working on a feature where a member navigates to a member-only page for expense reimbursement. The page loads an embedded form and pre-fills most of the information.
Right now, I am using the API to use the contacts/me call to load name and email, but I need the contact/{contact-ID} to get the address and phone.
After getting the script completed and pre-populating the form for my admin account, I found that this API call doesn't work for non-admins. After some digging, I found this thread: https://forums.wildapricot.com/forums/309658-developers/suggestions/18163003-fieldvalues-contact-api
I'm receiving the same error as above: "Current token does not provide access to scope 'contacts_view'.
Is this really true that a contact can't pull their own information via API? Not even their address? All of this JS is occurring within WA pages.
Hi Andy,
contacts/me endpoint returns short version of contact data. If you need all field values, just add query string parameter includeDetails=true.
Here is an example:
https://api.wildapricot.org/publicview/v1/accounts/183112/contacts/me?includeDetails=true
-
Andy commented
Awesome. Thanks as always, Dmitry! I was completely focused on the response description that I missed the optional parameter. All set now.
Happy to share that we now have a working complex and dynamic form that pre-fills with the user's name, address, and contact information thanks to the form tool Cognito forms. The submit of the form then dumps straight into our SharePoint environment and kicks off a MS Flow workflow for approval. Pretty great relationship between these services!
-
Andy commented
I should add clarification that I did try https://api.wildapricot.org/publicview/v1/accounts/{accountID}/Contacts/{contactID} as per the documentation here:
When testing the call in the API browser, I get a response, but with none of the values for the logged-in contact.
When testing the admin version, I correctly get all values, but this cannot be used by a non-admin.
e.g. https://api.wildapricot.org/v2/accounts/{accountID}/Contacts/{contactID}