ARIS - Q&A Session 9:00am CEST
Register
ARIS - Q&A Session 6:00pm CEST
Register

View all
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

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums, tags, liking a post and uploading a profile picture.
Recent Unlocks

Leaderboard

Weekly | All-time
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