Skip to Content
DocsREST APIManage JobsPOST /api/v1/executeJob.jsp

POST /api/v1/executeJob.jsp

Run a job to execute an operation. This call can be used to execute any operation but it is usually used to execute the RunScenario operation that executes a scenario.

Parameters:

  • appId (type: string; required): id of the app in which context the job to be executed.
  • operation (type: object; required): specifies an operation to execute.
  • isAsync (type: boolean; default value: true):
    • true - the call responds immediately after the job is started. The response contains the jobId of the started job. Use GET /api/v1/getJobStatus.jsp call to poll the job status and results.
    • false - the call responds after the job is completed and contains the result of the job.
  • noResultSchema (type: boolean; default value: false): the value can be true or false. When set to true, the schema of the result data is omitted in the response. This parameter is only considered when isAsync is set to false.
  • jobId (type: string; optional): when provided, this job id will be assigned to the job instead of generating a new unique one.

Call example: how to execute a scenario:

curl -H "Content-Type: application/json" -X POST -d '{"apiKey":"<your API key>","appId":"7","operation":{"opName": "RunScenario", "opParams": {"scenario": "Main", "parameters": {}}}}' "<path_to_infolink>/api/v1/executeJob.jsp"

Response:

  • status (type: string): the status of the call can be success or error.
  • result (type: object):
    • If status is success:
      • If isAsync is true, result.jobId is the id of the started job that is newly generated or the one provided as the jobId parameter of the request. Call /api/v1/getJobStatus.jsp with the job id to get the status of the job.
      • If isAsync is false, the result.results contains the data returned by the job.
    • If status is error, result.message contains the error message.

Response example:

{ "result": { "results": [ { "result": { "schema": [ { "updateable": false, "typeStandard": { "typeStr": "text", "name": "text" }, "name": "id", "type": { "typeStr": "nvarchar(max)", "precision": -1, "name": "nvarchar", "scale": 0 } }, { "updateable": false, "typeStandard": { "typeStr": "text", "name": "text" }, "name": "company_name", "type": { "typeStr": "nvarchar(max)", "precision": -1, "name": "nvarchar", "scale": 0 } }, ], "records": [ { "company_name": "IBM", "id": "1" }, { "company_name": "Microsoft", "id": "2" } ] }, "name": "companies" } ] }, "status": "success" }
Last updated on