Java REST Setting the Sender is ignored
Monday, September 17, 2018 at 11:07amI am tryng to change my working code from uploading a single PDF containing a "stage" of forms to upload each form selected from the "stage" as a PDF. Many of the stages select forms which do not contain signatures, so I am not getting any information for the sender and signers until later.
I send a REST call to set the package sender and a role for it, but when I download the package it has the account owner as the sender. I am not getting any error or reponse when I PUT the sender. It is just ignoring me.
Here is the jsonObject:
// change the sender email on the package
JsonObject jsonObject = Json.createObjectBuilder()
.add("sender", Json.createObjectBuilder()
.add("id", sender.getESignID())
.add("email", sender.getEMail()))
.build();
Here is the REST I am sending:
try {
HttpURLConnection connection = (HttpURLConnection) new URL(serviceURL
+ "/packages/" + packageID).openConnection();
connection.setRequestMethod("PUT");
connection.setDoOutput(true);
connection.setRequestProperty("Authorization", "Basic " + apiKey);
connection.setRequestProperty("Accept", "application/json");
OutputStream output = connection.getOutputStream();
PrintWriter writer = new PrintWriter(
new OutputStreamWriter(output, CHARSET), true);
writer.append(CRLF).append(jsonObject.toString()).append(CRLF).flush();
LOGGER.info("E-Sign update package: " + packageID);
int responseCode = connection.getResponseCode();
if (responseCode != HttpURLConnection.HTTP_OK) {
throwConnectionError("E-Sign error updating package", connection);
}
} catch (IOException ex) {
LOGGER.info(ex.getMessage());
throw new RuntimeException(ex.getMessage());
}
Reply to: Java REST Setting the Sender is ignored
Monday, September 17, 2018 at 11:45amReply to: Java REST Setting the Sender is ignored
Monday, September 17, 2018 at 01:11pmReply to: Java REST Setting the Sender is ignored
Friday, September 21, 2018 at 11:58am