Drag by Description
curl --request POST \
--url https://api.example.com/v1/phones/{phone_id}/drag/selectimport requests
url = "https://api.example.com/v1/phones/{phone_id}/drag/select"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/phones/{phone_id}/drag/select', 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.example.com/v1/phones/{phone_id}/drag/select",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/v1/phones/{phone_id}/drag/select"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v1/phones/{phone_id}/drag/select")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/phones/{phone_id}/drag/select")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyDrag by Description
Drag between elements using natural language descriptions
POST
/
v1
/
phones
/
{phone_id}
/
drag
/
select
Drag by Description
curl --request POST \
--url https://api.example.com/v1/phones/{phone_id}/drag/selectimport requests
url = "https://api.example.com/v1/phones/{phone_id}/drag/select"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/phones/{phone_id}/drag/select', 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.example.com/v1/phones/{phone_id}/drag/select",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/v1/phones/{phone_id}/drag/select"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v1/phones/{phone_id}/drag/select")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/phones/{phone_id}/drag/select")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyDrag from one element to another, both described in natural language. Uses vision AI to find both elements and drag between them.
Request
curl -X POST https://api.tapkit.ai/v1/phones/{phone_id}/drag/select \
-H "X-API-Key: joot_your_api_key" \
-H "Content-Type: application/json" \
-d '{"from_selector": "the slider handle", "to_selector": "the right end of the slider"}'
Path Parameters
| Parameter | Type | Description |
|---|---|---|
phone_id | string | The phone identifier |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
async | boolean | false | Return immediately with job ID |
Request Body
{
"from_selector": "the slider handle",
"to_selector": "the right end of the slider"
}
| Field | Type | Description |
|---|---|---|
from_selector | string | Natural language description of where to start dragging |
to_selector | string | Natural language description of where to drag to |
Response
Synchronous
{
"id": "job_abc123",
"status": "completed",
"result": {},
"created_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T10:30:02Z"
}
Asynchronous
{
"job_id": "job_abc123"
}
Examples
Adjust a Slider
curl -X POST https://api.tapkit.ai/v1/phones/abc123/drag/select \
-H "X-API-Key: joot_..." \
-H "Content-Type: application/json" \
-d '{"from_selector": "the volume slider thumb", "to_selector": "the maximum volume position"}'
SDK Usage
The Python SDK provides this through thedrag() method with string arguments:
phone.drag("the slider handle", "the right end of the slider")
phone.drag("the file icon", "the trash folder")
phone.drag("the brightness control", "the middle of the slider")
When using the SDK, both arguments must be the same type - either both selectors (strings) or both coordinates. You cannot mix them.
Related Endpoints
- Drag - Drag between specific coordinates
- Hold and Drag - Hold before dragging
⌘I