0

I have implemented the endpoint by using DocuSign Java SDK and it is working fine but the result is a bit different in comparison to the result getting from Postman. Below is the result from Postman when calling {{baseUrl}}/v2.1/accounts/{{accountId}}/envelopes?folder_ids=out_for_signature&include=recipients&exclude=folders,powerforms result

{
"resultSetSize": "1",
"startPosition": "0",
"endPosition": "0",
"totalSetSize": "1",
"nextUri": "",
"previousUri": "",
"envelopes": [
    {
        "status": "sent",
        "documentsUri": "/envelopes/xxxx-9777-7153b02d44e3/documents",
        "recipientsUri": "/envelopes/axxxxfaf-9777-7153b02d44e3/recipients",
        "attachmentsUri": "/envelopes/xxxxaf-9777-7153b02d44e3/attachments",
        "envelopeUri": "/envelopes/xxxxx4faf-9777-7153b02d44e3",
        "emailSubject": "Please sign this document set",
        "envelopeId": "a826d1da-8cf6-4faf-9777-7153b02d44e3",
        "customFieldsUri": "/envelopes/xxf-9777-7153b02d44e3/custom_fields",
        "notificationUri": "/envelopes/x6-4faf-9777xxxx-7153b02d44e3/notification",
        "createdDateTime": "2021-12-06T21:27:02.8300000Z",
        "lastModifiedDateTime": "2021-12-14T19:45:07.3300000Z",
        "initialSentDateTime": "2021-12-06T21:27:04.0800000Z",
        "sentDateTime": "2021-12-13T20:19:00.8570000Z",
        "statusChangedDateTime": "2021-12-14T19:45:07.3900000Z",
        "documentsCombinedUri": "/envelopes/a826d1da-8cf6-4faf-9777-7153b02d44e3/documents/combined",
        "certificateUri": "/envelopes/xxxx-4faf-9777-7153b02d44e3/documents/certificate",
        "templatesUri": "/envelopes/xxxx4faf-9777-7153b02d44e3/templates",
        "expireEnabled": "true",
        "expireDateTime": "2022-04-05T21:27:04.0800000Z",
        "expireAfter": "111",
        "sender": {
            "userName": "rizauddin Mohammad",
            "userId": "xxxxxx11-987f-0c9253822c79",
            "accountId": "xxxxx-46d2-9f5e-d39f7ffaeec3"
        },
       
            "certifiedDeliveries": [],
            "inPersonSigners": [],
            "seals": [],
            "witnesses": [],
            "notaries": [],
            "recipientCount": "2",
            "currentRoutingOrder": "1"
        },
        "purgeState": "unpurged",
        "isSignatureProviderEnvelope": "false",
        "anySigner": null,
        "envelopeLocation": "current_site"
    }
]

}

And the result from SDK when having this code

final EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
val options = envelopesApi.new ListStatusChangesOptions();
options.setFolderIds("out_for_signature");
options.setInclude("recipients");
options.setExclude("folders,powerForms");
EnvelopesInformation envelopesInformation = envelopesApi.listStatusChanges(accountId, options);

