private AgreementCreationResponse CreateAgreement(int?creditDataId, string transientDocumentId, string recipientEmail, string agreementName) { var agreementRequest = new AgreementMinimalRequest { fileInfos = new List <AdobeSignRESTClient.Models.FileInfo> { new AdobeSignRESTClient.Models.FileInfo { transientDocumentId = transientDocumentId } }, name = agreementName, participantSetsInfo = new List <ParticipantInfo> { new ParticipantInfo { memberInfos = new List <MemberInfo> { new MemberInfo { email = recipientEmail //email = string.Empty } }, order = 1, role = "SIGNER" } }, emailOption = new EmailOption { sendOptions = new SendOption { completionEmails = "NONE", inFlightEmails = "NONE", initEmails = "NONE" } }, externalId = new ExternalId { id = creditDataId.Value.ToString() }, signatureType = "ESIGN", state = "IN_PROCESS" //state="AUTHORING" }; try { var response = client.CreateAgreement(creditDataId, agreementRequest).Result; repository.AddAdobeSignLog(creditDataId, "CreateAgreement", agreementRequest.ToJson(), response); return(response); } catch (Exception e) { repository.AddAdobeSignLog(creditDataId, "CreateAgreement", agreementRequest.ToJson(), e); Console.WriteLine(e); throw; } }
public async Task <AgreementCreationResponse> CreateAgreement([FromBody] AgreementMinimalRequest agreement) { Task <AgreementCreationResponse> response; try { await this.RefreshTokenAsync().ConfigureAwait(true); response = Task.FromResult(client.CreateAgreement(agreement).Result); } catch (Exception e) { Console.WriteLine(e); throw; } return(await response); //client.CreateAgreement(); }