mikkijayne Posted July 11, 2023 Share Posted July 11, 2023 Hi all, I'm working with the API in PowerShell and all is going well so far until I try to delete a password. I do a search to get the ID in to the $pwid variable (works fine), and then pass that to the following command (derived from the API documentation): Invoke-Restmethod -Method Delete -Uri "https://password.server.com/winapi/passwords/$pwid?MoveToRecycleBin=false" -ContentType "application/json" -UseDefaultCredentials This gives an error thus: Invoke-Restmethod : [{"errors":[{"message":"Method Not Allowed"},{"phrase":"The requested resource does not support http method 'DELETE'."}]}] I can delete passwords in the UI just fine with this account so I don't think its permissions. Any suggestions please? Thanks MJ Link to comment Share on other sites More sharing options...
support Posted July 12, 2023 Share Posted July 12, 2023 Hello, Please try the following format: $PasswordstateUrl = 'https://password.server.com/winapi/passwords/' + $pwid +'?MoveToRecycleBin=False' Invoke-Restmethod -Method Delete -Uri $PasswordstateUrl -UseDefaultCredentials Regards Click Studios Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now