I’ve managed to login and read secrets using the API, but I’m stuck when trying to update one. The docs read the following:
“If the password you are updating has been shared with 7 users, the “secrets” key will need to be an array of 7 objects: You must encrypt and sign the new plaintext passwords using the recipient public key and the current user secret key”.
But, how do I retrieve the list of users that have access to a secret so that I can use their public keys? I’ve found no info about this.
Furthermore, I’ve tried to update a secret just accesible by me, and although the response seems to be correct, the secret does not change:
{“header”:{“id”:"", “status”:“success”, “servertime”:1574754486, “title”:“app_resources_update_success”, “action”:"",“message”:“The resource has been updated successfully.”,“url”:"\/resources\/.json?api-version=v2",“code”:200}
Is there any example on how to update a secret? Can anyone help me?
Thanks a lot for your answer, with your help I have indeed gone forward but I’m still unable to update a secret
I’m stuck in the very last step. I’ve got a secret just for myself (no sharing, just my user) and I’m not able to change it’s password. Following your example I’m sending PUT the following json:
The server answers with a “200 OK” code, but in the body it’s the (encrypted) old password that the server sends to me instead of the new one.
On the other hand, documentation says the following:
“You must encrypt and sign the new plaintext passwords using the recipient public key and the current user secret key.”
Should I then sign the password, too? I’ve already tried but doesn’t work either.
Thanks a lot for your help, finally I sorted out what was the problem. It was not that the JSON was incorrectly formed, but just a pure Python problem: I had constructed the JSON as a string instead of a Python dictionary/list.
At the moment I did it correctly it started to work.