Closed bastien70 closed 1 year ago
Right now you're pulling in the whole envelope definition and passing that back, which the DocuSign API interprets as an attempt to touch a value that you can't change. A better way to approach this is to send an envelope definition that has nothing except "status":"voided" and the voidReason.
Remove the GetEnvelope line of your code and replace that with an empty envelope definition instead, while leaving the SetVoidedReason and SetStatus, and you should see this start working.
Oh okay, but I think you would like to say A better way to approach this is to send an ENVELOPE that has nothing except "status":"voided" and the voidReason.
and not an ENVELOPE DEFINITION ?
So, I did :
public function cancelEnvelope(
string $envelopeId,
string $reason,
)
{
$envelopesApi = new EnvelopesApi($this->login());
try {
$envelope = new Envelope();
$envelope->setVoidedReason($reason)
->setStatus('voided');
$envelopesApi->update($this->docuSignUserAccountId, $envelopeId, $envelope);
} catch (ApiException $e) {
throw new \RuntimeException($e->getMessage());
}
}
And it seemd to work ! :) Thank you!
Hello, I'm trying to void an envelope, like this :
But I've the following error :
How to fix this please ?