docusign / docusign-objc-client

The Official DocuSign Objective-C Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
13 stars 14 forks source link

DSEnvelopesApi listStatus not working #16

Closed toseefkhilji closed 4 years ago

toseefkhilji commented 6 years ago

Hi There,

I'm trying to fetch listStatus with DSEnvelopesApi listStatus API Using Below Code:

        let envelopAPi = DSEnvelopesApi(apiClient: apiClient)
        let eRequest = DSEnvelopeIdsRequest()
        eRequest.envelopeIds = ["0fb86bcd-2044-440a-8d43-ecd96e38e3e6","cb67733a-0691-471b-81a1-eaf9b1caf19e"]
        let options = DSEnvelopesApi_ListStatusOptions()
        envelopAPi?.listStatus(withAccountId: config.appID, envelopeIdsRequest: eRequest, options: options, completionHandler: { (response, error) in
            debugPrint(error)
        })

But getting below error

errorCode = "INVALID_REQUEST_PARAMETER";
    message = "The request contained at least one invalid parameter. Query parameter 'from_date' must be set to a valid DateTime, or 'envelope_ids' or 'transaction_ids' must be specified."
LarryKlugerDS commented 4 years ago

Since you're setting the envelope IDs within the request body, you need to set the envelopeIds in the options (the query parameters) to the special value request_body

See the documentation for the API method: https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/listStatus