[
{
    "accessControlListBase64": null,
    "allowComments": null,
    "allowMarkup": null,
    "allowReassign": null,
    "allowViewHistory": null,
    "anySigner": null,
    "asynchronous": null,
    "attachmentsUri": "/envelopes/xxxxx9777-7153b02d44e3/attachments",
    "authoritativeCopy": null,
    "authoritativeCopyDefault": null,
    "autoNavigation": null,
    "brandId": null,
    "brandLock": null,
    "certificateUri": "/envelopes/a826d1da-8cf6-4faf-9777-7153b02d44e3/documents/certificate",
    "completedDateTime": null,
    "copyRecipientData": null,
    "createdDateTime": "2021-12-06T21:27:02.8300000Z",
    "customFields": null,
    "customFieldsUri": "/envelopes/xxxx6-4faf-9777-7153b02d44e3/custom_fields",
    "declinedDateTime": null,
    "deletedDateTime": null,
    "deliveredDateTime": null,
    "disableResponsiveDocument": null,
    "documentBase64": null,
    "documentsCombinedUri": "/envelopes/a826d1da-8cf6-4faf-9777-7153b02d44e3/documents/combined",
    "documentsUri": "/envelopes/xxxxx4faf-9777-7153b02d44e3/documents",
    "emailBlurb": null,
    "emailSettings": null,
    "emailSubject": "Please sign this document set",
    "enableWetSign": null,
    "enforceSignerVisibility": null,
    "envelopeAttachments": null,
    "envelopeDocuments": null,
    "envelopeId": "xxxx-9777-7153b02d44e3",
    "envelopeIdStamping": null,
    "envelopeLocation": "current_site",
    "envelopeMetadata": null,
    "envelopeUri": "/envelopes/xxxxx4faf-9777-7153b02d44e3",
    "expireAfter": "111",
    "expireDateTime": "2022-04-05T21:27:04.0800000Z",
    "expireEnabled": "true",
    "externalEnvelopeId": null,
    
        "certifiedDeliveries": [],
        "currentRoutingOrder": "1",
        "editors": [],
        "errorDetails": null,
        "inPersonSigners": [],
        "intermediaries": [],
        "notaries": [],
        "recipientCount": "2",
        "seals": [],
        "signers": [
            {
                "accessCode": null,
                "accessCodeMetadata": null,
                "addAccessCodeToEmail": null,
                "additionalNotifications": null,
                "agentCanEditEmail": null,
                "agentCanEditName": null,
                "allowSystemOverrideForLockedRecipient": null,
                "autoNavigation": null,
                "autoRespondedReason": null,
                "bulkRecipientsUri": null,
                "canSignOffline": null,
                "clientUserId": null,
                "completedCount": "0",
                "creationReason": "sender",
                "customFields": null,
                "declinedDateTime": null,
                "declinedReason": null,
                "defaultRecipient": null,
                "deliveredDateTime": null,
                "deliveryMethod": "email",
                "deliveryMethodMetadata": null,
                "designatorId": null,
                "designatorIdGuid": null,
                "documentVisibility": null,
                "email": "rizauddin446@gmail.com",
                "emailMetadata": null,
                "emailNotification": null,
                "embeddedRecipientStartURL": null,
                "errorDetails": null,
                "excludedDocuments": null,
                "faxNumber": null,
                "faxNumberMetadata": null,
                "firstName": "",
                "firstNameMetadata": null,
                "fullName": null,
                "fullNameMetadata": null,
                "idCheckConfigurationName": null,
                "idCheckConfigurationNameMetadata": null,
                "idCheckInformationInput": null,
                "identityVerification": null,
                "inheritEmailNotificationConfiguration": null,
                "isBulkRecipient": null,
                "isBulkRecipientMetadata": null,
                "lastName": "",
                "lastNameMetadata": null,
                "lockedRecipientPhoneAuthEditable": null,
                "lockedRecipientSmsEditable": null,
                "name": "rizauddin mohammad",
                "nameMetadata": null,
                "notaryId": null,
                "note": null,
                "noteMetadata": null,
                "offlineAttributes": null,
                "phoneAuthentication": null,
                "phoneNumber": null,
                "proofFile": null,
                "recipientAttachments": null,
                "recipientAuthenticationStatus": null,
                "recipientFeatureMetadata": null,
                "recipientId": "1",
                "recipientIdGuid": "xdcd3-4fxxxxc2-aec2-ef83d86cadaa",
                "recipientSignatureProviders": null,
                "recipientSuppliesTabs": null,
                "recipientType": "signer",
                "recipientTypeMetadata": null,
                "requireIdLookup": "false",
                "requireIdLookupMetadata": null,
                "requireSignerCertificate": null,
                "requireSignOnPaper": null,
                "requireUploadSignature": "false",
                "roleName": null,
                "routingOrder": "1",
                "routingOrderMetadata": null,
                "sentDateTime": null,
                "signatureInfo": null,
                "signedDateTime": null,
                "signInEachLocation": null,
                "signInEachLocationMetadata": null,
                "signingGroupId": null,
                "signingGroupIdMetadata": null,
                "signingGroupName": null,
                "signingGroupUsers": null,
                "smsAuthentication": null,
                "socialAuthentications": null,
                "status": "sent",
                "statusCode": null,
                "suppressEmails": null,
                "tabs": null,
                "templateLocked": null,
                "templateRequired": null,
                "totalTabCount": null,
                "userId": "xxxxx-4e74-aab8-bd1f98e63fb6"
            }
        ],
        "witnesses": []
    },
    
}

]

I have to get the same result as I get from Postman. Is there any options I need to add or remove in coding?

Larry K
  • 47,808
  • 15
  • 87
  • 140
riza446
  • 43
  • 1
  • 7

1 Answers1

0

In C# and Java the DocuSign SDKs not yet using dynamic typing and modern techniques to build objects. The objects have to (from the nature of classic OOP design for both C# and Java) have all the various properties that can be returned, or else you will need a different object for each combination of returned data.

I have to get the same result as I get from Postman. Is there any options I need to add or remove in coding?

Well, you are getting the same results in the JSON that the SDK sends behind the scenes, but the object has additional null properties. I'm not clear why this is an issue for you. Simple null checks can be used to determine which of these have a value. You can even build your own type of dynamic objects by creating them on the fly and eliminating nulls if you really need this.

Inbar Gazit
  • 12,566
  • 1
  • 16
  • 23
  • Thanks for your reply. I am just curious to know why this difference. Even when I run API in this https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/liststatuschanges/?explorer=true I don't see parameters which are having NULL values. – riza446 Dec 16 '21 at 01:02
  • It is different because in Java, you cannot have a dynamic object. You have to pre-define each and every potential property, even if it may have a null value. – Inbar Gazit Dec 16 '21 at 02:46