Я пытаюсь вызвать метод emmbeddedSignerView из пакета nocument docusign, но ответ не возвращает URL-адрес. Я в конечном итоге копирование блока кода тестGetEmbeddedSignerView badrequest docusing api
// create a new envelope with 2 recipients
var envelope = new Envelope { Login = account };
byte[] doc1 = { 36, 45, 34, 67, 121, 87, 99, 32, 32, 32, 54, 54, 55, 56, 32 };
var signers = new List<Signer>();
// note we need to specify clientUserId
signers.Add(new Signer { email = "[email protected]", name = "test1", recipientId = "1", routingOrder = "1", clientUserId = "1" });
//signers.Add(new Signer { email = "[email protected]", name = "test2", recipientId = "2", routingOrder = "2", clientUserId = "2" });
envelope.Recipients = new Recipients { signers = signers.ToArray() };
envelope.Create(doc1, "test-self-signed.doc");
// send it
envelope.Status = "sent";
envelope.UpdateStatus();
// get embedded signing views for 2 recipients
string urlForfirstSigner = envelope.GetEmbeddedSignerView("www.docusign.com", signers.First());
Когда я отладки я могу видеть, что код статуса ответа «BadRequest» с текстом ответа «RECIPIENT_NOT_IN_SEQUENCE \», \ г \ п \ «сообщение \»: \ «Токен для получателя последовательности не может быть сгенерирован».
Я что-то не так? Я понял, что, поскольку я скопировал код, он должен работать ...
Я использую пакет nuget, поэтому я скопировал данные объекта своих созданных и встроенных запросов подписи и ответов, надеюсь, это поможет.
REQUEST
{System.Net.HttpWebRequest}
base: {System.Net.HttpWebRequest}
Accept: null
Address: {https://demo.docusign.net/restapi/v2/accounts/991023/envelopes?api_password=true}
AllowAutoRedirect: true
AllowReadStreamBuffering: false
AllowWriteStreamBuffering: true
AutomaticDecompression: None
ClientCertificates: {System.Security.Cryptography.X509Certificates.X509CertificateCollection}
Connection: null
ConnectionGroupName: null
ContentLength: 512
ContentType: "multipart/form-data; boundary=00000000-0000-0000-0000-000000000000"
ContinueDelegate: null
ContinueTimeout: 350
CookieContainer: null
Credentials: null
Date: {1/1/0001 12:00:00 AM}
Expect: null
HaveResponse: false
Headers: {X-DocuSign-Authentication: <DocuSignCredentials><Username>[email protected]</Username><Password>MYPASSWORD</Password><IntegratorKey>MYINTEGRATORKEY</IntegratorKey></DocuSignCredentials>
Content-Type: multipart/form-data; boundary=00000000-0000-0000-0000-000000000000
Host: demo.docusign.net
}
Host: "demo.docusign.net"
IfModifiedSince: {1/1/0001 12:00:00 AM}
KeepAlive: true
MaximumAutomaticRedirections: 50
MaximumResponseHeadersLength: 64
MediaType: null
Method: "POST"
Pipelined: true
PreAuthenticate: false
ProtocolVersion: {1.1}
Proxy: null
ReadWriteTimeout: 300000
Referer: null
RequestUri: {https://demo.docusign.net/restapi/v2/accounts/991023/envelopes?api_password=true}
SendChunked: false
ServerCertificateValidationCallback: null
ServicePoint: {System.Net.ServicePoint}
SupportsCookieContainer: true
Timeout: 100000
TransferEncoding: null
UnsafeAuthenticatedConnectionSharing: false
UseDefaultCredentials: false
UserAgent: null
RESPONSE
{DocuSign.Integrations.Client.ResponseInfo}
ContentType: "application/json; charset=utf-8"
ErrorMessage: ""
ResponseBytes: {byte[198]}
ResponseStream: {System.Net.ConnectStream}
ResponseText: "{\r\n \"envelopeId\": \"b3c02285-f787-49b4-951d-53bb4057023e\",\r\n \"uri\": \"/envelopes/b3c02285-f787-49b4-951d-53bb4057023e\",\r\n \"statusDateTime\": \"2015-04-22T04:26:41.7770000Z\",\r\n \"status\": \"created\"\r\n}"
StatusCode: Created
REQUEST
{System.Net.HttpWebRequest}
base: {System.Net.HttpWebRequest}
Accept: "application/json"
Address: {https://demo.docusign.net/restapi/v2/accounts/991023/envelopes/b3c02285-f787-49b4-951d-53bb4057023e/views/recipient}
AllowAutoRedirect: true
AllowReadStreamBuffering: false
AllowWriteStreamBuffering: true
AutomaticDecompression: None
ClientCertificates: {System.Security.Cryptography.X509Certificates.X509CertificateCollection}
Connection: null
ConnectionGroupName: null
ContentLength: 133
ContentType: "application/json"
ContinueDelegate: null
ContinueTimeout: 350
CookieContainer: null
Credentials: null
Date: {1/1/0001 12:00:00 AM}
Expect: null
HaveResponse: false
Headers: {Accept: application/json
Content-Type: application/json
X-DocuSign-Authentication: <DocuSignCredentials><Username>[email protected]</Username><Password>MYPASSWORD</Password><IntegratorKey>MYINTEGRATORKEY</IntegratorKey></DocuSignCredentials>
Host: demo.docusign.net
}
Host: "demo.docusign.net"
IfModifiedSince: {1/1/0001 12:00:00 AM}
KeepAlive: true
MaximumAutomaticRedirections: 50
MaximumResponseHeadersLength: 64
MediaType: null
Method: "POST"
Pipelined: true
PreAuthenticate: false
ProtocolVersion: {1.1}
Proxy: null
ReadWriteTimeout: 300000
Referer: null
RequestUri: {https://demo.docusign.net/restapi/v2/accounts/991023/envelopes/b3c02285-f787-49b4-951d-53bb4057023e/views/recipient}
SendChunked: false
ServerCertificateValidationCallback: null
ServicePoint: {System.Net.ServicePoint}
SupportsCookieContainer: true
Timeout: 100000
TransferEncoding: null
UnsafeAuthenticatedConnectionSharing: false
UseDefaultCredentials: false
UserAgent: null
RESPONSE
{DocuSign.Integrations.Client.ResponseInfo}
ContentType: "application/json; charset=utf-8"
ErrorMessage: "Bad Request"
ResponseBytes: null
ResponseStream: null
ResponseText: "{\r\n \"errorCode\": \"RECIPIENT_NOT_IN_SEQUENCE\",\r\n \"message\": \"The token for an out of sequence recipient cannot be generated.\"\r\n}"
StatusCode: BadRequest
: GetEmbeddedSignerView с использованием param1 как "returnUrl"? Также вы могли бы разместить свои полные запросы/ответы для создания токена получателя конверта/запроса? – Andrew