IBM Workload Automation & Workload Scheduler

IBM Workload Automation & Workload Scheduler

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Variable table to link with RESTful webservice job for API key variables

    Posted 6 days ago

    I am trying to test RESTful webservice job using DWC10.1 version to trigger an API service call to the destination cleint server.
    As the middle man is API gateway, need to pass 2 API keys to validate and then authenticate by API Gateway to the destinations server.
    I am using a variable table to keep these 2 API keys and trying to pass via RESful webservice job created in DWC, but not sure
    how to use them in DWC.

    Could you assist and anyone have tested this approach and would be helpful for me to move further?.

    Thanks in anticipation!.



    ------------------------------
    Elavakumaran SENGODAN
    ------------------------------


  • 2.  RE: Variable table to link with RESTful webservice job for API key variables

    Posted 2 days ago

    hi Elavakumaran,

    You can specify the variables in any field of the RESTful job, by specifying the variable name in carets like this ^API_KEY1^ and ^API_KEY2^.

    If the variables are stored in the default variable table which generally MAIN_TABLE, there is no additional steps required.

    Else if you are using a custom variable table, you may need to specify the variable table most suitably at the jobstream that houses the RESTful job.

    Hope this helps.

    Best,

    Sunil



    ------------------------------
    Sunil Chauhan
    ------------------------------



  • 3.  RE: Variable table to link with RESTful webservice job for API key variables

    Posted 6 hours ago

    Hi Sunil,

      Thanks for your reply!.

       I tried with a custom variable table and it contains 2 API keys configured at the "Run cycles" of that application description via IBM z workload scheduler. But when i run the job via IWS, actual values are NOT getting passed from that variable name, instead passing the variable names ^API_KEY1^ and ^API_KEY2^, job is getting failed with below message "Invalid APIkey". In my RESTful job, two column names  one is Name and another one is Value in "Http headers" under ACTION tab. Under "Name" columns i have axpkey and apikey and it's corresponding values are ^VARTBL.APIKEY1^ and ^VARTBL.APIKEY2^. 

    *********************************************************** Top of Data ************************************************************
    /* */                                                                                                                               
    Job running: Restful                                                                                                                
                                                                                                                                        
    Status code of the Main request: HTTP/1.1 602                                                                                       
                                                                                                                                        
    Response body of the Main request:                                                                                                  
    Invalid API Key to access /cloudapp/JobMng/jobtrigger!                                                                 
    AWKRST020E The main request failed due to the following reason: "Status code of the Main request: HTTP/1.1 602 ".                   
    ******************************************************* Bottom of Data *******************************************************

    Request you kind assitance to check and anything incorrect in this setup please. Thanks in advance!.



    ------------------------------
    Elavakumaran SENGODAN
    ------------------------------