DaaS API
Docs & Playground
Utilities/ExecuteMultiCall

ExecuteMultiCalltoken required

Several calls in one request; results come back in the same order.

POST/daas/apiv1— method = "ExecuteMultiCall"

Parameters

NameTypeRequiredDescription
callsjsonrequiredArray of { method, params }.e.g. [{"method":"Get","params":{"typeName":"Vehicle","resultsLimit":1}},{"method":"GetCountOf","params":{"typeName":"Vehicle"}}]

Notes

If one call fails, the whole request fails and error.data.requestIndex is the index of the failing call.

Request

curl
curl -X POST 'https://private.develop-1.questar.io/v2/private-questar-units/daas/apiv1' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  --data '{"method":"ExecuteMultiCall","params":{"calls":[{"method":"Get","params":{"typeName":"Vehicle","resultsLimit":1}},{"method":"GetCountOf","params":{"typeName":"Vehicle"}}]}}'
Body
{
  "method": "ExecuteMultiCall",
  "params": {
    "calls": [
      {
        "method": "Get",
        "params": {
          "typeName": "Vehicle",
          "resultsLimit": 1
        }
      },
      {
        "method": "GetCountOf",
        "params": {
          "typeName": "Vehicle"
        }
      }
    ]
  }
}

Response

200 OK
{
  "jsonrpc": "2.0",
  "result": [
    [
      {
        "id": "1-999000311",
        "name": "Truck 12"
      }
    ],
    14
  ]
}

Errors also come back as HTTP 200, with an error instead of a result. error.data.type says what went wrong: ArgumentException (a bad parameter), MissingMethodException (unknown method) or InvalidOperationException. With no or an invalid token the gateway answers HTTP 401 / 403.

200 OK
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32000,
    "message": "Get does not support typeName 'Media'",
    "name": "JSONRPCError",
    "data": {
      "type": "ArgumentException"
    },
    "errors": [
      {
        "message": "Get does not support typeName 'Media'",
        "name": "ArgumentException"
      }
    ]
  }
}