For any given attribute (user profile field), I'd like a way to use the value in a macro. Is this presently possible?
For instance, for a user jsmith, and user profile field 'postcode', I'd like to be able to get the value of either:jsmith's postcode or my own postcode.
Nearest thing I can see is https://support.communardo.de/display/upp/REST+API+Documentation#RESTAPIDocumentation-Getinformationaboutaspecificprofileelement-/profileElements/{elementKey} but I want this for users / administrators.
Thanks,
Martin.
Community moderators have prevented the ability to post new answers.
In a user macro, you can use the user accessor:
$userAccessor
This has a method, getUser(user_name), which you can use to get the user by name. This method is deprecated in 5.2, but it will work until probably the next major revision. You should be able to access properties of the User object to do what you want.
Great, thanks Matthew!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin,
yes, this is possible with our REST API. With the link you provided you will retrieve information of the element (e.g. the key, the user profile configuration). If you want to retrieve the value of a single profile element for a certain user you need to do this call.
In the case of the postcode (assumption: key of the postcode field is 01050669159) of jsmith the request would look like this:
<Server Base URL>/rest/communardo/upp/1.0/profileData/jsmith/01050669159
The element key can be retrieved via the REST API, too.
<Server Base URL>/rest/communardo/upp/1.0/profileElements/?expand=profileElements
will list you all profile elements and their configuration, in the same order as defined via the User Profile Plugin Configuration. All you need to do is parse the key for the profile field you need.
I hope this is what you need. Otherwise please do not hesitate to contact me again.
Greeting, Stephanie
Communardo Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.