Invalid API Key when making REST call
My REST API call to query my datatable keeps returning the following error in the logs:
Error [authenticating connection], Server websocket will be closed. cause: Invalid Application Key c.t.c.s.c.j.Jsr356ServerConnection http-nio-8181-exec-86
This is my REST call:
http://<myHost>/Thingworx/Things/<myDataTable>/Services/QueryDataTableEntries?method=post&userid=<User>r&password=<Password>&appKey=<my Api Key>&x-thingworx-session=true&content type=application/json&Accept=application/json&maxItems=10&query=<encoded json param>
I double checked that I indeed copied the api key correctly and that the key is associated with the user I am passing in.
When I pass in a simple json query I get the following warning in my logs instead but all I get results back.
Log:
Server WebSocket closed unexpectedly and has already been unregistered from Server Endpoint [ws session id: 5a1e7] An established connection was aborted by the software in your host machine |
Json Query:
{"filters":{"type": "And","filters":[{"type": "OR","filters":[{"type": "LIKE","fieldName": "ASSETCODE","value":"Pump"},{"type": "LIKE","fieldName": "ASSETDESC","value": "Pump"},{"type": "LIKE","fieldName": "ASSETCLASS","value": "Pump"},{"type": "LIKE","fieldName": "CLASSDESC","value": "Pump"},{"type": "LIKE","fieldName": "MANUFCODE","value": "Pump"},{"type": "LIKE","fieldName": "MFGDESC","value": "Pump"},{"type": "LIKE","fieldName": "MFGMODEL","value": "Pump"},{"type": "LIKE","fieldName": "ASSETCATE","value":"Pump"},{"type": "LIKE","fieldName": "CATEDESC","value": "Pump"},{"type": "LIKE","fieldName": "ORG","value": "Pump"}]}]}}
But when I do a compound query like this:
{"filters":{"type": "And","filters":[{"type": "OR","filters":[{"type": "LIKE","fieldName": "MFGMODEL","value":"Pump"},{"type": "LIKE","fieldName": "ASSETCODE","value": "Pump"},{"type": "LIKE","fieldName": "ASSETDESC","value": "Pump"},{"type": "LIKE","fieldName": "ORG","value": "Pump"}]},{"type": "OR","filters":[{"type": "IN","fieldName": "ORG","values":["ALB","KAL"]}]}]}}
I get the invalid api key log mentioned above and my connection times out without returning anything.
Any advice is much appreciated.

