Jump to content

API Problems


Franz Winter
 Share

Recommended Posts

Hello,

 

We use Passwordstate 8650 on W2k12.

I try to get a list of all my password lists by using the API with PowerShell.

This works fine on my Win10 client.

      $PasswordstateUrl = "https://pws.intra/api/passwordlists/"

      Invoke-Restmethod -Method GET -Uri $PasswordstateUrl -Header @{ "APIKey" = "myKey"}

 

When I try the same direct on the Passwordstate System, I get this error.

 

     Invoke-Restmethod : [{"errors":[{"message":"Invalid API Call"},{"phrase":"Error = Object reference not set to an
     instance of an object."}]}]
     At line:1 char:1
     + Invoke-Restmethod -Method GET -Uri $PasswordstateUrl -Header @{ "APIK ...
     + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
        eption
         + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
     PS Z:\>

 

When I try to retrieve only one list

$PasswordstateUrl = "https://pws.intra/api/passwordlists/108"

it works on both Systems.

 

I need all lists direct on the Passwordstate System and don't understand why this doesn't work. 

Does someone have any idea?

 

 

 

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi Franz,

 

We're not sure about this sorry - you should be able to make these calls from any desktop/server, and they work - it does not make sense that it doesn't work on the Passwordstate server itself.

 

I don't think it's related, but can you check the Allowed IP Ranges on the System Settings screen to see if anything has been specified here? If it has, you should get a better description message.

 

Each Password List can have this set as well, so can you run the following query using SQL Server Management Studio to see if any Password Lists are reported?

USE Passwordstate

SELECT * FROM PasswordLists WHERE APIAllowedIPRanges <> ''

Regards

Click Studios

Link to comment
Share on other sites

Looks like one of the Password Lists in your system has a IP Range restrictions set, possibly causing the issue.  We've email you some information on how to fix this, and I'm just reporting this here in case anyone else is wondering what the resolution of this issue could be.

 

Removing the IP Ranges restriction on a specific password list is what we're suggesting, this can be found when editing the password list under this tab:

 

2019-11-06_11-26-17.png

 

Regards,

Support

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...