Jump to content

Issues accessing winapi - Invalid API Call


Recommended Posts

I am trying to connect to the winapi using the new integrated AD authentication model however I am consistently receiving an error.


 [{"errors":[{"message":"Invalid API Call"},{"phrase":"Error = Object reference not set to an instance of an object.}]}] 


Code I am using in powershell is based off the winapi guide

$PasswordstateUrl = 'https://<url>/WinAPI/searchpasswords/?username=username'

Invoke-RestMethod -Uri $PasswordstateUrl -Method Get  -UseDefaultCredentials  


The same query works with no issue when using the native api

$header = @{ "APIKey" = "xxxxxxxxxxxx" }

$PasswordstateUrl = 'https://<url>/api/searchpasswords/?username=username'

$result = Invoke-RestMethod -Uri $PasswordstateUrl -Method Get -Headers $header

I have confirmed that the application is setup correctly based on the KB article and I am able to access the winapi documentation on my instance without issue


Any guidance on how best to troubleshoot?

Link to comment
Share on other sites

Hi Shane,


Sorry you're having some issues with this. To help troubleshoot this issue, can you tell me the following:

  • What build of Passwordstate are you using? In Build 8114, we provided some better error reporting for the WinAPI
  • And if you go to the screen Administration -> Passwordstate Administration -> System Settings -> API Tab, under the section 'Windows Integrated API Settings' is this set to Yes? If it's not, can you change it and then restart IIS

Thanks Shane.


Click Studios

Link to comment
Share on other sites

Thanks for confirming Shane.


I think we may have found the cause of this issue. In IIS, for the WinAPI folder, can you please make sure ASP.NET Impersonation and Windows Authentication are enabled - all others should be disabled?


I think when we documented the changes required in the KB article, possibly ASP.NET Impersonation was enabled by default System Wide on the dev environment we tested on, so we need to update our documentation for this.


And one other thing to check is that the URL for your Passwordstate web site is being detected in the 'Local Intranet Zone' in Internet Explorer. If it isn't, this may cause issues as you may see prompting for authentication.


Can you let us know if this helps?





Click Studios

Link to comment
Share on other sites


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

  • Create New...