Automic Workload Automation

 View Only
  • 1.  REST JOB, API call

    Posted Jul 12, 2019 08:24 AM
    Dear all,

    i try to execute an Webservice request to an external api interface with Automic REST Job.

    For very simple calls its working fine, f.e.

    REST JOB as part of a workflow:

    Pre-Process tab in REST JOB
    set RestConnection and Method -> get data from Prompt Set


     override URI Endpoint -> get data from Prompt Set



    But now i have a parameter as we execute this request for different markets.

    Currently i am executing it via powershell like this:
    "
    $Body = @{
    "MarketId"="3"
    }

    Invoke-WebRequest -Uri http://xxx.xxx.xxxx.xxxxx:7080/xxxxxxxxxxx/xxxxxxxxxxxx/StatementsGenerated -Method POST -Body (ConvertTo-Json $Body)
    "

    Anyone here, who knows how to setup the rest job in Automic with an addtional "parameter" so that i execute this request just for MarketID=3?

    Thanks in advance for your help.

    regards,
    Ben




  • 2.  RE: REST JOB, API call

    Posted Aug 27, 2019 05:06 AM
    Hi,

    no one is working with the JOBS Rest Job?

    Does anyone know how it is possible to insert Parameters (in a prompt set f. e.) in die direct input field of the Rest job?


    I tried to assign the Parameter Market and Agency to direct input field. Values are coming from a Prompt Set. Its not working.
    If i check the created *.json file the command is like: 


    So i guess i have to work with PUT_ATT or something like this in Process Tab. But i dont know how.
    For the Connection and the Method (PUT, POST, GET) its working. For those ones i know the Name to use. (See picture)

    Anyone who is able to help?

    Thanks,

    regards,
    Benedikt


  • 3.  RE: REST JOB, API call

    Posted Aug 27, 2019 06:22 PM
    Shouldn't that be &MARKET# / &AGENCY# and not $MARKET# / $AGENCY#


  • 4.  RE: REST JOB, API call

    Posted Aug 28, 2019 02:18 AM
    Hi Michael,

    yes you're right. it was a miss typing.
    after i've changed it, its working.

    But i dont know how to get data in this direct input field, if the method "post" is not saved by default.
    If i save this JOBS with method "get" this direct input field is disappearing and if i try to get data into this field via :PUT_ATT its not working.

    My goal is to have a generic JOBS with one PROMPT SET which can handle a lot of such requests.

    regards
    Ben



  • 5.  RE: REST JOB, API call

    Posted Aug 28, 2019 09:58 AM
    Edited by Benedikt Weiler Aug 28, 2019 10:00 AM

    Hi,

    meanwhile i was able to get it done

    with the query below you retrieve all attributes you can use/choose:

    select OCV_VName as Attribute,OCV_Value as Value
    from OH join OCV on OH_Idnr=OCV_OH_Idnr
    where OH_Name='YOUR_JOB_NAME'

    With this i figured out that the attribute name for "direct input" is: request_part_0_requestTab_data_1

    direct input:
    :PUT_ATT request_part_0_requestTab_data_1 = {"bla bla":"bla bla"}

    type
    :PUT_ATT mediaType = "application/json"

    With this i am able to have ONE JOBS and ONE PROMPTSET and i can use it xxxxx times.

    regards,
    Benedikt




  • 6.  RE: REST JOB, API call

    Posted Jan 31, 2022 03:10 AM
    How to configure a REST Job in AE?


  • 7.  RE: REST JOB, API call

    Posted Feb 01, 2022 03:19 AM
    By reading the documentation first.

    ------------------------------
    ☎️ Swisscom Automation Engineer & 🧙 PE Membership Creator

    Automic Kurse, Tutorials, Tools und mehr auf:
    https://membership.philippelmer.com/
    Zwei Wochen kostenlos testen!
    ------------------------------