Confirm device transfer
curl --request GET \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed \
--header 'Client-Token: <api-key>'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed"
headers = {"Client-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Client-Token': '<api-key>'}};
fetch('https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed', 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/device-transfer-confirmed",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Client-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Client-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed")
.header("Client-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Client-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true
}Mobile
Confirm device transfer
Finalizes the WhatsApp transfer from the phone to the instance after confirmation on the device
GET
/
instances
/
{instanceId}
/
token
/
{token}
/
mobile
/
device-transfer-confirmed
Confirm device transfer
curl --request GET \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed \
--header 'Client-Token: <api-key>'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed"
headers = {"Client-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Client-Token': '<api-key>'}};
fetch('https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed', 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/device-transfer-confirmed",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Client-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Client-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed")
.header("Client-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/device-transfer-confirmed")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Client-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true
}Overview
Method used to finalize the WhatsApp transfer from the phone to the instance. It should be used after the Confirm code endpoint returnsdeviceConfirm: true in the response.
Confirm the transfer on the device before making the request.When receiving
deviceConfirm: true, WhatsApp will display a notification on the phone where it is registered asking to confirm the transfer. Only after accepting this confirmation on the device should you call this endpoint. Otherwise, the connection will not be transferred to the instance.Expected flow
- The Confirm code endpoint returns
"deviceConfirm": true - The user confirms the transfer on the phone where WhatsApp is registered
- After confirming on the device, call this endpoint
- The WhatsApp connection is transferred from the phone to the instance
Attributes
Header
string
required
Your instance ID. Available in the Z-API panel under Instances.
string
required
Your Z-API instance token.
Response
200
boolean
Returns true if the transfer has been successfully confirmed and the instance is connected.
{
"success": true
}