Jump to content

500 error when using resource 'passwordlists' (webapi)


choffmann

Recommended Posts

Hello,

 

I am unable to create password lists using passwordlists resource via webapi.  I am using Powershell:

$jsonData = '
    {
	"PasswordList":"TEST LIST",
	"Description":"TEST"
    }
    '

    $PasswordstateUrl = 'https://*passwordstate url*/winapi/passwordlists'
    $result = Invoke-Restmethod -Method Post -Uri $PasswordstateUrl -ContentType "application/json" -Body $jsonData -UseDefaultCredentials
    $PasswordListID = $result.PasswordListID

Obviously I am replacing *passwordstate url* with the correct URL for my environment. Here is the exception I am getting:

Invoke-Restmethod : [{"errors":[{"message":"Invalid API Call"},{"phrase":"Error = Object reference not set to an instance of an object."}]}]
At line:2 char:15
+ ...   $result = Invoke-Restmethod -Method Post -Uri $PasswordstateUrl -Co ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Outputting $error[0].Exception yields:

The remote server returned an error: (500) Internal Server Error.

 

My Passwordstate Build is 8501.

Link to comment
Share on other sites

Hello,

 

Could you please refer to our API Documentation under the help menu - there are more parameters required when creating Password Lists. e.g. where to place it in the Navigation Tree, what permissions to apply, what settings for the Password List, etc.

Regards

Click Studios

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...