2017-07-14 39 views
-2

嗨,我能夠加入signhere標籤發送的信封,但是當我試圖添加TextTabs它給下面的錯誤(我用剩下的API)不能添加TextTab

INVALID_REQUEST_BODY請求正文丟失或格式不正確。空對象不能轉換爲值類型。

下面是我的包絡定義

{ 
"documents": [{ 
     "documentId": "1136641236", 
     "uri": null, 
     "remoteUrl": null, 
     "name": "ABC Merchant Agreement", 
     "password": null, 
     "transformPdfFields": null, 
     "fileExtension": null, 
     "matchBoxes": null, 
     "order": null, 
     "pages": null, 
     "documentFields": null, 
     "encryptedWithKeyManager": null, 
     "documentBase64": "documentBase64", 
     "applyAnchorTabs": null 
    } 
], 
"recipients": { 
    "signers": [{ 
      "signatureInfo": null, 
      "defaultRecipient": null, 
      "tabs": { 
       "signHereTabs": [{ 
         "name": null, 
         "tabLabel": null, 
         "scaleValue": null, 
         "optional": null, 
         "documentId": "1136641236", 
         "recipientId": "2044556663", 
         "pageNumber": "1", 
         "xPosition": null, 
         "yPosition": null, 
         "anchorString": "SIGNATUREOWNER1", 
         "anchorXOffset": null, 
         "anchorYOffset": null, 
         "anchorUnits": null, 
         "anchorIgnoreIfNotPresent": null, 
         "anchorCaseSensitive": "True", 
         "anchorMatchWholeWord": "True", 
         "anchorHorizontalAlignment": null, 
         "tabId": null, 
         "templateLocked": null, 
         "templateRequired": null, 
         "conditionalParentLabel": null, 
         "conditionalParentValue": null, 
         "customTabId": null, 
         "mergeField": null, 
         "status": null, 
         "errorDetails": null 
        } 
       ], 
       "initialHereTabs": null, 
       "signerAttachmentTabs": null, 
       "approveTabs": null, 
       "declineTabs": null, 
       "fullNameTabs": null, 
       "dateSignedTabs": null, 
       "envelopeIdTabs": null, 
       "companyTabs": null, 
       "titleTabs": null, 
       "textTabs": [{ 
         "height": null, 
         "isPaymentAmount": null, 
         "formula": null, 
         "validationPattern": null, 
         "validationMessage": null, 
         "shared": null, 
         "requireInitialOnSharedChange": null, 
         "senderRequired": null, 
         "requireAll": null, 
         "name": "TextTab", 
         "value": null, 
         "originalValue": null, 
         "width": null, 
         "required": "true", 
         "locked": "false", 
         "concealValueOnDocument": null, 
         "disableAutoSize": null, 
         "maxLength": null, 
         "tabLabel": "gjk", 
         "font": null, 
         "bold": null, 
         "italic": null, 
         "underline": null, 
         "fontColor": null, 
         "fontSize": "Size12", 
         "documentId": "1136641236", 
         "recipientId": "2044556663", 
         "pageNumber": "1", 
         "xPosition": null, 
         "yPosition": null, 
         "anchorString": "TEXTTABPLACEHOLDER", 
         "anchorXOffset": null, 
         "anchorYOffset": null, 
         "anchorUnits": null, 
         "anchorIgnoreIfNotPresent": null, 
         "anchorCaseSensitive": "True", 
         "anchorMatchWholeWord": "True", 
         "anchorHorizontalAlignment": null, 
         "tabId": null, 
         "templateLocked": null, 
         "templateRequired": null, 
         "conditionalParentLabel": null, 
         "conditionalParentValue": null, 
         "customTabId": null, 
         "mergeField": null, 
         "status": null, 
         "errorDetails": null 
        } 
       ], 
       "numberTabs": null, 
       "ssnTabs": null, 
       "dateTabs": null, 
       "zipTabs": null, 
       "emailTabs": null, 
       "noteTabs": null, 
       "checkboxTabs": null, 
       "radioGroupTabs": null, 
       "listTabs": null, 
       "firstNameTabs": null, 
       "lastNameTabs": null, 
       "emailAddressTabs": null, 
       "formulaTabs": null 
      }, 
      "signInEachLocation": null, 
      "offlineAttributes": null, 
      "requireSignerCertificate": null, 
      "requireSignOnPaper": null, 
      "canSignOffline": null, 
      "isBulkRecipient": null, 
      "bulkRecipientsUri": null, 
      "recipientSuppliesTabs": null, 
      "excludedDocuments": null, 
      "name": "name", 
      "email": "emailid", 
      "emailRecipientPostSigningURL": null, 
      "signingGroupId": null, 
      "signingGroupName": null, 
      "signingGroupUsers": null, 
      "recipientId": "2044556663", 
      "recipientIdGuid": null, 
      "accessCode": null, 
      "addAccessCodeToEmail": null, 
      "requireIdLookup": null, 
      "idCheckConfigurationName": null, 
      "socialAuthentications": null, 
      "phoneAuthentication": null, 
      "samlAuthentication": null, 
      "smsAuthentication": null, 
      "userId": null, 
      "clientUserId": null, 
      "embeddedRecipientStartURL": null, 
      "customFields": null, 
      "routingOrder": "1", 
      "idCheckInformationInput": null, 
      "recipientAttachments": null, 
      "note": null, 
      "roleName": null, 
      "status": null, 
      "signedDateTime": null, 
      "deliveredDateTime": null, 
      "declinedDateTime": null, 
      "sentDateTime": null, 
      "declinedReason": null, 
      "deliveryMethod": null, 
      "faxNumber": null, 
      "templateLocked": null, 
      "templateRequired": null, 
      "emailNotification": null, 
      "inheritEmailNotificationConfiguration": null, 
      "errorDetails": null, 
      "recipientAuthenticationStatus": null, 
      "totalTabCount": null 
     } 
    ], 
    "agents": null, 
    "editors": null, 
    "intermediaries": null, 
    "carbonCopies": null, 
    "certifiedDeliveries": null, 
    "inPersonSigners": null, 
    "recipientCount": null, 
    "currentRoutingOrder": null, 
    "errorDetails": null 
}, 
"customFields": { 
    "textCustomFields": [{ 
      "fieldId": "788788", 
      "name": "AppNumber", 
      "show": "false", 
      "required": "false", 
      "value": "788788", 
      "configurationType": null, 
      "errorDetails": null 
     } 
    ], 
    "listCustomFields": null 
}, 
"eventNotification": null, 
"brandId": "BrandId", 
"allowRecipientRecursion": null, 
"templateId": null, 
"templateRoles": null, 
"compositeTemplates": null, 
"accessibility": null, 
"transactionId": null, 
"status": "sent", 
"documentsUri": null, 
"recipientsUri": null, 
"asynchronous": null, 
"envelopeUri": null, 
"emailSubject": "ABC Agreement", 
"emailBlurb": "Please Sign", 
"envelopeId": null, 
"signingLocation": null, 
"customFieldsUri": null, 
"envelopeIdStamping": null, 
"authoritativeCopy": null, 
"notification": { 
    "useAccountDefaults": null, 
    "reminders": { 
     "reminderEnabled": "true", 
     "reminderDelay": "1", 
     "reminderFrequency": "2" 
    }, 
    "expirations": { 
     "expireEnabled": "true", 
     "expireAfter": "2", 
     "expireWarn": "1" 
    } 
}, 
"notificationUri": null, 
"enforceSignerVisibility": null, 
"enableWetSign": null, 
"allowMarkup": null, 
"allowReassign": null, 
"createdDateTime": null, 
"lastModifiedDateTime": null, 
"deliveredDateTime": null, 
"sentDateTime": null, 
"completedDateTime": null, 
"voidedDateTime": null, 
"voidedReason": null, 
"deletedDateTime": null, 
"declinedDateTime": null, 
"statusChangedDateTime": null, 
"documentsCombinedUri": null, 
"certificateUri": null, 
"templatesUri": null, 
"messageLock": null, 
"recipientsLock": null, 
"useDisclosure": null, 
"emailSettings": null, 
"purgeState": null, 
"lockInformation": null, 
"is21CFRPart11": null 
} 

