Using .Net SDK and the C# language
Hi All
It’s First time using this forum and the .Net SDK as well.
My manager has asked me to create a prototype proof of concept app to create a signed document from our laptops. The users running the app will have their own Box Accounts.
When the user executes the app, it will…
- Upload a document to their box account.
- The Box Sign behaviour, uSign Myself], will activate and the user will fill out their signature.
- The Signed Doc and Log is created.
- The Signed Doc and Log is downloaded to the users laptop
The issue is that in order to get Box Sign to activate I Create a Sign Request which requires a Signer, even though the user is whom I want to sign the document and the behaviour is not the same as how it acts in Sign Myself].
What am I missing?
Very Rough code below…
BoxDeveloperTokenAuth auth = GetTokenAuthorisation();
BoxClient client = GetBoxClient(auth);
// Upload File
string fullPath = @"C:\Users\srodney_dev\AppData\Local\BoxTest\TesstingBoxUpload.docx";
//string fullPath = @"C:\Users\srodney_dev\AppData\Local\BoxTest\30mbTestDocument.docx";
FileInfo fiInfo = new FileInfo(fullPath);
string uploadFileName = fiInfo.Name;
long uploadFileSize = fiInfo.Length;
FileFull uploadeFile = await UploadImanageFile(client, fullPath);
//Box Sign File
SignRequestCreateSigner boxSigner = new()
{
// This isn't the account running the app
Email = "srodney@**********.co.uk",
RedirectUrl = "https://www.box.com"
};
List<SignRequestCreateSigner> boxSigners = new List<SignRequestCreateSigner>()
{
boxSigner
};
Box.Sdk.Gen.Schemas.File sf = new Box.Sdk.Gen.Schemas.File(uploadeFile.Id);
Box.Sdk.Gen.Schemas.Filee] sourceFiles =
{
sf
};
bool areTextSignaturesEnabled = true;
SignRequestCreateRequest cr = new(boxSigners)
{
AreTextSignaturesEnabled = areTextSignaturesEnabled,
SourceFiles = sourceFiles
};
SignRequest sr = await client.SignRequests.CreateSignRequestAsync(cr);