locked
403 error while trying to update user profile of another user using rest call and pnp.sp.profile code in SFX webpart RRS feed

  • Question

  • Hi Everyone,

    i am trying to update the user profile of another user using rest call and pnp.sp.profile in sharepoint framework webpart.

    the profile is not getting updated getting 403 error, i tried updating using global admin login as well as sharepoint admin.

    from ui manage profile i am able to update the profile manually .

    can anyone help me with the solution to resolve this issue.

    //Loopdata is array which stores property name and value as i am updating multiple properties

    loopdata.forEach((updateitem=> {

      
         //code to update userprofile for user
         pnp.sp.profiles.setMultiValuedProfileProperty(AccountNameupdateitem.propertyupdateitem.propertyvalue).then(
            function(result){
              console.log(result);
              
            }
          ).catch(function(error) {  
            console.log("Error: " + error);  
        });
        });



    if i login and try updating my profile this works.

    required fix to update profile of anothe user

    Friday, March 13, 2020 7:36 AM