Forum Discussion

vedagarw's avatar
8 years ago

Update User Profile Setting & Preferences In Custom Plugin

Hi,

We have a requirement to update the user profile data, preference etc from the custom plugin component. Is is possible to achieve this ? Also what is the best practice to get this done; should I user Rest API vs LIQL.

  • Hi vedagarw,

     

    I think APIv1 is a good point to start. You can use the profiles resource to set values, e.g.:

     

    <#assign response = restadmin("/users/id/${user_id?c}/profiles/name/<PROFILE_NAME>/set?value=<YOUR_VALUE>") />

    You can determine the profile name values using APIv1, too.

     

    Best regards,

    Christian

     

    • vedagarw's avatar
      vedagarw
      Guide

      Using this I can update only couple of fields. I need to update all the settings and preferences for the user. Is there an API which would more wider set of fields to play with.

    • donpacote's avatar
      donpacote
      Helper

      when i use this all time have a  permisions errors.   Add i use SSO auth.

       

      /restapi/vc/users/id/21405/profiles/name/aaaaaaa/set?restapi.response_format=json&restapi.session_key=ohL0ZHOrTRRrnbJ2HbJtR1R9kPOjybIqYsrhYQTjLy0.&value=aaaaaaa

       

      doestn work

       

       

      • cike's avatar
        cike
        Champion

        donpacote - If you're making this request through your browser window, the call fails because there are some API restrictions on such calls. You have to use the restadmin keyword to make such calls.

         

        Best regards,

        Christian