Example 1: Submit a Process using cURL
The following example describes steps to execute a Submit Process Control RESTful API using cURL.
-
Call the SignOn API and get the authorization token, jsessionID, and XSRF-TOKEN token
from the header in the response.
Authorization: eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBZG1pbmlzdHJhdG9yOjE3Mi4yMC4xODYuMzU6 MTM2MzplMDI0YjAzZC03NzkwLTQxMjItOTZkOC1iZjg5MmY5NDcxM2MiLCJleHA iOjE1NTcxMjcyMTJ9.ME_mniwgmrzVL214ijhxNzU-bgHw9bv-Ktz8WL84ljpEYtgm89jf H7ehspyk-zgS6J8JiL2GJrG3JYo1REs1w XSRF: 809ab7e8-c6be-41ac-84f1-b4f8db246d9e JSessionID: node04p0v71bx6q46u2qthvr32htv3.node0
-
Submit a cURL request at the following URL
https://<CDWS_IPAddress:Port>/cdwebconsole /svc/processcontrolcriterias
-
Call the API with the XSRF header as X-XSRF-TOKEN:
X-XSRF-TOKEN: <XSRF_Token_From_Step_1>
-
Set the content type to:
Content-Type: application/json
-
Set the request body to:
"processFile":"<processFilePathWithName>"
-
Complete request body as follows:
curl -s -i --cookie' XSRFTOKEN=<XSRF_TOKEN_FROM_RESPONSE_HEADER>; JSESSIONID=<JSESSIONID_FROM_RESPONSE_HEADER>;' -H ' Authorization:<AUTHORIZATION_TOKEN_ FROM_RESPONSE_HEADER> ' -H ' Content-Type: application/json' -H 'X-XSRF-TOKEN: <XSRF_TOKEN_FROM_RESPONSE_HEADER>' -X POST -d'{"processFile":"<processFilePathWithName>"}' -k
-
Response received as follows:
[ { "messageCode" : 201, "message" : "The process has been successfully submitted with processNumber '10'" } ]