Compass API calls with BaaS

Dave Hellman
Dave Hellman Member, Infor Partner Posts: 7

I'm trying to get status data out from compass API using BaaS but encounter error while doing so.

private Response getStatusData(RestContext context) {        String path = "DATAFABRIC/compass/v2/jobs/?queryExecutor=datalake&records=0";        String query = "SELECT LN_tssoc200.osta, COUNT(*) AS count FROM LN_tssoc200 WHERE LN_tssoc200.compnr = 2405 GROUP BY LN_tssoc200.osta";        try {            Builder builder = context.getApiClient().createRequest().path(path).request();            builder.header("accept", "application/json");            Invocation invocation = builder.buildPost(Entity.entity(query, MediaType.TEXT_PLAIN));            Response response = invocation.invoke();            return response;        } catch (ApiException e) {            throw new BaasHttpException("Error when calling API. ", e);        }    }

But it gives me this error:

{\"suggestedLocalizedText\":\"Internal ERROR Message 600\\nAn internal error occurred. Contact Infor Support.\\nQuery ID ?queryExecutor=datalake&records=0\\n2024-11-27T13:02:12.392249060Z\",\"messageTime\":\"2024-11-27T13:02:12.392249060Z\",\"messageCategory\":\"Internal\",\"messageType\":\"ERROR\",\"line\":\"null\",\"messageCode\":\"600\",\"position\":\"null\",\"message\":\"An internal error occurred. Contact Infor Support.\",\"queryId\":\"?queryExecutor=datalake&records=0\"}

I've tried the query in Compass, API Gateway Compass API and postman to the compass API so I know the problem is with the Java code but I cant figure out where? Any help with this would be appreciated!