Continuous Delivery Automation

Expand all | Collapse all

ARA Issue : Unable to create Package using VBA POST Method.

Jump to Best Answer
  • 1.  ARA Issue : Unable to create Package using VBA POST Method.

    Posted 02-11-2019 05:56 AM

    Hi Team,

    I want to use VBA Excel MACRO for creating & executing Package. I am successfully able to fetch response with GET method of REST API with successful base64 Authentication.

     

    But not able to use POST method for creating package, as it is ending up in error as below.

     

    {

    "Message" : "The argument(s) cannot be null : packageInfo"

    }

     

    However I am also passing all 4 valid mandatory fields, mentioned as below:

     

    http://{Our server}.com/ara/api/data/v1/packages?name=AG_TEST80&folder=DEFAULT&custom_type=ONE&application=SSD_DEPLOYMENTS&status=Dev

     

    Not sure what is wrong. Please help.

     

    Thanks

    Amit Gohel

    Bank of the West, Release Manager.



  • 2.  Re: ARA Issue : Unable to create Package using VBA POST Method.

    Posted 02-11-2019 11:26 PM

    Hi,

     

    I suppose your question is related to Automic Release Automation (Continuous Delivery Automation). 

    So, I will move this thread to correct community.

    https://communities.ca.com/community/ca-automic-community/ca-automic-release-automation/pages/overview 

     

    Thanks

    Yas



  • 3.  Re: ARA Issue : Unable to create Package using VBA POST Method.

    Posted 02-19-2019 06:20 AM

    Hi AmitGohel

     

    as your are using a POST-request you have to specify your values in the body in JSON format and not as part of your URL.

     

     

    e.g.

    URL: http://myCDAServer/cda/api/data/v1/packages

    Body:

    {
    "application": "DemoApp",
    "name" : "Package-20190219-121836",
    "custom_type" : "Deployment",
    "folder" : "DEMOAPP_PACKAGES"
    }

     

     



  • 4.  Re: ARA Issue : Unable to create Package using VBA POST Method.
    Best Answer

    Posted 02-20-2019 06:45 AM

    Hi Michael,

    Thanks a lot for the much needed help. My issue is solved.

    I saved the JSON formatted Data in some cell & passed it as below.

     

    Dim objHTTP As Object
        Dim Json As String
        Json = Range("A15")     'here I am pulling in an existing json string to test it.

     

        Dim result As String

        Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
        URl = "http://myApi/iSendJsonto/"
        objHTTP.Open "POST", URl, False

       objHTTP.setRequestHeader "Content-type", "application/json"
       objHTTP.send (Json)
       result = objHTTP.responseText

       'Some simple debugging
       Range("A25").Value = result
       Range("A26").Value = Json


       Set objHTTP = Nothing