回答

1

請求JSON該錯誤消息表示,所有

空對象不能被轉換爲值類型。

刪除分配給它們的空值的屬性。以下JSON應該可以工作。

{ 
    "documents": [ 
     { 
      "documentId": "1136641236", 
      "name": "ABC Merchant Agreement", 
      "documentBase64": "documentBase64" 
     } 
    ], 
    "recipients": { 
     "signers": [ 
      { 
       "tabs": { 
        "signHereTabs": [ 
         { 
          "documentId": "1136641236", 
          "pageNumber": "1", 
          "anchorString": "SIGNATUREOWNER1", 
          "anchorCaseSensitive": "True", 
          "anchorMatchWholeWord": "True" 
         } 
        ], 
        "textTabs": [ 
         { 
          "name": "TextTab", 
          "required": "true", 
          "locked": "false", 
          "tabLabel": "gjk", 
          "fontSize": "Size12", 
          "documentId": "1136641236", 
          "pageNumber": "1", 
          "anchorString": "TEXTTABPLACEHOLDER", 
          "anchorCaseSensitive": "True", 
          "anchorMatchWholeWord": "True" 
         } 
        ] 
       }, 
       "name": "name", 
       "email": "emailid", 
       "recipientId": "2044556663", 
       "routingOrder": "1" 
      } 
     ] 
    }, 
    "customFields": { 
     "textCustomFields": [ 
      { 
       "fieldId": "788788", 
       "name": "AppNumber", 
       "show": "false", 
       "required": "false", 
       "value": "788788" 
      } 
     ] 
    }, 
    "brandId": "BrandId", 
    "status": "sent", 
    "emailSubject": "ABC Agreement", 
    "emailBlurb": "Please Sign", 
    "notification": { 
     "reminders": { 
      "reminderEnabled": "true", 
      "reminderDelay": "1", 
      "reminderFrequency": "2" 
     }, 
     "expirations": { 
      "expireEnabled": "true", 
      "expireAfter": "2", 
      "expireWarn": "1" 
     } 
    } 
} 
+0

但這種模式我是從的DocuSign API文檔了,我可能要在某些情況下,我想用錨繩功能,並在某些情況下使用其他方案的其他屬性,如,我可能想用X,Y所以我無法從我的c#類TextTab中刪除這些字段。如果這個空值是問題,那麼它也應該是signhere標籤的同樣問題,但正如我所提到的,我可以添加signhere標籤。 –

+0

您是否嘗試過不設置空值?當你這樣做會發生什麼?您是否使用DocuSign [C#SDK](https://github.com/docusign/docusign-csharp-client)。你能分享你的C#代碼嗎? –

+0

感謝您的幫助,問題已解決。問題就像我的模型中有兩個屬性(hight,width)是可以爲null的屬性,但實際上,這些屬性並非來自DocuSign的一端。當我將它們設置爲null時,錯誤,但是當我爲那些能夠發送文檔的屬性設置任何整數值時。 –