cube-js / cube

📊 Cube — Universal semantic layer platform for AI, BI, spreadsheets, and embedded analytics
https://cube.dev
Other
17.96k stars 1.78k forks source link

Feedback for “REST API reference” #8893

Open lawrencechong opened 3 weeks ago

lawrencechong commented 3 weeks ago

Following Instructions to trigger v1/pre-aggregations/jobs to Retrieving statuses of jobs returns this error

curl \
  -d '{
    "action": "get",
  }' \
  -H "Content-Type: application/json" \
  -X GET \
  http://mycubejs.com:4000/cubejs-api/v1/pre-aggregations/jobs
{"error":"SyntaxError: Expected double-quoted property name in JSON at position 25","stack":"SyntaxError: Expected double-quoted property name in JSON at position 25\n    at JSON.parse (<anonymous>)\n    at parse (/cube/node_modules/body-parser/lib/types/json.js:92:19)\n    at /cube/node_modules/body-parser/lib/read.js:128:18\n    at AsyncResource.runInAsyncScope (node:async_hooks:206:9)\n    at invokeCallback (/cube/node_modules/raw-body/index.js:238:16)\n    at done (/cube/node_modules/raw-body/index.js:227:7)\n    at IncomingMessage.onEnd (/cube/node_modules/raw-body/index.js:287:7)\n    at IncomingMessage.emit (node:events:519:28)\n    at endReadableNT (node:internal/streams/readable:1696:12)\n    at processTicksAndRejections (node:internal/process/task_queues:82:21)"}

Details

igorlukanin commented 2 weeks ago

Hi @lawrencechong 👋

I believe this is not a correct request. The tokens parameter is required for the get action. Please see the example in the docs: https://cube.dev/docs/reference/rest-api#retrieving-statuses-of-jobs

lawrencechong commented 2 weeks ago

@igorlukanin is there anyway to have tokens be optional and have it return all jobs?