Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2019-02-26 05:08 AM
I am trying to call contentapi using below code but I am getting error, I can access content api from browser and getting all the endpoint. Am I doing something wrong.
Code -
$SessionToken = "session token of account with admin access"
$Server = "https://myarcherserver"
$Uri = "contentapi"
$Headers = @{"accept" = "application/json"; "content-type" = "application/json"; "Authorization" = ("Archer session-id=`"" + $SessionToken + "`""); "X-Http-Method-Override" = $Method.GET }
$Response = Invoke-RestMethod -Method $Method.POST -Headers $Headers -Uri ($Server+$Uri) -body (convertto-json $Body)
$Response
Error I am getting -
Invoke-RestMethod :
401 - Unauthorized: Access is denied due to invalid credentials.
Server Error
401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied.
2019-02-28 11:59 AM
Yes, it should be set as anonymous only, not Windows, nor basic, nor any other.
2019-02-28 11:59 AM
Well, you need to find out what has changed in web.config or other settings before it stopped to work