Respond captcha
curl --request POST \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha \
--header 'Client-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"captcha": "<string>"
}
'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha"
payload = { "captcha": "<string>" }
headers = {
"Client-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Client-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({captcha: '<string>'})
};
fetch('https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'captcha' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Client-Token: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha"
payload := strings.NewReader("{\n \"captcha\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Client-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha")
.header("Client-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"captcha\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Client-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"captcha\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Mobile
Respond captcha
Respond to the captcha required for sending the confirmation code
POST
/
instances
/
{instanceId}
/
token
/
{token}
/
mobile
/
respond-captcha
Respond captcha
curl --request POST \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha \
--header 'Client-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"captcha": "<string>"
}
'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha"
payload = { "captcha": "<string>" }
headers = {
"Client-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Client-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({captcha: '<string>'})
};
fetch('https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'captcha' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Client-Token: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha"
payload := strings.NewReader("{\n \"captcha\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Client-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha")
.header("Client-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"captcha\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/respond-captcha")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Client-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"captcha\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Overview
Method used to respond to the captcha required for sending the confirmation code.Attributes
Header
Body
Captcha code for confirmation. This captcha is displayed in the image returned when requesting the confirmation code.
Request Body
{
"captcha": "123456"
}
Response
200
Returns true if the captcha was answered correctly. If so, wait to receive the confirmation code and use it in the confirm code API.
{
"success": true
}