Example 2: Select Statistics for a Process using cURL

The following example describes steps to execute a Submit Select Statistics RESTful API using cURL.

  1. Call the SignOn API and get the authorization token, jsessionID, and XSRF-TOKEN token from the header in the response
    Authorization:
    eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBZG1pbmlzdHJhdG9yOjE3Mi4yMC4x
    ODYuMzU6MTM2MzplMDI0YjAzZC03NzkwLTQxMjItOTZkOC1iZjg5Mm
    Y5NDcxM2MiLCJleHAiOjE1NTcxMjcyMTJ9.ME_mni-wgmrzVL214ijhxNz
    U-bgHw9bv-Ktz8WL84ljpEYtgm89jfH7ehspyk-zgS6J8JiL2GJrG3JYo1REs1w
    
    XSRF:
    809ab7e8-c6be-41ac-84f1-b4f8db246d9e 
    
    JSessionID:
    node04p0v71bx6q46u2qthvr32htv3.node0
  2. Submit a cURL request at the following URL
    https://<CDWS_IPAddress:Port>/cdwebconsole/svc/processcontrolcriterias
  3. Call the API with the XSRF header as X-XSRF-TOKEN:
    X-XSRF-TOKEN : <XSRF_Token_From_Step_1>
  4. Set the content type to:
    Content-Type: application/json
  5. Set the request body to:
    "processFile":"<processFilePathWithName>"
  6. Complete request body as follows:
    curl -s -i --cookie ''XSRF-TOKEN=<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>' 
    GET -k https://<CDWS_IPAddress:Port>/cdwebconsole/svc/selectstatistics?processNumber=10
  7. Response received as follows:
    [
    {
    "stopTime": "Mon May 06 12:41:32 IST 2019",
    "submitNode": "CDWLT-025",
    "msgShortText": "The submit of the process succeeded.",
     "recordCategory": "CAPR",
     "startTime": "Mon May 06 12:41:32 IST 2019",
     "recordId": "SUBP",
     "conditionCode": 0,
     "submitter": "Administrator",
     "messageId": "LCCA013I",
     "logDateTime": "Mon May 06 12:41:32 IST 2019",
     "processName": "PP",
     "processNumber": 10,
     "secondaryNode": "CDWLT-025"
     }
    ]