web API

Certified Senior Developer

Hi

I have created a webAPI to start a proces. input parameter is ID. If i pass the ID in the body field of test input window as "ID":"50". Its working fine. But when i test through postman, it throws 500- internal server error. Am i doing any mistake in web API?

Below is the code

a!startProcess(
processModel: cons!CONSTANTNAME,
processParameters: a!fromJson(
http!request.body
),
onSuccess: a!httpResponse(
statusCode: 200,
headers: {
a!httpHeader(name: "Content-Type", value: "application/json")
},
body: a!toJson(
fv!processInfo
)
),
onError: a!httpResponse(
statusCode: 500,
headers: {
a!httpHeader(name: "Content-Type", value: "application/json")
},
body: a!toJson(
{
error: "There was an error starting the process"
}
)
)
)

Please help.

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Few things:

    1. Check if the user account , with whom you have registered your third-party credentials has proper required rights/ privileges for the web API / data

    2. The process parameters needs to be a list of dictionary.500 error can be caused by the process parameters that are not getting passed, and so the process does not start.

    3. Check the mandatory parameters for the process model you are trying to start. You need to pass input for all of them else the error will come.