As the documentation suggests, if double encryption is enabled, there are two passwords, the first one is the rpcpassword you pass in when calling the rpc, pass it as the command line argument to "-rpcpassword", and the second password is your set with "walletpassphrase" api call. That means before calling any api that requires second password, call "walletpassphrase " to unlock the wallet.