envelopesApi.createRecipientView() of docusign keep return 400 Bad request error

62 views Asked by At

here are my code

    let viewRequest = new docuSign.RecipientViewRequest();
    viewRequest.returnUrl = this.returnUrl;
    viewRequest.authenticationMethod = "none";
    viewRequest.email = signerEmail;
    viewRequest.userName = signerName;
    viewRequest.clientUserId = this.clientUserId; //?
    viewRequest.pingFrequency = 600;
    console.log("view request", viewRequest);
    console.log("accountInfo.apiAccountId", accountInfo.apiAccountId);
    console.log("envelopeId", envelopeId);
    result = await envelopesApi.createRecipientView(
    accountInfo.apiAccountId,
    envelopeId,
    {
    recipientViewRequest: viewRequest,
    }
    );

it keep return 400 error bad request

    returnUrl="www.google.com"
    clientUserId=1;
    signerEmail = "[email protected]";
    signerName = "tran le ha";

here is the signer i used for envelope

    let signer = docuSign.Signer.constructFromObject({
    email: envelopeArgs.signerEmail,
    name: envelopeArgs.signerName,
    recipientId: "1",
    clientUserId: this.clientUserId,
    });

the apiAccountId i used for both envelope is the same and i use jwt grant authenticate

Can any one help me fix this, i dont know what iam doing wrong

1

There are 1 answers

2
Larry K On
  1. Try setting
    viewRequest.returnUrl = "https://google.com";
  1. Provide the error message from the response. You can use API logging for this.