Skip to main content

Hello,

I'm having trouble creating the envelope when I set the delivery method to SMS or WhatsApp. In my tests, I send the following JSON to the Docusign API:

{
  "emailSubject": "Test AppBuilder - 1_1",
  "documents": s]
  "recipients": {
    "signers": s
      {
        "roleName": "CONTRACTOR",
        "name": "Carlos Oliveira",
        "email": "",
        "recipientId": "",
        "routingOrder": "1",
        "clientUserId": "",
        "deliveryMethod": "SMS",
        "phoneNumber": {
          "countryCode": "55",
          "number": ""
        },
        "tabs": {},
        }
    ],
  },
  "status": "sent",
  "sentDate": 1736456976955,
  "completeDate": null
}

The country code is the country code of Brazil.

I get an error while requesting server, received a non successful HTTP code /400] with response Body: "errorCode": "INVALID_PHONE_NUMBER_FOR_RECIPIENT",
"message": "The Phone number is invalid. Envelope definition is missing a phoneNumber for recipientId: "

@ME Developer 

I can see in your code snippet that you did not provide a phone number, so the error message is correct and tells you what to fix. I highlighted the missing value in the code snippet below:

        "phoneNumber": {
          "countryCode": "55",
          "number": ""
        },

 

Providing a valid phone number (only numbers, no spaces or special characters) should be able to create an envelope.


Thank you for the response, Michael.

However, I made a mistake in the example I provided in the post. Actually, in my case, I am indeed sending a value in the phone number field.

{
  "emailSubject": "Test AppBuilder - 1_1",
  "documents": s]
  "recipients": {
    "signers": s
      {
        "roleName": "CONTRACTOR",
        "name": "Carlos Oliveira",
        "email": "***Redacted content***",
        "recipientId": "***Redacted content***",
        "routingOrder": "1",
        "clientUserId": "***Redacted content***",
        "deliveryMethod": "SMS",
        "phoneNumber": {
          "countryCode": "55",
          "number": "***Redacted content***"
        },
        "tabs": {},
        }
    ],
  },
  "status": "sent",
  "sentDate": 1736456976955,
  "completeDate": null
}

Still, I keep receiving the same error message: INVALID_PHONE_NUMBER_FOR_RECIPIENT - The Phone number is invalid. Envelope definition is missing a phoneNumber for recipientId: