简体   繁体   English

如何在 DocuSign 中使用 SMS-Authentication

[英]How to use SMS-Authentication in DocuSign

I'm trying to implement the SMS authentication with the aid of the DocuSign-SDK library.我正在尝试借助 DocuSign-SDK 库来实现 SMS 身份验证。

var signer = new Signer {...};

signer.RequireIdLookup = "true";
signer.IdCheckConfigurationName = "SMS Auth $";
signer.SmsAuthentication = new RecipientSMSAuthentication {
SenderProvidedNumbers = new List<string> {
    "0171*******"  
   }
};

When I try to send this envelope to the DocuSign API it will reply with the following error message:当我尝试将此信封发送到 DocuSign API 时,它会回复以下错误消息:

Error calling CreateEnvelope: {"errorCode":"INVALIDAUTHENTICATIONSETUP","message":"Recipient phone number is invalid. Phone number for SMS Authentication: provided is invalid. }调用 CreateEnvelope 时出错:{"errorCode":"INVALIDAUTHENTICATIONSETUP","message":"收件人电话号码无效。短信验证电话号码:提供的无效。}

INVALIDAUTHENTICATIONSETUP: Authentication is not setup correctly for the recipient. INVALIDAUTHENTICATIONSETUP:没有为收件人正确设置身份验证。

Is there something I have to enable on the DocuSign Admin page?我必须在 DocuSign 管理页面上启用什么吗? I couldn't find any feature or something like that I need to enable.我找不到需要启用的任何功能或类似功能。

Did I implement it the wrong way?我是否以错误的方式实施它? Maybe someone can give me some suggestions.也许有人可以给我一些建议。

Thanks谢谢

BTW: The given phone number should be valid.顺便说一句:给定的电话号码应该是有效的。

Your code is using the older method, the new method code is provided in GitHub , I'll post it here too.您的代码使用的是旧方法,新方法代码在 GitHub 中提供,我也将在此处发布。 You can find the article on Dev Center.您可以在 Dev Center 上找到该文章

string workflowId = phoneAuthWorkflow.WorkflowId;

EnvelopeDefinition env = new EnvelopeDefinition()
{
    EnvelopeIdStamping = "true",
    EmailSubject = "Please Sign",
    EmailBlurb = "Sample text for email body",
    Status = "Sent"
};

byte[] buffer = System.IO.File.ReadAllBytes(docPdf);

// Add a document
Document doc1 = new Document()
{
    DocumentId = "1",
    FileExtension = "pdf",
    Name = "Lorem",
    DocumentBase64 = Convert.ToBase64String(buffer)
};

// Create your signature tab
env.Documents = new List<Document> { doc1 };
SignHere signHere1 = new SignHere
{
    AnchorString = "/sn1/",
    AnchorUnits = "pixels",
    AnchorXOffset = "10",
    AnchorYOffset = "20"
};

// Tabs are set per recipient/signer
Tabs signer1Tabs = new Tabs
{
    SignHereTabs = new List<SignHere> { signHere1 }
};


string workflowId = workflowId;

RecipientIdentityVerification workflow = new RecipientIdentityVerification()
{
    WorkflowId = workflowId,
    InputOptions = new List<RecipientIdentityInputOption> {
        new RecipientIdentityInputOption
        {
Name = "phone_number_list",
ValueType = "PhoneNumberList",
PhoneNumberList = new List<RecipientIdentityPhoneNumber>
{
    new RecipientIdentityPhoneNumber
    {
        Number = phoneNumber,
        CountryCode = countryAreaCode,
    }
}
        }
    }
};

Signer signer1 = new Signer()
{
    Name = signerName,
    Email = signerEmail,
    RoutingOrder = "1",
    Status = "Created",
    DeliveryMethod = "Email",
    RecipientId = "1", //represents your {RECIPIENT_ID},
    Tabs = signer1Tabs,
    IdentityVerification = workflow,
};

Recipients recipients = new Recipients();
recipients.Signers = new List<Signer> { signer1 };
env.Recipients = recipients;

When I'm using the new method as @Inbar wrote, I can't get the needed workflowId from the AccountsApi .当我使用@Inbar 所写的新方法时,我无法从AccountsApi获得所需的workflowId

var client = new ApiClient(ApiClient.Demo_REST_BasePath);

var token = "eyJ1...";
client.Configuration.DefaultHeader.Add("Authorization", "Bearer " + token);

var accountsApi = new AccountsApi(client);    
var response = accountsApi.GetAccountIdentityVerification(accountId);

var result = response.IdentityVerification; // Is empty. Why?

It seems that I have no IdentityVerification options which I can use for the authentication.似乎我没有可用于身份验证的IdentityVerification选项。

How can I enable such IdentityVerification options?如何启用此类IdentityVerification选项?

Or what else do I need to pay attention to?或者我还有什么需要注意的?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM