{{getMsg('Help_YouAreHere')}}:
/
{{page.title}}
{{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}}
{{helpModel.downloadHelpPdfDataStatus}}
HTTP Trigger
The HTTP Trigger is an action used by the Task Planner plugin. If this trigger is assigned to a task a URL will be displayed in the trigger configuration (Task Planner GUI) to quickly run the given task. For configuration of the trigger see here.
GET /api/taskplanner/<TaskID>/trigger/http
POST /api/taskplanner/<TaskID>/trigger/http
Requests running the task. You can send multiple additional parameter
queries to the trigger endpoint which will then be used in the placeholders of the Task Planner task.
Parameters for placeholders can be either send using the query ?parameter=abc¶meter=def...
or by sending them as individual form fields using POST
.
Note: Please take into account the security implications of using the placeholders. Please use responsibly.
Example Request
# Request # Use user:password for authorization GET /api/taskplanner/4w8yavnk046debwrwkcg4dbqh/trigger/http HTTP/1.1 Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u # Response - Task will be executed HTTP/1.1 200 OK Content-Type: application/json Content-Length: <CONTENT LENGTH> "4w8yavnk046debwrwkcg4dbqh"
# Request # Use user:password for authorization GET /api/taskplanner/4w8yavnk046debwrwkcg4dbqh/trigger/http HTTP/1.1 Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u # Response - Task not yet activated HTTP/1.1 404 Not Found Content-Type: application/json Content-Length: <CONTENT LENGTH> { "error": "The task with the id 4w8yavnk046debwrwkcg4dbqh has not yet been activated to be triggered by an HTTP URL." }
Application Example
# Browser access http://127.0.0.1:9000/api/taskplanner/4w8yavnk046debwrwkcg4dbqh/trigger/http # Shell access using curl curl -LsH "Authorization: Bearer <access_token>" "http://127.0.0.1:9000/api/taskplanner/4w8yavnk046debwrwkcg4dbqh/trigger/http" # Shell access using curl with parameters curl -LsH "Authorization: Bearer <access_token>" \ --url "http://127.0.0.1:9000/api/taskplanner/4w8yavnk046debwrwkcg4dbqh/trigger/http" \ --header 'Content-Type: application/x-www-form-urlencoded' \ --request POST \ --data parameter=abc \ --data parameter=def \ --data parameter=ghi \ --data parameter=jkl \ --data parameter=mno \ --data parameter=pqr \ --data parameter=stu \ --data parameter=vw \ --data parameter=xyz \ --data parameter=123 # Shell access using curl using username and password curl -Lsu username:password "http://127.0.0.1:9000/api/taskplanner/4w8yavnk046debwrwkcg4dbqh/trigger/http"