AI

Hi all,

I want to connect the script in the ARIS report with ARIS API repository. I have tenant, name, password and key for creating a token and to start the connection, but in the following code I will not show them(but the fields aren't empty).

I get error that connection is refused on the line "var responseCode = con.getResponseCode();"

Can please someone help?

I have the following piece of code:

function httpRequestPOST(url){

    var obj = new java.net.URL(url);

    var con = obj.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("User-Agent", java.net.USER_AGENT);

    var tenant = "";

    var name = "";

    var password = "";

    var key = "";

    var authString = tenant + ":" + name + ":" + password + ":" + key;

    var encoder = new Base64.encode(authString);    

    con.setRequestProperty("Authorization", "Basic " + encoding);

    var responseCode = con.getResponseCode();

    var iN = new java.io.BufferedReader(new java.io.InputStreamReader(con.getInputStream()));

    var inputLine = new java.lang.String();

    var response = new java.lang.StringBuffer();

    while((inputLine = iN.readLine()) != null){

        response.append(inputLine);

    }

    iN.close();

    return new java.lang.String(response);

    

   try{

        con.getResponseCode();

    }

    catch(e){

        e.getMessage();

    }

}

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CR
  • BH
  • Profile picture for user Ivan.Ivanov.softwareag.com
  • Profile picture for user mscheid
  • MS
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock