-->

listStatus endpoint include recipient status in re

2019-09-01 18:42发布

问题:

Is there a way to include the recipient statuses in the response body for the listStatus endpoint?

Here is the curl request I am making

curl -X PUT \
  https://na2.docusign.net/restapi/v2/accounts/XXXXX/envelopes/status?envelope_ids=request_body \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-DocuSign-Authentication: { ... }' \
  -d '{
    "envelopeIds": [
        "SOME ENVELOPE ID",
        "ANOTHER ENVELOPE ID"
    ]
  }'

Here is the result I am getting

{
    "resultSetSize": "76",
    "totalSetSize": "76",
    "startPosition": "0",
    "endPosition": "75",
    "nextUri": "",
    "previousUri": "",
    "envelopes": [
        {
            "status": "sent",
            "documentsUri": "/envelopes/XXXX/documents",
            "recipientsUri": "/envelopes/XXXX/recipients",
            "attachmentsUri": "/envelopes/XXXX/attachments",
            "envelopeUri": "/envelopes/XXXX",
            "envelopeId": "XXXX",
            "customFieldsUri": "/envelopes/XXXX/custom_fields",
            "notificationUri": "/envelopes/12da3965-99cb-4c2d-9d3d-587a32fca118/notification",
            "statusChangedDateTime": "2017-08-07T14:34:38.4530000Z",
            "documentsCombinedUri": "/envelopes/XXXX/documents/combined",
            "certificateUri": "/envelopes/XXXX/documents/certificate",
            "templatesUri": "/envelopes/XXXX/templates"
        },
        ...
    ]
}

In the documentation page, it shows an example response that includes

{
    "resultSetSize": "76",
    "totalSetSize": "76",
    "startPosition": "0",
    "endPosition": "75",
    "nextUri": "",
    "previousUri": "",
    "envelopes": [
        {
            "status": "sent",
            "documentsUri": "/envelopes/XXXX/documents",
            "recipientsUri": "/envelopes/XXXX/recipients",
            "attachmentsUri": "/envelopes/XXXX/attachments",
            "envelopeUri": "/envelopes/XXXX",
            "envelopeId": "XXXX",
            "customFieldsUri": "/envelopes/XXXX/custom_fields",
            "notificationUri": "/envelopes/12da3965-99cb-4c2d-9d3d-587a32fca118/notification",
            "statusChangedDateTime": "2017-08-07T14:34:38.4530000Z",
            "documentsCombinedUri": "/envelopes/XXXX/documents/combined",
            "certificateUri": "/envelopes/XXXX/documents/certificate",
            "templatesUri": "/envelopes/XXXX/templates",
            "recipients": {
              "signers": [
                {
                   "status": "sent",
                   ...
                }
              ]
            },
        },
        ...
    ]
}

I am not sure what I need to do to my original request to includes that recipients section in the response. Does anyone know if I am missing some kind of url param or body param or something?

回答1:

This is not possible in the Envelopes: listStatus endpoint, it seems the response which you are seeing in sample JSON is autocreated by Swagger for the Envelope class. If you want to see all the details in one call then you need to make such call for each envelope using below endpoint,

/restapi/v2/accounts/{{AccountIdVal}}/envelopes/{envelopeId}?include=custom_fields,recipients,tabs&advanced_update=true