using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
var document = Task.Run(() => MainAsync()).Result;
public static async Task<ScriveDocumentV2> MainAsync()
var scrive = new ScriveApiV2(new ScriveConfigurationV2
ClientIdentifier = "0123456789",
ClientSecret = "0123456789",
TokenIdentifier = "0123456789",
TokenSecret = "0123456789",
Hostname = "https://api-testbed.scrive.com",
var res1 = await scrive.NewDocument();
if (res1.Success == false)
res1.Document.Language = "en";
res1.Document.Title = "Test";
res1.Document.Parties.Add(new ScriveDocumentV2Party
Fields = new List<ScriveDocumentV2PartiesField>
new ScriveDocumentV2PartiesField
new ScriveDocumentV2PartiesField
new ScriveDocumentV2PartiesField
Value = "api-testbed@scrive.com",
var res2 = await scrive.UpdateDocument(res1.Document);
if (res2.Success == false)
var mainfile = File.ReadAllBytes("MainFile.pdf");
var res3 = await scrive.SetMainFile(res2.Document, mainfile);
if (res3.Success == false)
var attachment = File.ReadAllBytes("Attachment.pdf");
var res4 = await scrive.SetAuthorAttachments(res3.Document, attachment, "Attachment.pdf");
if (res4.Success == false)
var res5 = await scrive.StartSigningProcess(res4.Document);
if (res5.Success == false)