English
English
Appearance
English
English
Appearance
/public/account/telegram/connectLink the Telegram account that logged in through the QR code to your workspace. Call it once Get Session Telegram reports isConnected: true.
Authorization: Basic Base64(AccessKey:SecretKey))| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Session token returned by Create Session Telegram. |
curl -X POST "https://api.repliz.com/public/account/telegram/connect" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{"token":"SESSION_TOKEN"}'import axios from 'axios';
const response = await axios.post(
'https://api.repliz.com/public/account/telegram/connect',
{
token: 'SESSION_TOKEN',
},
{
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY',
},
},
);
console.log(response.data);const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const response = await fetch(
'https://api.repliz.com/public/account/telegram/connect',
{
method: 'POST',
headers: {
Authorization: `Basic ${credentials}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
token: 'SESSION_TOKEN',
}),
},
);
const data = await response.json();
console.log(data);{
"accountId": "69e97477a795504e0786cec6"
}{
"code": 402,
"message": "please upgrade plan to connect more account"
}{
"code": 403,
"message": "invalid status session"
}{
"code": 404,
"message": "session not found"
}{
"code": 401,
"message": "unauthorized"
}One Telegram account becomes one account in Repliz, with its Telegram user ID (for example 5123456789) as its generatedId. Connecting an account that is already in your workspace updates that account instead of adding a duplicate. When the Telegram account has no username, its display name is used as username.
Once connected, the account's private chats come into Get Chat and can be answered with the chat module of Update Automation Account. The channels and groups the account can post to are not separate accounts. Schedules for this account go to its Story unless you pick a channel or group per post: list them with Get Telegram Channel and pass one as additionalInfo.channel in Create Schedule.
402 means your workspace has reached its plan's account limit.403 invalid status session means the login isn't complete yet: the QR code hasn't been scanned, or the Two-Step Verification password hasn't been sent. Keep polling Get Session Telegram until isConnected is true.404 session not found means the session expired. Create a new session and have the user scan again.