Skip to main content
Question

Having Issues With A Box SIgn Console App I Am Creating

  • February 18, 2025
  • 0 replies
  • 15 views

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…

  1. Upload a document to their box account.
  2. The Box Sign behaviour, [Sign Myself], will activate and the user will fill out their signature.
  3. The Signed Doc and Log is created.
  4. 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.File[] sourceFiles =
{
   sf
};

bool areTextSignaturesEnabled = true;

SignRequestCreateRequest cr = new(boxSigners)
{
    AreTextSignaturesEnabled = areTextSignaturesEnabled,
    SourceFiles = sourceFiles
};

SignRequest sr = await client.SignRequests.CreateSignRequestAsync(cr);


 

0 replies

Be the first to reply!

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings