Read the current account
Section titled “Read the current account”The user model includes login, email, balance in cents, port usage and limit, discount percentage, and connection preferences.
curl "https://api.ltesocks.io/v2/user" \ -H "Authorization: Bearer ${LTESOCKS_API_TOKEN}"Official SDK
Section titled “Official SDK”import { LTESocksClient } from '@ltesocks/sdk';
const client = LTESocksClient.withBearerToken( process.env.LTESOCKS_API_TOKEN, { language: 'en' },);const user = await client.user.get();
console.log(user.login);import os
from ltesocks_sdk import Client
with Client.with_bearer_token( os.environ["LTESOCKS_API_TOKEN"], language="en",) as client: user = client.user.get() print(user.login)<?php
use LTESocks\Client;
require __DIR__ . '/vendor/autoload.php';
$client = Client::builder() ->withBearerToken((string) getenv('LTESOCKS_API_TOKEN')) ->withLanguage('en') ->build();$user = $client->user()->get();
echo $user->getLogin();Update defaults
Section titled “Update defaults”Preferences control the default VPN host, proxy host, and proxy protocol used by account tools:
{ "vpnServer": "vpn1.ltesocks.io", "proxyServer": "ap1.ltesocks.io", "proxyProtocol": "socks5"}Allowed proxy protocols in the v2 contract are http, https, and socks5. Obtain current hosts from GET /servers; do not assume the example hosts are available to every account.
Official SDK
Section titled “Official SDK”const user = await client.user.updatePreferences({ body: { vpnServer: 'vpn1.ltesocks.io', proxyServer: 'ap1.ltesocks.io', proxyProtocol: 'socks5', },});from ltesocks_sdk.models import ( UserPreferences, UserPreferencesProxyProtocol,)
user = client.user.update_preferences( body=UserPreferences( vpn_server="vpn1.ltesocks.io", proxy_server="ap1.ltesocks.io", proxy_protocol=UserPreferencesProxyProtocol.SOCKS5, ))<?php
use LTESocks\Dto\UserPreferences;
$user = $client->user()->updatePreferences(new UserPreferences([ 'vpnServer' => 'vpn1.ltesocks.io', 'proxyServer' => 'ap1.ltesocks.io', 'proxyProtocol' => 'socks5',]));The successful response is the updated user object. When updating preferences, send a complete set of values your integration intends to own and verify the returned object.
Residential traffic
Section titled “Residential traffic”residentialProxy.availableData contains remaining residential traffic in bytes. residentialProxy.password can be null when unavailable. For per-user credentials and quotas, see Residential sub-users and traffic.