You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

REST API - Update a member using groovy rule

edited Jan 20, 2020 11:26AM in Planning 6 comments

Summary

Trying to use a groovy rule to update the entity outline

Content

Hi all,

I am trying to do a groovy rule to update my entity dimension using REST API. However it is returning a status error code 302, meaning redirect status response code indicates that the resource requested has been temporarily moved to the URL given by the Location header.

I send my code below any suggestion would be appreciated.

 

 

Version

20.01.33

Code Snippet

// Import JSON library
import groovy.json.*
import groovy.json.JsonSlurper
import org.json.JSONObject
 
// Enter username, pwd
pbcsUrl="https://epm-test-xxxxxx.epm.em2.oraclecloud.com/epmcloud"
pbcsDomain="xxxxxx"
pbcsUsername = myusername
pbcsPassword = mypassword
apiVersion="v3"
appName=myapp
 
// Credentials for basic authorization need to be passed through as username:pwd
userCredentials = pbcsDomain +"." +pbcsUsername + ":" + pbcsPassword;
 
// Basic authorization is set up, but the encoding for credentials need to be changed.
basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userCredentials.getBytes())
 
 
 def getResponse(is) {
    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    StringBuilder sb = new StringBuilder();
    String line;
    while ((line = br.readLine()) != null) {
        sb.append(line+"\n");

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!