Is it possible to override $PACKAGE_OWNER_EMAIL when createPackage via API SDK?
May 20Created
May 20Last Updated
4 years agoLast Reply
2Replies
35Views
2Users
0Likes
0Links
Duo_Liang | Posts: 3776
Reply to: Override $PACKAGE_OWNER_EMAIL via API SDK
Wednesday, May 20, 2020 at 09:05am
0
votes
Hi Wendy,
The "$PACKAGE_OWNER_EMAIL;" parameter always points to the package owner, therefore the only way to change the value is to let the desired sender created the package, and in turn, become package owner. You can either use the sender's API Key instead of account owner's or use the feature "Send on behalf of a Sender" which allows you to use account owner's API Key and create package under respective sender.
Thanks for your information. But after I added this line: .withSenderInfo(SenderInfoBuilder.newSenderInfo("[email protected]")), I got the below error when createPackage
{
"source" : "ESignLive",
"errors" : [
{
"errorKey" : "escs.error.failed.createPackage",
"errorMessage" : "Create Package failed. E-SignLive Error: Could not create a new package in one-step Exception: HTTP POST on URI https://sit.ssaa.cibc.com:8024/api/packages resulted in response with status code: [403, Forbidden]. Optional details: {\"code\":403,\"messageKey\":\"error.forbidden.accountNotAccessible\",\"message\":\"The operation requested cannot be done by the user requesting it because there is an account access mismatch\",\"name\":\"Access Denied\"}"
}
]
}
Before Add this line, I can successfully create package. Any idea what is wrong?
Reply to: Override $PACKAGE_OWNER_EMAIL via API SDK
Wednesday, May 20, 2020 at 09:05amHi Wendy,
The "$PACKAGE_OWNER_EMAIL;" parameter always points to the package owner, therefore the only way to change the value is to let the desired sender created the package, and in turn, become package owner. You can either use the sender's API Key instead of account owner's or use the feature "Send on behalf of a Sender" which allows you to use account owner's API Key and create package under respective sender.
With Java SDK:
DocumentPackage pkg1 = PackageBuilder.newPackageNamed("Create on behalf of " + System.currentTimeMillis())
.withSigner(SignerBuilder.newSignerWithEmail("[email protected]" )
.withFirstName("John")
.withLastName("Smith"))
.withDocument(DocumentBuilder.newDocumentWithName("document 1")
.fromFile("your_file_path")
.withSignature(SignatureBuilder.signatureFor("[email protected]")
.onPage(0)
.atPosition(100, 100)
.withSize(250, 75)))
.withSenderInfo(SenderInfoBuilder.newSenderInfo("[email protected]"))
.build();
With REST API:
{
"status": "DRAFT",
"description": "Test package'",
"language": "en",
"type": "PACKAGE",
"visibility":"ACCOUNT",
"name": "Send On Behalf Of A Sender",
"sender": {
"email": "[email protected]"
}
}
Above, the .withSenderInfo() function and the "sender" node in JSON is where you specify the sender's email.
Duo
Reply to: Hi Wendy, The "$PACKAGE…
Wednesday, May 20, 2020 at 05:48pmHi Duo,
Thanks for your information. But after I added this line: .withSenderInfo(SenderInfoBuilder.newSenderInfo("[email protected]")), I got the below error when createPackage
{
"source" : "ESignLive",
"errors" : [
{
"errorKey" : "escs.error.failed.createPackage",
"errorMessage" : "Create Package failed. E-SignLive Error: Could not create a new package in one-step Exception: HTTP POST on URI https://sit.ssaa.cibc.com:8024/api/packages resulted in response with status code: [403, Forbidden]. Optional details: {\"code\":403,\"messageKey\":\"error.forbidden.accountNotAccessible\",\"message\":\"The operation requested cannot be done by the user requesting it because there is an account access mismatch\",\"name\":\"Access Denied\"}"
}
]
}
Before Add this line, I can successfully create package. Any idea what is wrong?