Problem with /api/V3/Projection/GetProjectionByCriteria
$credentials = @{
UserName='xxxxxx'
Password='xxxxxx'
LanguageCode='ENU'
}
$url = $site+"/api/V3/Authorization/GetToken"
"Id": "0e1313ab-dc5c-cf9d-d6b0-e2e9835a132a",
"Criteria": {
"Base": {
"Expression": {
"SimpleExpression": {
"ValueExpressionLeft": {
"GenericProperty": "DisplayName"
},
"Operator": "Like",
"ValueExpressionRight": {
"Value": "%Stuart%"
}
}
}
}
}
}'
$authVal = "Token " + $apiKey
$jsonBody = $body | ConvertTo-Json
$standardBody = $jsonBody | ConvertFrom-Json
$response = try { Invoke-RestMethod $url -Method Post -Body $body -ContentType 'application/json' -Headers @{"AUTHORIZATION"=$authVal} } catch { $_.Exception.Response }
I get the error :
Microsoft.EnterpriseManagement.Common.UnauthorizedAccessEnterpriseManagementException: Unable to execute command, user connection not found. at Cireson.ServiceManager.ManagementService.ManagementServiceConnectionPool.GetCachedConne ction(String userName) at Cireson.ServiceManager.ManagementService.ManagementService.InvokeCommand[T](Func`2 func , Boolean invokeAsService) at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Tas k task) at Cireson.ServiceManager.ManagementService.ManagementService.<InvokeCommandAsync>d__9`1.M oveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Tas k task) at Cireson.ServiceManager.Services.Projection.<GetProjectionByCriteriaAsync>d__11.MoveNext ()
as far as I am aware the user does have access to the section and I get a token, any idea of where I can look to help resolve this issue?
Answers
Which version of the portal are you using?