Example 1: Submit a Process using REST API
Workflow
The following example describes steps to execute a Submit Process Control RESTful API using POST method.
- Call the SignOn API and get the authorization token and XSRF-TOKEN token from the header
in the response.
Authorization: eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBZG1pbmlzdHJhdG9yOjE3Mi4yMC4xODYu MzU6MTM2MzplMDI0Y jAzZC03NzkwLTQxMjItOTZkOC1iZjg5MmY5NDcxM2MiLCJleHAiOjE1NTcxMjcyMTJ9.ME_mni-wgmrzVL 214ijhxNzU-bgHw9bv-Ktz8WL84ljpEYtgm89jfH7ehspyk-zgS6J8JiL2GJrG3JYo1REs1w XSRF: 809ab7e8-c6be-41ac-84f1-b4f8db246d9e
- Submit a POST request at the following URL:
https://<CDWS_IPAddress:Port>/cdwebconsole/svc/processcontrolcriterias
- Call the API with the Authorization header:
Authorization:<Authorization_Token_From_Step_1>
- 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; charset=utf-8
- Set the request body to:
{ "processFile": "C:\Users\Administrator\Desktop\test.cdp" }
- Complete request body as follows:
POST /cdwebconsole/svc/processcontrolcriterias HTTP/1.1 Host: <CDWS_IPAddress:Port> Content-Type: application/json X-XSRF-TOKEN: 809ab7e8-c6be-41ac-84f1-b4f8db246d9e Authorization: eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBZG1pbmlzdHJhdG9yOjE3Mi4yMC4x ODYuMzU6MTM2MzplMDI0YjAzZC03NzkwLTQxMjItOTZkOC1iZjg5MmY5NDcxM2MiLCJleHAiOjE1 NTcxMjcyMTJ9.ME_mni-wgmrzVL214ijhxNzU-bgHw9bv-Ktz8WL84ljpEYtgm89jfH7ehspyk-z gS6J8JiL2GJrG3JYo1REs1w Cache-Control: no-cache { "processFile": "C:\\Users\\Administrator\\Desktop\\CDWS_AutoInstall\\cd_proc ess_dir \\test.cdp" }
- Response received as follows:
{ "messageCode": 201, "message": "The process has been successfully submitted with processNumber '126'" }