/// <summary>
        /// Creates a new Draft that can be claimed and used in an embedded iFrame.
        /// The first authenticated user to access the URL will claim the Draft and will be shown
        /// the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will
        /// result in a 404. For this embedded endpoint the RequesterEmailAddress parameter is required.
        /// </summary>
        /// <param name="draft">The draft.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">draft</exception>
        public Task <UnclaimedDraftResponse> CreateEmbeddedUnclaimedDraftAsync(NewEmbeddedUnclaimedDraft draft, CancellationToken cancellationToken)
        {
            if (draft == null)
            {
                throw new ArgumentNullException(nameof(draft));
            }

            var content = new MultipartFormDataContent();

            content.AddEmbeddedUnclaimedDraft(_log, draft);

            return(PostAsync <UnclaimedDraftResponse>($"{DraftUrl}/create_embedded", content, cancellationToken));
        }
 /// <summary>
 /// Creates a new Draft that can be claimed and used in an embedded iFrame.
 /// The first authenticated user to access the URL will claim the Draft and will be shown
 /// the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will
 /// result in a 404. For this embedded endpoint the RequesterEmailAddress parameter is required.
 /// </summary>
 /// <param name="draft">The draft.</param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException">draft</exception>
 public Task <UnclaimedDraftResponse> CreateEmbeddedUnclaimedDraftAsync(NewEmbeddedUnclaimedDraft draft)
 {
     return(CreateEmbeddedUnclaimedDraftAsync(draft, CancellationToken.None));
 }
Ejemplo n.º 3
0
        public static void AddEmbeddedUnclaimedDraft(this MultipartFormDataContent content, IApiLog log, NewEmbeddedUnclaimedDraft draft)
        {
            content.AddUnclaimedDraft(log, draft);

            content.AddParameter(log, "client_id", draft.ClientId);
            content.AddParameter(log, "requester_email_address", draft.RequesterEmailAddress);
            if (draft.IsForEmbeddedSigning)
            {
                content.AddParameter(log, "is_for_embedded_signing", "1");
            }
        }