I've created a web API that retrieves data from a process model, but when I call this API during integration,it returns the following error: Error Code: errorIntegrationError Title: Error processing integration response Message: The response body could not be converted to an Appian value Detail: The jsonText parameter was not valid JSON. Received: <...>.
errorIntegrationError
I have attached the code
a!startProcess( processModel: cons!PDBPOC_gDrivePermissionPM, isSynchronous: true(), onSuccess: a!httpResponse( statusCode: 200, headers: { a!httpHeader( name: "Content-Type", value: "application/json" ) }, body: a!toJson( if( a!isNotNullOrEmpty(fv!processInfo.pv.userData), fv!processInfo.pv.userData, { message: "userData process variable is empty or not set." } ) ) ), 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" } ) ), onIncomplete: a!httpResponse( statusCode: 504, headers: { a!httpHeader( name: "Content-Type", value: "application/json" ) }, body: a!toJson( { error: "The process did not complete within the expected time" } ) ) )
Discussion posts and replies are publicly visible
If you switch to the "http request" tab, it'll show you (more plaintext) what the outgoing request was, which might help you troubleshoot. We don't really have a way of knowing what was in pv!userData, so it's hard to guess at that.