Skip to main content
POST
/
v1
/
phones
/
{phone_id}
/
drag
/
select
Drag by Description
curl --request POST \
  --url https://api.example.com/v1/phones/{phone_id}/drag/select
Drag 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: TK_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"from_selector": "the slider handle", "to_selector": "the right end of the slider"}'

Path Parameters

ParameterTypeDescription
phone_idstringThe phone identifier

Query Parameters

ParameterTypeDefaultDescription
asyncbooleanfalseReturn immediately with job ID

Request Body

{
  "from_selector": "the slider handle",
  "to_selector": "the right end of the slider"
}
FieldTypeDescription
from_selectorstringNatural language description of where to start dragging
to_selectorstringNatural 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: TK_..." \
  -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 the drag() 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.