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 thejobIdof the started job. UseGET /api/v1/getJobStatus.jspcall 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 betrueorfalse. When set totrue, the schema of the result data is omitted in the response. This parameter is only considered whenisAsyncis set tofalse.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 besuccessorerror.result(type: object):- If
statusissuccess:- If
isAsyncistrue,result.jobIdis the id of the started job that is newly generated or the one provided as thejobIdparameter of the request. Call/api/v1/getJobStatus.jspwith the job id to get the status of the job. - If
isAsyncisfalse, theresult.resultscontains the data returned by the job.
- If
- If
statusiserror,result.messagecontains the error message.
- If
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