Automic Workload Automation

Expand all | Collapse all

How to make AE REST API call using Curl command

Jump to Best Answer
  • 1.  How to make AE REST API call using Curl command

    Posted 03-14-2018 03:07 PM
    Hi All,

    I have created a workflow in AWA and would like to trigger that workflow object from outside of AE engine using Rest API. I also want to pass a value to the object variable defined in the workflow from the command line itself. Please explain me an example on how to execute a workflow using Curl command. 

    Best Regards,
    Srujan.


  • 2.  How to make AE REST API call using Curl command

    Posted 03-14-2018 10:36 PM
    Hi Srujan Pathuri

    You can access our official documentation for the AWA REST API
    https://docs.automic.com/documentation/webhelp/english/AWA/12.1/DOCU/12.1/AWA%20Guides/help.htm#REST API/AE_REST_API_GeneralInfo.htm

    and I would suggest you to post the question on the below category thread
    https://community.automic.com/categories/one-automation-english


  • 3.  How to make AE REST API call using Curl command

    Posted 03-15-2018 07:21 AM
    Tran-Hoang_Hau_348

    Thanks for sharing the links.

    I am able to perform GET request through that API, however, when I tried to execute the workflow using POST, it is throwing the following error. I have passed the "object_name" as a parameter. Could you please tell me the reason for this.

    {
        "code": 45110,
        "error": "An Automation Engine internal error occured.",
        "details": "RESTEASY003200: Could not find message body reader for type: class com.automic.rest.executions.executeobject.InExecutionParameters of content type: */*"
    }

    Regards,
    Srujan.


  • 4.  How to make AE REST API call using Curl command

    Posted 03-15-2018 07:57 AM
    Hi Srujan_Pathuri_9871

    Could you copy the complete curl command you are attempting to run in a message ?
    That may help us understand what the issue is.

    Best regards,
    Antoine


  • 5.  How to make AE REST API call using Curl command

    Posted 03-15-2018 08:05 AM
    Antoine_Sauteron

    Sorry, my bad. There was an error in the command and it is now able to execute the job perfectly. The problem is that it is not passing input value to the object variable. Will that only work for Promptset variables and not object variables?

    Thanks,
    Srujan.


  • 6.  How to make AE REST API call using Curl command

    Posted 03-15-2018 08:55 AM
    Thanks for your feedback.

    What does the curl command you are trying to run look like ?

    Best regards,
    Antoine


  • 7.  How to make AE REST API call using Curl command

    Posted 03-15-2018 10:23 AM
    I am using POSTMAN to perform this API call because I am unable to get the response using Curl.You can find the following screenshot. Could you please copy the complete curl command to call AE API? 
    tfwb8efkddaj.jpghttps://us.v-cdn.net/5019921/uploads/editor/vo/tfwb8efkddaj.jpg" width="708">

    Thanks,
    Srujan.



  • 8.  How to make AE REST API call using Curl command
    Best Answer

    Posted 03-16-2018 12:56 PM
    Hey stumbled upon your case and tried it out on my side, I got it work with several changes to the cUrl Command:
    curl -D- -u USER/DEPARTMENT -X POST -H "Content-Type: application/json" http://localhost:8088/ae/api/v1/100/executions -d "{\"object_name\":\"JOBP.CD.POC\",\"inputs\":{\"RET1#\":\"Adm\"}}" 
    First important change is: -H "Content-Type: application/json"
    Second important change is: inside the curly brackets you need to put a backslash in front of the every Quotation-mark.
    Please verify if this worked on your side?
    :) 

    Best Regards
    Eisa Heinig 


  • 9.  How to make AE REST API call using Curl command

    Posted 03-19-2018 02:38 PM
    Thanks heiei01  :)

    I tried that but it didn't work for me. It is showing no output and must be expecting some more characters I guess.
    sxwwq143s97a.jpghttps://us.v-cdn.net/5019921/uploads/editor/s7/sxwwq143s97a.jpg" width="587">
    Regards,
    Srujan.



  • 10.  How to make AE REST API call using Curl command

    Posted 03-21-2018 06:12 AM
    Hi,

    100 in the url must be replaced by your clients nr. Like this

    http://<hostname>:8088/ae/api/v1/<client>/executions

    Matthias


  • 11.  How to make AE REST API call using Curl command

    Posted 03-21-2018 06:35 AM
    MatthiasSchelp

    Even we are on Client 100, not sure what else missing out in the URL.

    Thanks,
    Srujan.


  • 12.  How to make AE REST API call using Curl command

    Posted 03-21-2018 08:45 AM
    Upps, yeah sorry. Haven't seen its on your screenshot.

    Did you get any error message?
    Did you try without the "inputs"?
    Is there anything listening on port 8088 of your host?

    Use
    telnet <host> 8088
    or on the destination host
    netstat -lenp | grep 8088
    to check.

    Matthias