Web APIs

We have used StartProcess() function in WEBAPI with Http method "POST", when we are testing it is giving response properly ,but if we are trying to call through expression rule using httpquery function ,it is throwing "HTTP/1.1 401 Unauthorized" error,
So we have created third party credentials after these setting also we are getting error "HTTP/1.1 404 Not Found".
Please help us to know the error or we are missing any configurations.

Please find below code snippet.
with(
a!startProcess(
processModel: cons!TEST_WEBAPI_PM,
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")...

OriginalPostID-242297

  Discussion posts and replies are publicly visible

Parents
  • @jasmins, AFAIK the httpQuery function used for "GET" (default), "HEAD", "OPTIONS", and "TRACE" methods will not work for "POST" method. To call the POST method WEBAPI's you have to use httpwrite function which returns a writer and must be used with the bind() function. For more info you can check below links "https://forum.appian.com/suite/help/16.3/Connector_Functions.html#a-httpquery"
    "https://forum.appian.com/suite/help/16.3/Connector_Functions.html#a-httpwrite".
Reply
  • @jasmins, AFAIK the httpQuery function used for "GET" (default), "HEAD", "OPTIONS", and "TRACE" methods will not work for "POST" method. To call the POST method WEBAPI's you have to use httpwrite function which returns a writer and must be used with the bind() function. For more info you can check below links "https://forum.appian.com/suite/help/16.3/Connector_Functions.html#a-httpquery"
    "https://forum.appian.com/suite/help/16.3/Connector_Functions.html#a-httpwrite".
Children
No Data