Skip to main content
May 11, 2022
Question

Web api post request from postman is Not working

  • May 11, 2022
  • 3 replies
  • 0 views

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

    Did you check the log files for any details?

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

    May 11, 2022

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

    danny.verb
    May 11, 2022

    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?