Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I'm currently working on invoking my RESTful POST API through the Qlik Sense Engine API, but I'm encountering difficulties in making the call. Oddly enough, when I save the Data Connection or perform a connection test using the Data Connection Editor, the API is successfully invoked.
I'm puzzled by the fact that despite these successful tests, I'm receiving a somewhat ambiguous "select ..." message when attempting the call directly through the Qlik Sense Engine API. Any insights into what might be going wrong in my approach would be greatly appreciated.
{
"handle": 1,
"method": "SendGenericCommandToCustomConnector",
"params": {
"qProvider": "QvRestConnector.exe",
"qCommand": "GetCustomCaption",
"qMethod": "POST",
"qParameters": [
],
"qAppendConnection": "Connection Name"
}
}
{
"jsonrpc": "2.0",
"id": 46,
"delta": true,
"result": {
"qResult": "Select..."
}
}
I'm not sure you are travelling the right path here. If you want to POST to the REST endpoint to insert a record, just use http to POST to the endpoint directly, the connection is not required.
I could assume you have a reason for wanting to use the connector, because it perhaps holds some parameters you want to use. Maybe you are just trying to invoke the "Test Connection" against this connection.
"qMethod" is not an HTTP method like POST. It is a method name defined in the connector. qMethod is used when the qCommand is JsonRequest.
You can use browser devtools to examine the websocket traffic. The request from the "Test connection" button would generate a qCommand: "JsonRequest" and qMethod: "testConnection".
-Rob
What are you trying to do with the connection?
-Rob
Hi @rwunderlich
The data connection calls a Rest API that uses a POST method to insert a record in a database.
I would like to call that data connection using such SendGenericCommandToCustomConnector API and ideally change the request body accordingly.
I'm not sure you are travelling the right path here. If you want to POST to the REST endpoint to insert a record, just use http to POST to the endpoint directly, the connection is not required.
I could assume you have a reason for wanting to use the connector, because it perhaps holds some parameters you want to use. Maybe you are just trying to invoke the "Test Connection" against this connection.
"qMethod" is not an HTTP method like POST. It is a method name defined in the connector. qMethod is used when the qCommand is JsonRequest.
You can use browser devtools to examine the websocket traffic. The request from the "Test connection" button would generate a qCommand: "JsonRequest" and qMethod: "testConnection".
-Rob