Skip to main content
New Participant
May 11, 2022 12:55 PM UTC
Question

Web api post request from postman is Not working

Hi

  Created one web api where we are starting a process  with one CDT as an input . When sending data like {["employeeName":"test",}]in the appian body and test request its working fine.

But triggering the same from post man we are getting a 500 error. Web api authentication is happened properly .

a!startProcess(
processModel: cons!employee_processweb,
processParameters: {employeedetails: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"
}
)
)
)

Postman:

Configured header with Content-Type:application/json

sending API Key bearer token.

Body format as JSON.

    3 replies

    stefanhelzle0001
    Brainy
    May 11, 2022 1:11 PM UTC

    Did you check the log files for any details?

    Is the error you see the one configured in "onError"?

    New Participant
    May 11, 2022 1:13 PM UTC

    Yes the error which is seen is the custom error configured by me on a!httpResponse

    danny.verb
    Employee
    May 11, 2022 1:51 PM UTC

    For the 'onErrror' change your status code to something else since Appian sends a 500 when the expression itself has an issue.

    Does the account used in Postman have access to the Web and API and the process model?