Hi.
I’m trying to get an authorization token for sharepoint online using POST request node. I read all similar topics but they didn’t help me.
The problem is that knime somehow is unable to send correct data in the POST request body and i get the error - Execute failed: Wrong status: 400 Bad Request
The same request is working fine in Postman and even in knime using python script.
I added images of the Post request setup (i made the user codes on the body tab unsusable, i hope the structure is enough:
And in knime log there is only this:
2020-05-27 08:12:38,632 : ERROR : KNIME-Worker-21-POST Request 0:296 : : Node : POST Request : 0:296 : Execute failed: Wrong status: 400 Bad Request
java.lang.IllegalStateException: Wrong status: 400 Bad Request
at org.knime.rest.nodes.common.RestNodeModel.checkResponse(RestNodeModel.java:793)
at org.knime.rest.nodes.common.RestNodeModel.makeFirstCall(RestNodeModel.java:406)
at org.knime.rest.nodes.common.RestNodeModel.execute(RestNodeModel.java:340)
at org.knime.core.node.NodeModel.execute(NodeModel.java:737)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:571)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1236)
at org.knime.core.node.Node.execute(Node.java:1016)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:557)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:218)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:124)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:334)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:210)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
The problem is that i don’t understand why it fails. Are there some symbols that are not recognized by java? the authorization codes contain both “=” and “/” as part of them. Do i have to escape them somehow?
I also read that i might use java snippet node to make the api call but that requires me to search the web for examples.