问题
I sent a DocuSign SOAP API request. DocuSign responded with status 500 and faultstring of
1234: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
I searched for the error code 1234 in the docs and online but couldn't find it.
The headers and XML I sent:
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://www.docusign.net/API/3.0/CreateAndSendEnvelope"
X-DocuSign-Authentication: <DocuSignCredentials><Username>email@example.com</Username><Password>[omitted]</Password><IntegratorKey>[omitted]</IntegratorKey></DocuSignCredentials>
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header/>
<env:Body>
<CreateAndSendEnvelope xmlns="http://www.docusign.net/API/3.0">
<Envelope>
<AccountId>1234</AccountId>
<Documents>
<Document>
<ID>1</ID>
<Name>NDA Document</Name>
<PDFBytes>[omitted]</PDFBytes>
<FileExtension>html</FileExtension>
</Document>
</Documents>
<Recipients>
<Recipient>
<ID>1</ID>
<UserName>Larry Example</UserName>
<Email>larry@example.com</Email>
<Type>Signer</Type>
<AccessCode xsi:nil="true"/>
<RoutingOrder>1</RoutingOrder>
</Recipient>
</Recipients>
<Subject>Please sign the NDA package</Subject>
</Envelope>
</CreateAndSendEnvelope>
</env:Body>
</env:Envelope>
回答1:
I managed to solve the problem:
The XML faultstring of
1234: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
did not mean error code 1234. Instead it meant that my supplied value of 1234 (for the account ID) should have been provided in the "long form" of a guid.
For the account ID, the guid version of the account id value is shown in the Admin tool, in the "API and Keys" section.
At the top of the page, it shows the "API Account ID" -- that's the long form version of the Account ID that's needed.
When I substituted the guid version of the account ID for the short version, the XML request worked fine.
来源:https://stackoverflow.com/questions/39404029/docusign-soap-api-guid-should-contain-32-digits-with-4-dashes-xxxxxxxx-xxxx-xx