AppWorx, Dollar Universe and Sysload Community

 View Only
  • 1.  Automation Engine: How to set up a job to do an API call?

    Posted Jul 30, 2019 10:00 AM
    Edited by boston_019 Jul 30, 2019 10:39 AM
    Hi,

    So I need to create a job that can make an API call to a vendor server. I can do this in SoapUI, break the URL apart into its components (Endpoint, Resource, Parameters, but when I create a new JOBS/WEBSERVICEREST/REST object, the Web Service Rest tab isn't set up like that.I confess I don't know how the architecture works in terms of why a connection object is needed, there seems to be redundancy between the connection object and the job itself... can the job not make the call directly?

    When I run the job, I get "caused by: sun.security.validator.ValidatorException: PKIX path building failed" but AFAIK there are no certificates.

    Any assistance is greatly appreciated. :)


  • 2.  RE: Automation Engine: How to set up a job to do an API call?

    Posted Jul 31, 2019 01:20 AM
    So your problem is, that you do not know how to setup the REST webservice job or the PKIX path building issue?

    #1 - In the conncetion object you can register the base url as well as endpoints and parameters that are inherited to all jobs that use the connection object and - most importantly - the credentials. In case the credentials change you can change them at a single place and all jobs will be automatically amended.

    #2 - Access the service using your webbrowser. Check the certificate - likely the certificate is CA signed. Export that CA and load it into your java keystore on the webservice agent system. It's a pain but there are plenty of instructions on how to do this on the web.

    ------------------------------
    Swisscom & WorkflowCommander
    ------------------------------



  • 3.  RE: Automation Engine: How to set up a job to do an API call?

    Posted Jul 31, 2019 07:34 AM
    Edited by boston_019 Jul 31, 2019 07:34 AM

    Hi,

    Thanks for your reply. I guess I should explain what I'm trying to do. I have a URL that changes everyday that I need to call. The business has decided that feeding that URL into a browser is no good, and that we should do an API call. I can break the URL into it's subcomponents and get it to run via SoapUI, but when I try building a Webservice job and running it I get the PKIX error. I looked and I do have a Webservice agent in my environment, so I'm pinning the job to that as a its host.




  • 4.  RE: Automation Engine: How to set up a job to do an API call?

    Posted Jul 31, 2019 07:41 AM
    Hi Christopher

    You have to go for the CA root certificate installation I was pointing to in my reply if you want to implement the solution with the webservice agent.

    Another solution would be to go for a Windows Job executing a PowerShell that accesses the URL. Setup a Windows job and set the "Interpreter" to "Other" in the Windows-Attributes. In the process tab you can then directly use "Invoke-WebRequest" or "Invoke-RestMethod". You might use a Unix agent as well - usually "curl" is used to execute URL accesses even tough interpreting the response is way easier with powershell.

    ------------------------------
    Swisscom & WorkflowCommander
    ------------------------------