Data returned in contacts/me
Hi,
using example PHP code and worked out that if we authenticate to the API as a user then we can retrieve the user's ID with the contacts/me call, but it returns limited data about the user. It does not return membership field values. Is there a way, when logged in as a user, to retrieve the users record including datafields?
Just for context, I'm writing a joomla auth plugin. I want to first authenticate the user (hence using the user credentials) and once authenticated I would like to get some of the data to sync into the Joomla account (such as street address, phone number).
If the field values can't be accessed via api when authenticated in the user context do I need to perform the authentication as the user (to confirm their login/password), then re-authenticate using the application's API key to retrieve the Contacts URL to access their data?
Thanks,
Russ.
Current version of API provides only limited dataset in /contacts/me requests. If your application needs more information then it can access API using API key. Our Wordpress authentication plugin works exectly this way.
-
Thanks, I'm looking forward to see the result. It can be helpful for many WildApricot users.
-
Russell Noble commented
Thanks Dmitry. My first iteration is working but not using oAuth SSO, so the user needs to login to Joomla entering WA e-mail address and password. It performs some checks to make sure they are a paid up member, synchronises some key data to the Joomla instance and add/removes from Joomla groups based on their member/non-member status. I'll clean the code up, make it a little bit more generic as it's currently hard coded for our club, and make it available on github. But, and big but, I'm a hacker not a coder, so code may be embarrassing :)
-
Hi Russell,
Current version of API provides only limited dataset in /contacts/me requests. If your application needs more information then it can access API using API key. Our Wordpress authentication plugin works exectly this way.
If you are developing joomla plugin with similar functionality, then it can be usefull for you to download wordpress plugin (https://wordpress.org/plugins/wild-apricot-login/) and look at source code.
There are many users who use wild apricot in pair with joomla cms. It would be greate if you share source code of your plugin on github.
Please let me know if you need any help with API.