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 Children
  • 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",
                           "",
                           ""
                       ]
    }