PersonWantsOrg "Method MakeDecision was not found."

Hello! 

1IM 8.1 

I need approve request over API. 

When I do request 

"https://server/api/entity/PersonWantsOrg/dd74829c-73fa-4d1e-b8ae-059f517c783e/method/MakeDecision" I get error: 

{"responseStatus":{"errorCode":"NotFound","message":"Method MakeDecision was not found.","errors":[]}}

User assigned to Common_StartCustomizerMethods program function.

How I can fix it? 

Parents Reply
  • Yes. I am using the same user and auth method in the Object Browser and in the REST call. 

    $Param1 = "d6d14a3a-c8fd-46fe-9daf-9a61a8d4180d"
    $Param2 = "True"
    $Param3 = "ok"
    $body = @{values = @{Param1 = $Param1; Param2 = $Param2; Param3 = $Param3 } } | ConvertTo-Json
    
    $newURI = (Invoke-RestMethod -Uri "https://server/AppServer/api/entity/PersonWantsOrg/dd85aaa8-d4cb-4804-bc32-2c45d75cd1e4/method/MakeDecision" -WebSession $wsession -Method Put -Body $body -ContentType "application/json; charset=utf-8").uri

Children
  • The JSON you use in the body is wrong.

    {
        "values":  {
                       "Param2":  "True",
                       "Param1":  "d6d14a3a-c8fd-46fe-9daf-9a61a8d4180d",
                       "Param3":  "ok"
                   }
    }

    According to the documentation https://support.oneidentity.com/de-de/technical-documents/identity-manager/8.1.1/rest-api-reference-guide/11#TOPIC-1250854 it has to be

    {
        "parameters":  [
                       "True",
                       "d6d14a3a-c8fd-46fe-9daf-9a61a8d4180d",
                       "ok"
        ]
    }


    Thus you need to change the $body to be

    $body = @{values = @{Param1 = $Param1; Param2 = $Param2; Param3 = $Param3 } } | ConvertTo-Json

  • I changed the $body: 

    $body = @{parameters = @("True", "d6d14a3a-c8fd-46fe-9daf-9a61a8d4180d", "OK") } | ConvertTo-Json
     $body
    {
        "parameters":  [
                           "True",
                           "d6d14a3a-c8fd-46fe-9daf-9a61a8d4180d",
                           "OK"
                       ]
    }
     $newURI = (Invoke-RestMethod -Uri "https://server/AppServer/api/entity/PersonWantsOrg/dd85aaa8-d4cb-4804-bc32-2c45d75cd1e4/method/MakeDecision" -WebSession $wsession -Method Put -Body $body -ContentType "application/json; charset=utf-8").uri
    Invoke-RestMethod : {"responseStatus":{"errorCode":"NotFound","message":"Method MakeDecision was not found.","errors":[]}}
    At line:1 char:12
    + $newURI = (Invoke-RestMethod -Uri "https://server/AppServer ...
    +            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
        + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRe

  • Sorry, my bad. I stumbled over the wrongly ordered parameter in your first JSON and copied that over to my example. Sorry about that.

    The order of the parameters has to be

    • uidPerson
    • decision (True/False)
    • reason

    {
        "parameters":  [
                       "d6d14a3a-c8fd-46fe-9daf-9a61a8d4180d",
                       "True",
                       "ok"
        ]
    }

    By the way, if you take a look at the log of the Application Server you will get a more detailed error message.

  • In log the Application Server: 

     в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       в ServiceStack.Host.ServiceRunner`1.<ExecuteAsync>d__13.MoveNext()
    2020-01-30 17:56:35.5422 ERROR (ObjectLog b54fdd30-5a58-4e23-a971-a2cc7a381c6a) : [ServiceStack.HttpError] Method MakeDecision was not found.
     ServiceStack.HttpError: Method MakeDecision was not found.
       в QBM.AppServer.Api.SingleService.<Put>d__4.MoveNext()

    When I use:

    {
        "parameters":  [
                       "d6d14a3a-c8fd-46fe-9daf-9a61a8d4180d",
                       "True",
                       "ok"
        ]
    }

    I get same error: "Method MakeDecision was not found."

  • While trying to reproduce your use-case I remembered that you have to provide the optional parameters as well when calling the method using the REST-API. You can leave them empty, but they do need to exist.

    So the JSON body needs to look like this:

    {
        "parameters":  [
                           "d6d14a3a-c8fd-46fe-9daf-9a61a8d4180d",
                           "True",
                           "ok",
                           "",
                           ""
                       ]
    }