Automic Workload Automation

 View Only

  • 1.  RA REST API - analyze error code (404, 500 etc...)

    Posted Feb 10, 2023 05:38 AM

    Hello Community,

    I would like to know how to retrieve the standard error code return with an API in case of error like 404, 500 etc...

    I can see messages in the log report, but I cannot find any Automic variable to retrieve the value.

    The response is in json format, but it is not catch with the response part configuration:

    If somebody know how to do, it will be useful for me.

    Thank you



  • 2.  RE: RA REST API - analyze error code (404, 500 etc...)

    Posted Mar 14, 2023 08:00 AM

    I think you have to use prep_process_report in Post-Process to do that.

    Responseparsing seems to be for parsing between the Reportline "Start response pattern" and "End response pattern" only.




  • 3.  RE: RA REST API - analyze error code (404, 500 etc...)

    Broadcom Employee
    Posted Mar 15, 2023 03:47 AM

    Hi Olivier,

    there is also an option to map content of the response header to Automic script variables. Unfortunately the "Status" is not part of the response header and therefore I recommend using PREP_PROCESS_REPORT too.

    Regards, Markus




  • 4.  RE: RA REST API - analyze error code (404, 500 etc...)

    Posted Mar 31, 2023 07:44 AM

    Hello,

    Than you for your response.
    For me, it is not normal that the dedicated agent cannot retrieve automatically the normal return message of an API than:

    2023-03-28 16:44:45             pool-1-thread-1715: JerseyUtils: Check response code:400
    2023-03-28 16:44:45             pool-1-thread-1715: JerseyUtils: Response family:CLIENT_ERROR
    2023-03-28 16:44:45             pool-1-thread-1715: JerseyUtils: Response reason:Bad Request
    2023-03-28 16:44:45             pool-1-thread-1715: JerseyUtils: Response type:Unknown


    It is part of the log, why they cannot put it in the dedicated variable...

    PRE_PROCESS_REPORT can be used, of course, but it is a workaround.