Overview
Method used to request the confirmation code to be sent.
Don’t forget that the phone number you send in this request must be the same one you verified in the previous API.If you receive a captcha in the response, confirm it via the captcha API before receiving the code.
Attributes
Your instance ID. Available in the Z-API panel under Instances.
Your Z-API instance token.
Body
Phone number with area code (e.g.: 4499999999)
Code delivery method: sms, voice or wa_old
Request Body
{
"ddi": "55",
"phone": "4499999999",
"method": "sms"
}
Response
200
Returns true if the code request was sent successfully
Base64 image with captcha code
Whether the number is banned or not
Time in seconds to wait before requesting a new code
Time to wait before requesting SMS
Time to wait before requesting voice call
Time to wait before requesting in-app pop-up
Success:
{
"success": true,
"retryAfter": 165,
"smsWaitSeconds": 125,
"voiceWaitSeconds": 125,
"waOldWaitSeconds": 125,
"method": "sms"
}
Blocked number:
{
"success": false,
"blocked": true
}
400
Invalid request. Check if the data you are sending matches the documentation.
405
Make sure you are correctly sending the method specification, that is, verify that you sent POST or GET as specified at the beginning of this topic.
415
If you receive a 415 error, make sure to add the “Content-Type” header to your request, which in most cases is “application/json”.