jcoughlan 0 Posted February 4, 2016 Report Share Posted February 4, 2016 Hi, I've been working with passwordstate and powershell to create an automated password management script. I've so far been able to create, retrieve, and delete passwords from our server, but am unable to update an existing password. I've been using the following code: $JSONSTRING = @{ "PasswordID"=$PWD_ID "PasswordListID"=$PWD_LIST_ID "GenericField2"="Active" } Invoke-Restmethod -Uri "$PASSWORDSTATE_SERVER/api/passwords" -Method PUT -ContentType "application/json" -Header @{"APIKey"=$APIKEY} -Body $JSONSTRING This syntax works for all the other password methods, but for this method gives me the following error: "Invalid API call - No compatible API route found, "Please check for valid request URLS, parameters, and http verbs." To my knowledge, this code should work, as I'm following the tutorial set in the passwordstate api documentation, and again it works for other methods. Does anyone see something I'm missing? Thanks! Quote Link to post Share on other sites
support 214 Posted February 4, 2016 Report Share Posted February 4, 2016 Hi jcoughlan, Can you try removing the PasswordListID field from the jsonString - this is not needed when updating a password field. Let me know if this helps at all. Regards Click Studios Quote Link to post Share on other sites
jcoughlan 0 Posted February 4, 2016 Author Report Share Posted February 4, 2016 Hi, I have tried removing the PasswordListID from the field, but it did not change the result. Same error has ocurred Quote Link to post Share on other sites
support 214 Posted February 4, 2016 Report Share Posted February 4, 2016 Hi jcoughlan, Sorry, I've just noticed a couple more issues with the jsonString. Can you try the following: $JSONSTRING = '{ "PasswordID":' + $PWD_ID +', "GenericField2":"Active" } ' I've just tested this, and it appears to be working for me now. Regards Click Studios Quote Link to post Share on other sites
jcoughlan 0 Posted February 4, 2016 Author Report Share Posted February 4, 2016 I'm afraid that has also done nothing to change the issue. Quote Link to post Share on other sites
support 214 Posted February 4, 2016 Report Share Posted February 4, 2016 Hi jcoughlan, Can you tell me what build of Passwordstate you're using - this worked for us, so possibly it's a bug in an older build. We may need to organise a Remote Desktop session to try and help troubleshoot this further with you. Can you contact us via the following page so we can organise a time - http://www.clickstudios.com.au/support.aspx Thanks Click Studios Quote Link to post Share on other sites
jcoughlan 0 Posted February 4, 2016 Author Report Share Posted February 4, 2016 We are using build 7086. I'm afraid I cannot organize a remote desktop session as this is a company machine with a lot of sensitive data on it. Quote Link to post Share on other sites
support 214 Posted February 4, 2016 Report Share Posted February 4, 2016 Thanks for the clarification jcoughlan. I can only presume this is a bug in this older build (from over a year ago now), so could you schedule in an upgrade at your earliest convenience. Regards Click Studios Quote Link to post Share on other sites
jcoughlan 0 Posted February 4, 2016 Author Report Share Posted February 4, 2016 Thank you for your help, hopefully that will fix things. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.