Перейти до основного вмісту

Конфігурація скрипту входу

This page documents the configuration parameters for the login script used in task creation.

Overview

The login script is used to automatically log in to a TikTok or Instagram account on a device. It navigates to the login page and enters the credentials stored in TikMatrix for the given account.

Account Credentials Required

Before using this script via API, make sure the account's username and password are stored in TikMatrix's account management.

Script Configuration (script_config)

The script_config object contains the parameters for the login script. Below are the available parameters:

Parameters

ParameterTypeRequiredDefaultDescription
usernamestringYes""The username of the account to log in. Must match an account stored in TikMatrix.

Examples

Login by Device Serial

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "login",
"script_config": {
"username": "@my_tiktok_account"
}
}'

Login by Username

Use username mode to create a login task for a specific account:

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"usernames": ["@my_tiktok_account"],
"script_name": "login",
"script_config": {
"username": "@my_tiktok_account"
}
}'

Login with Scheduled Start Time

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "login",
"script_config": {
"username": "@my_tiktok_account"
},
"start_time": "09:00"
}'

Login Multiple Accounts on Multiple Devices

curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"usernames": ["@account1", "@account2", "@account3"],
"script_name": "login",
"script_config": {}
}'
примітка

In username mode, the system automatically looks up each account and its associated device. The username in script_config is optional when using username mode, as the system uses the username from the usernames list.

Response

{
"code": 0,
"message": "success",
"data": {
"task_ids": [201],
"created_count": 1
}
}

Error Codes

CodeDescription
40001Missing required parameters
40003Script not supported via API
40301API access requires Pro+ plan

See Also